# 接口版本 apiVersion: apps/v1 # 接口类型 kind: Deployment metadata: name: fe-service-ebtp-frontend namespace: default labels: app: fe-service-ebtp-frontend # 必选,详细定义 spec: # pod 副本数量 replicas: 1 # 选择器,匹配pod模板 selector: matchLabels: app: fe-service-ebtp-frontend template: metadata: labels: # 模板名称 app: fe-service-ebtp-frontend # 定义容器模板,该模板可以包含多个容器 spec: # 必选,Pod中容器列表 containers: - name: jl-example image: harbor.dcos.guangzhou.unicom.local/eshop/fe-service-ebtp-frontend:latest # 需要暴露的端口库号列表 ports: - containerPort: 18022 --- kind: Service apiVersion: v1 metadata: name: fe-service-ebtp-frontend namespace: default labels: app: fe-service-ebtp-frontend annotations: lb.cke.tg.unicom/target-vports: 18022-18022 spec: ports: - port: 18022 targetPort: 18022 selector: app: fe-service-ebtp-frontend status: loadBalancer: {}