CKA-2026-Service

张开发
2026/4/9 2:35:10 15 分钟阅读

分享文章

CKA-2026-Service
Task重新配置 spline-reticulator namespace 中现有的 front-end Deployment以公开现有容器 nginx 的端口 80/tcp创建一个名为 front-end-svc 的新 Service 以公开容器端口 80/tcp配置新的 Service 以通过 NodePort 公开各个 Pod 2 在线修改 front-end Deploymentkubectl -n spline-reticulator edit deployment front-end... template: ... spec: containers: - image: nginx # 暴露容器的80端口TCP ports: - containerPort: 80 protocol: TCP ...提示 edited,表示修改成功 3 使用 NodePort 类型,暴露 80/tcp 端口kubectl -n spline-reticulator expose deployment front-end --typeNodePort --port80 --target-port80 --namefront-end-svc提示 exposed,表示创建 svc 成功 4 最后 curl 检查 svckubectl -n spline-reticulator get svc front-end-svc -o wide

更多文章