apiVersion: apps/v1
kind: Deployment
metadata:
  name: jxcms
  labels:
    run: jxcms
spec:
  replicas: 4
  selector:
    matchLabels:
      run: jxcms
  template:
    metadata:
      labels:
        run: jxcms ## 与之后创建 service 对应
    spec:
      containers:
      - name: jxcms
        image: 10.10.10.11:5000/jxcms:11
        ports:
        - containerPort: 80
        env:
        - name: RMYSQL_ACC_ADDR
          value: 10.10.10.35
        - name: WMYSQL_ACC_ADDR
          value: 10.10.10.36
---
apiVersion: v1
kind: Service
metadata:
  name: jxcms
spec:
  # type: NodePort
  type: ClusterIP
  selector:
    run: jxcms   ## 对应 Deployment 的 run
  ports:
  - protocol: TCP
    port: 80 # 负载均衡器对外的服务端口
    targetPort: 80 # 访问集群的端口
