# deployment 配置 apiVersion: apps/v1 kind: Deployment metadata: name: connect-deployment namespace: gim labels: app: connect spec: replicas: 1 selector: matchLabels: app: connect template: metadata: labels: app: connect spec: containers: - name: connect image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/zyos-gim-connect:20221128-01' imagePullPolicy: Always ports: - containerPort: 8000 - containerPort: 8001 - containerPort: 8002 volumeMounts: # 映射文件为宿主机文件 - mountPath: /log/ name: log env: - name: POD_IP valueFrom: fieldRef: fieldPath: status.podIP volumes: - name: log hostPath: path: /log/ --- # service 配置 apiVersion: v1 kind: Service metadata: name: connect namespace: gim labels: app: connect # 只有设置label,才能被服务发现找到 spec: selector: app: connect ports: - name: rpclisten protocol: TCP port: 8000 targetPort: 8000 - name: tcplisten protocol: TCP port: 8001 targetPort: 8001 - name: wslisten protocol: TCP port: 8002 targetPort: 8002