golang-im聊天
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

logic.yaml 1.1 KiB

2 years ago
2 years ago
2 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # deployment 配置
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: logic-deployment
  6. labels:
  7. app: logic
  8. spec:
  9. replicas: 1
  10. selector:
  11. matchLabels:
  12. app: logic
  13. template:
  14. metadata:
  15. labels:
  16. app: logic
  17. spec:
  18. containers:
  19. - name: logic
  20. image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/zyos-logic:202209018-02'
  21. imagePullPolicy: Always # 在kind中需要指定,不然会强制到远程拉取镜像,导致部署失败
  22. ports:
  23. - containerPort: 8001
  24. volumeMounts: # 映射文件为宿主机文件
  25. - mountPath: /log/
  26. name: log
  27. env:
  28. - name: POD_IP
  29. valueFrom:
  30. fieldRef:
  31. fieldPath: status.podIP
  32. volumes:
  33. - name: log
  34. hostPath:
  35. path: /log/
  36. ---
  37. # service 配置
  38. apiVersion: v1
  39. kind: Service
  40. metadata:
  41. name: logic
  42. labels:
  43. app: logic # 只有设置label,才能被服务发现找到
  44. spec:
  45. selector:
  46. app: logic
  47. ports:
  48. - protocol: TCP
  49. port: 8000
  50. targetPort: 8000