yifu-codegen-service.yaml 1.06 KB
Newer Older
1 2 3 4 5 6 7 8 9
apiVersion: v1                 # 指定api版本,此值必须在kubectl api-versions中
kind: Service                  # 指定创建资源的角色/类型
metadata:                      # 资源的元数据/属性
  labels:                      # 设定资源的标签
    app: yifu-codegen             # 资源的名字,在同一个namespace中必须唯一
  name: yifu-codegen              # 资源的名字,在同一个namespace中必须唯一
  namespace: qas-mvp           # 部署在哪个namespace中
spec:                          # 资源规范字段
  ports:
10
    - port: 8000               # service 端口
11
      protocol: TCP            # 协议
12
      targetPort: 8000         # 容器暴露的端口
13
      name: http-codegen              # 端口名称
14 15 16
    - port: 3500               # service 端口
      protocol: TCP            # 协议
      targetPort: 3500         # 容器暴露的端口
17
      name: http-codegen-dapr
18 19 20
  selector:                    # 选择器
    app: yifu-codegen             # 资源名称
  type: ClusterIP              # ClusterIP 类型