apiVersion: v1 # 指定api版本,此值必须在kubectl api-versions中 kind: Service # 指定创建资源的角色/类型 metadata: # 资源的元数据/属性 labels: # 设定资源的标签 app: yifu-msg # 资源的名字,在同一个namespace中必须唯一 name: yifu-msg # 资源的名字,在同一个namespace中必须唯一 namespace: qas-mvp # 部署在哪个namespace中 spec: # 资源规范字段 ports: - port: 5026 # service 端口 protocol: TCP # 协议 targetPort: 5026 # 容器暴露的端口
name: http-msg # 端口名称
- port: 3500 # service 端口 protocol: TCP # 协议 targetPort: 3500 # 容器暴露的端口
name: http-msg-dapr
selector: # 选择器 app: yifu-msg # 资源名称 type: ClusterIP # ClusterIP 类型