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 Deployment

kubectl -n spline-reticulator edit deployment front-end

bash 复制代码
...
  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 --type=NodePort --port=80 --target-port=80 --name=front-end-svc

提示 exposed,表示创建 svc 成功

< 4 > 最后 curl 检查 svc

kubectl -n spline-reticulator get svc front-end-svc -o wide

相关推荐
nVisual11 小时前
巡检任务与工单闭环方案
运维·服务器·数据库·数据中心基础设施
chen<>11 小时前
网络 IO 多路复用万字深度详解:select/poll/epoll/io_uring
网络·select·epoll·io_uring
_abab11 小时前
Rust重塑系统编程:从Linux内核到AI推理引擎的2026全景解析
linux·人工智能·rust
初圣魔门首席弟子11 小时前
TypeScript 类型系统完全指南:从基础到高级工具类型(知识库版)
linux·运维·ubuntu
CQU_JIAKE11 小时前
7.23[a]
linux·运维·服务器
想学好C++的oMen11 小时前
socket编程TCP
linux·网络·网络协议·tcp/ip
ShirleyWang01212 小时前
Linux中Vim编辑器快速找到需要改的行
linux·编辑器·vim
weixin_4573402112 小时前
ssh 本地链接服务器地址和服务器查看本地地址
运维·服务器·ssh
MXsoft61813 小时前
在大型混合云网络环境中,如何高效实现自动化运维?
运维·网络·自动化
盐焗鹌鹑蛋13 小时前
【Linux】基本指令
linux