deploy-tmp.yaml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. ---
  2. apiVersion: apps/v1
  3. kind: $JNLP_CONTROL
  4. metadata:
  5. name: $DRONE_REPO_NAME
  6. namespace: $JNLP_ENV
  7. labels:
  8. app: $DRONE_REPO_NAME
  9. spec:
  10. serviceName: $DRONE_REPO_NAME
  11. replicas: $JNLP_REPLICAS
  12. selector:
  13. matchLabels:
  14. app: $DRONE_REPO_NAME
  15. template:
  16. metadata:
  17. labels:
  18. app: $DRONE_REPO_NAME
  19. spec:
  20. terminationGracePeriodSeconds: 180
  21. initContainers:
  22. - name: init
  23. image: $JNLP_REPO/dev/busybox
  24. command: ["chmod","777","-R","$JNLP_MOUNT_PATH"]
  25. imagePullPolicy: Always
  26. volumeMounts:
  27. - name: volume
  28. mountPath: $JNLP_MOUNT_PATH
  29. containers:
  30. - name: $DRONE_REPO_NAME
  31. image: $JNLP_REPO/$JNLP_ENV/$DRONE_REPO_NAME:$JNLP_TAG
  32. imagePullPolicy: Always
  33. ports:
  34. - containerPort: $JNLP_CONTAINER_PORT
  35. name: port
  36. volumeMounts:
  37. - name: volume
  38. mountPath: $JNLP_MOUNT_PATH
  39. livenessProbe:
  40. tcpSocket:
  41. port: $JNLP_CONTAINER_PORT
  42. initialDelaySeconds: $JNLP_LIVENESS_INIT
  43. periodSeconds: $JNLP_LIVENESS_PER
  44. readinessProbe:
  45. tcpSocket:
  46. port: $JNLP_CONTAINER_PORT
  47. initialDelaySeconds: $JNLP_READINESS_INIT
  48. periodSeconds: $JNLP_READINESS_PER
  49. volumeClaimTemplates:
  50. - metadata:
  51. name: volume
  52. spec:
  53. accessModes: ["ReadWriteOnce"]
  54. storageClassName: rbd
  55. resources:
  56. requests:
  57. storage: $JNLP_STORAGE_CAPACITY
  58. ---
  59. apiVersion: v1
  60. kind: Service
  61. metadata:
  62. name: $DRONE_REPO_NAME-svc
  63. namespace: $JNLP_ENV
  64. labels:
  65. app: $DRONE_REPO_NAME-svc
  66. spec:
  67. type: NodePort
  68. ports:
  69. - port: $JNLP_CONTAINER_PORT
  70. targetPort: $JNLP_CONTAINER_PORT
  71. selector:
  72. app: $DRONE_REPO_NAME
  73. ---
  74. apiVersion: extensions/v1beta1
  75. kind: Ingress
  76. metadata:
  77. name: $DRONE_REPO_NAME-ingress
  78. namespace: $JNLP_ENV
  79. annotations:
  80. kubernetes.io/ingress.class: $JNLP_INGRESS
  81. spec:
  82. rules:
  83. - host: www.easou.cn
  84. http:
  85. paths:
  86. - path: /
  87. backend:
  88. serviceName: $JNLP_CONTROL_NAME-svc
  89. servicePort: $JNLP_CONTAINER_PORT
  90. - host: wap.easou.cn
  91. http:
  92. paths:
  93. - path: /
  94. backend:
  95. serviceName: $JNLP_CONTROL_NAME-svc
  96. servicePort: $JNLP_CONTAINER_PORT
  97. - host: easou.cn
  98. http:
  99. paths:
  100. - path: /
  101. backend:
  102. serviceName: $JNLP_CONTROL_NAME-svc
  103. servicePort: $JNLP_CONTAINER_PORT
  104. - host: a.easou.cn
  105. http:
  106. paths:
  107. - path: /
  108. backend:
  109. serviceName: $JNLP_CONTROL_NAME-svc
  110. servicePort: $JNLP_CONTAINER_PORT
  111. - host: www.appeasou.com
  112. http:
  113. paths:
  114. - path: /
  115. backend:
  116. serviceName: $JNLP_CONTROL_NAME-svc
  117. servicePort: $JNLP_CONTAINER_PORT
  118. - host: wap.appeasou.com
  119. http:
  120. paths:
  121. - path: /
  122. backend:
  123. serviceName: $JNLP_CONTROL_NAME-svc
  124. servicePort: $JNLP_CONTAINER_PORT
  125. - host: appeasou.com
  126. http:
  127. paths:
  128. - path: /
  129. backend:
  130. serviceName: $JNLP_CONTROL_NAME-svc
  131. servicePort: $JNLP_CONTAINER_PORT
  132. - host: a.appeasou.com
  133. http:
  134. paths:
  135. - path: /
  136. backend:
  137. serviceName: $JNLP_CONTROL_NAME-svc
  138. servicePort: $JNLP_CONTAINER_PORT
  139. - host: www.easou.com
  140. http:
  141. paths:
  142. - path: /
  143. backend:
  144. serviceName: $JNLP_CONTROL_NAME-svc
  145. servicePort: $JNLP_CONTAINER_PORT
  146. - host: wap.easou.com
  147. http:
  148. paths:
  149. - path: /
  150. backend:
  151. serviceName: $JNLP_CONTROL_NAME-svc
  152. servicePort: $JNLP_CONTAINER_PORT
  153. - host: easou.com
  154. http:
  155. paths:
  156. - path: /
  157. backend:
  158. serviceName: $JNLP_CONTROL_NAME-svc
  159. servicePort: $JNLP_CONTAINER_PORT
  160. - host: a.easou.com
  161. http:
  162. paths:
  163. - path: /
  164. backend:
  165. serviceName: $JNLP_CONTROL_NAME-svc
  166. servicePort: $JNLP_CONTAINER_PORT