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

相关推荐
orion5713 小时前
Missing Semester Class1:course overview and introduction of shell
linux
用户1204872216120 小时前
Linux驱动编译与加载
linux·嵌入式
程序员老赵21 小时前
服务器文件不想 SFTP 上传?Docker 跑个 File Browser,浏览器就能管理
服务器·docker·开源
vivo互联网技术1 天前
从 10 分钟到 1 秒:ES 深度分页任意跳页的三轮优化实战
服务器·数据库·redis·elasticsearch·深度分页
用户805533698031 天前
Input 子系统架构:Core、Handler、Driver 三层是怎么协作的
linux·嵌入式
用户805533698031 天前
RK-Forge外设系列开篇 - 把板子从「能启动」变成「能用」:Ethernet/SPI/MMC 三个纯接线外设
linux·github·嵌入式
七歌杜金房2 天前
我终于又有了自己的 Linux 电脑
linux·debian·mac
tntxia3 天前
linux curl命令详解_curl详解
linux
扛枪的书生3 天前
Linux 网络管理器用法速查
linux