deploy-tmp.yaml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. replicas: $JNLP_REPLICAS
  11. selector:
  12. matchLabels:
  13. app: $DRONE_REPO_NAME
  14. template:
  15. metadata:
  16. labels:
  17. app: $DRONE_REPO_NAME
  18. spec:
  19. terminationGracePeriodSeconds: 180
  20. initContainers:
  21. - name: init
  22. image: $JNLP_REPO/dev/busybox
  23. command: ["chmod","777","-R","$JNLP_MOUNT_PATH"]
  24. imagePullPolicy: Always
  25. volumeMounts:
  26. - name: volume
  27. mountPath: $JNLP_MOUNT_PATH
  28. containers:
  29. - name: $DRONE_REPO_NAME
  30. image: $JNLP_REPO/$JNLP_ENV/$DRONE_REPO_NAME:$JNLP_TAG
  31. imagePullPolicy: Always
  32. ports:
  33. - containerPort: $JNLP_CONTAINER_PORT
  34. name: port
  35. livenessProbe:
  36. tcpSocket:
  37. port: $JNLP_CONTAINER_PORT
  38. initialDelaySeconds: $JNLP_LIVENESS_INIT
  39. periodSeconds: $JNLP_LIVENESS_PER
  40. readinessProbe:
  41. tcpSocket:
  42. port: $JNLP_CONTAINER_PORT
  43. initialDelaySeconds: $JNLP_READINESS_INIT
  44. periodSeconds: $JNLP_READINESS_PER
  45. volumeClaimTemplates:
  46. - metadata:
  47. name: volume
  48. spec:
  49. accessModes: ["ReadWriteOnce"]
  50. storageClassName: rbd
  51. resources:
  52. requests:
  53. storage: $JNLP_STORAGE_CAPACITY
  54. -------------
  55. apiVersion: v1
  56. kind: Service
  57. metadata:
  58. name: $DRONE_REPO_NAME-svc
  59. namespace: $JNLP_ENV
  60. labels:
  61. app: $DRONE_REPO_NAME-svc
  62. spec:
  63. type: NodePort
  64. ports:
  65. - port: $JNLP_CONTAINER_PORT
  66. targetPort: $JNLP_CONTAINER_PORT
  67. selector:
  68. app: $DRONE_REPO_NAME
  69. -------------
  70. apiVersion: networking.k8s.io/v1
  71. kind: Ingress
  72. metadata:
  73. name: $DRONE_REPO_NAME-ingress
  74. namespace: $JNLP_ENV
  75. spec:
  76. ingressClassName: nginx
  77. rules:
  78. - host: $JNLP_ENV-$DRONE_REPO_NAME$JNLP_DOMAIN
  79. http:
  80. paths:
  81. - path: /
  82. pathType: ImplementationSpecific
  83. backend:
  84. service:
  85. name: $DRONE_REPO_NAME-svc
  86. port:
  87. number: $JNLP_CONTAINER_PORT
  88. - host: svadv.easou.com
  89. http:
  90. paths:
  91. - path: /
  92. pathType: ImplementationSpecific
  93. backend:
  94. service:
  95. name: $DRONE_REPO_NAME-svc
  96. port:
  97. number: $JNLP_CONTAINER_PORT