广告平台(媒体使用)
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.
 
 
 
 
 
 

79 lines
2.7 KiB

  1. kind: Deployment
  2. apiVersion: apps/v1
  3. # 元数据
  4. metadata:
  5. name: advertisement-medium
  6. namespace: advertisement
  7. labels:
  8. app: advertisement-medium
  9. annotations:
  10. kubesphere.io/creator: dengbiao
  11. kubesphere.io/description: advertisement-medium
  12. # deployment主要部分
  13. spec:
  14. replicas: 1
  15. selector:
  16. matchLabels:
  17. # 名称与上面的labels对应
  18. app: advertisement-medium
  19. template:
  20. metadata:
  21. labels:
  22. # 名称与上面的matchLabels对应
  23. app: advertisement-medium
  24. spec:
  25. # 声明挂载卷(将外部已存在的pvc、config等挂载进来)
  26. volumes:
  27. # 用于时区校正
  28. - name: host-time
  29. hostPath:
  30. path: /etc/localtime
  31. type: ''
  32. # 将前面创建的configMap也挂载进来
  33. - name: advertisement-medium-cfg
  34. configMap:
  35. # 这里的名字就是前面创建的configMap的名字
  36. name: advertisement-medium-cfg
  37. defaultMode: 420
  38. containers:
  39. # 主容器
  40. - name: advertisement-medium-container
  41. # 镜像地址(提前打包好并推送的镜像仓库)
  42. image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/advertisement-medium:0.0.1'
  43. ports:
  44. - name: advertisement-tcp-1004
  45. # 容器端口号(注意与golang web server启动的端口一致)
  46. containerPort: 1004
  47. protocol: TCP
  48. # 将前面volume声明的需要用到的pvc、config挂载上来
  49. volumeMounts:
  50. - name: host-time
  51. readOnly: true
  52. mountPath: /etc/localtime
  53. - name: advertisement-medium-cfg # 该名字对应前面volumes声明的名字
  54. readOnly: true
  55. # 挂载到容器的哪个路径
  56. mountPath: /var/zyos
  57. imagePullPolicy: Always
  58. # Nginx 容器
  59. - name: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/nginx:latest'
  60. image: nginx
  61. ports:
  62. - name: http-80
  63. containerPort: 80
  64. protocol: TCP
  65. volumeMounts:
  66. # 时区校正
  67. - name: host-time
  68. readOnly: true
  69. mountPath: /etc/localtime
  70. # 存储卷 用于存放前端代码
  71. - name: advertisement-medium-pvc # 前面volumes声明的名称
  72. mountPath: /usr/share/nginx/html
  73. - name: advertisement-medium-nginx # Nginx 配置
  74. readOnly: true
  75. mountPath: /etc/nginx/conf.d/default.conf
  76. subPath: default.conf
  77. restartPolicy: Always
  78. terminationGracePeriodSeconds: 30
  79. dnsPolicy: ClusterFirst