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