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

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