golang-im聊天
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

53 rindas
1.1 KiB

  1. # deployment 配置
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: logic-deployment
  6. namespace: gim
  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/zyos-gim-logic:20221128-01'
  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: gim
  44. labels:
  45. app: logic # 只有设置label,才能被服务发现找到
  46. spec:
  47. selector:
  48. app: logic
  49. ports:
  50. - protocol: TCP
  51. port: 8000
  52. targetPort: 8000