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.

111 lines
2.8 KiB

  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: $K8S_DEPLOY_PARAM_CURR_MODEL_NAME
  5. namespace: $K8S_DEPLOY_PARAM_CURR_K8S_NAMESPACE
  6. spec:
  7. selector:
  8. app: $K8S_DEPLOY_PARAM_CURR_MODEL_NAME-$K8S_DEPLOY_PARAM_RESOURCE_SUFFIX
  9. ports:
  10. - name: http
  11. port: 80
  12. protocol: TCP
  13. targetPort: 80
  14. - name: https
  15. port: 443
  16. protocol: TCP
  17. targetPort: 443
  18. - name: tcp
  19. port: 81
  20. protocol: TCP
  21. targetPort: 81
  22. ---
  23. apiVersion: apps/v1
  24. kind: Deployment
  25. metadata:
  26. name: $K8S_DEPLOY_PARAM_CURR_MODEL_NAME-$K8S_DEPLOY_PARAM_RESOURCE_SUFFIX
  27. namespace: $K8S_DEPLOY_PARAM_CURR_K8S_NAMESPACE
  28. spec:
  29. selector:
  30. matchLabels:
  31. app: $K8S_DEPLOY_PARAM_CURR_MODEL_NAME-$K8S_DEPLOY_PARAM_RESOURCE_SUFFIX
  32. replicas: 1
  33. template:
  34. metadata:
  35. namespace: $K8S_DEPLOY_PARAM_CURR_K8S_NAMESPACE
  36. labels:
  37. app: $K8S_DEPLOY_PARAM_CURR_MODEL_NAME-$K8S_DEPLOY_PARAM_RESOURCE_SUFFIX
  38. spec:
  39. imagePullSecrets:
  40. - name: aliyun-acr-secret
  41. containers:
  42. - env:
  43. - name: MYSQL_HOST
  44. valueFrom:
  45. secretKeyRef:
  46. key: host
  47. name: mysql
  48. - name: MYSQL_PORT
  49. valueFrom:
  50. secretKeyRef:
  51. key: port
  52. name: mysql
  53. - name: MYSQL_DB_NAME
  54. valueFrom:
  55. secretKeyRef:
  56. key: db_name
  57. name: mysql
  58. - name: MYSQL_USER
  59. valueFrom:
  60. secretKeyRef:
  61. key: user
  62. name: mysql
  63. - name: MYSQL_PASSWORD
  64. valueFrom:
  65. secretKeyRef:
  66. key: password
  67. name: mysql
  68. - name: REDIS_HOST
  69. valueFrom:
  70. secretKeyRef:
  71. key: host
  72. name: redis
  73. - name: REDIS_PORT
  74. valueFrom:
  75. secretKeyRef:
  76. key: port
  77. name: redis
  78. - name: REDIS_USER
  79. valueFrom:
  80. secretKeyRef:
  81. key: user
  82. name: redis
  83. - name: REDIS_PASSWORD
  84. valueFrom:
  85. secretKeyRef:
  86. key: password
  87. name: redis
  88. - name: aliyun_logs_log-$K8S_DEPLOY_PARAM_RESOURCE_SUFFIX
  89. value: stdout
  90. name: $K8S_DEPLOY_PARAM_CURR_MODEL_NAME-$K8S_DEPLOY_PARAM_RESOURCE_SUFFIX
  91. image: $K8S_DEPLOY_PARAM_ARC_PREFIX/$K8S_DEPLOY_PARAM_CURR_MODEL_NAME:$K8S_DEPLOY_PARAM_IMAGE_TAG
  92. imagePullPolicy: Always
  93. ports:
  94. - containerPort: 80
  95. name: http
  96. protocol: TCP
  97. - containerPort: 443
  98. name: https
  99. protocol: TCP
  100. - containerPort: 81
  101. name: rpc
  102. protocol: TCP
  103. volumeMounts:
  104. - mountPath: /etc/localtime
  105. name: tz-config
  106. volumes:
  107. - hostPath:
  108. path: /etc/localtime
  109. type: ""
  110. name: tz-config