deployment.yaml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. ---
  2. apiVersion: apps/v1
  3. kind: $JNLP_CONTROL
  4. metadata:
  5. name: $JNLP_CONTROL_NAME
  6. namespace: $JNLP_ENV
  7. labels:
  8. app: $JNLP_CONTROL_NAME
  9. spec:
  10. serviceName: $JNLP_CONTROL_NAME
  11. replicas: $JNLP_REPLICAS
  12. selector:
  13. matchLabels:
  14. app: $JNLP_CONTROL_NAME
  15. template:
  16. metadata:
  17. labels:
  18. app: $JNLP_CONTROL_NAME
  19. spec:
  20. terminationGracePeriodSeconds: 180
  21. initContainers:
  22. - name: init
  23. image: 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: $JNLP_IMAGE
  31. image: $JNLP_HUB/$JNLP_ENV/$JNLP_IMAGE:$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: ceph
  55. resources:
  56. requests:
  57. storage: $JNLP_STORAGE_CAPACITY
  58. ---
  59. apiVersion: v1
  60. kind: Service
  61. metadata:
  62. name: $JNLP_CONTROL_NAME-svc
  63. namespace: $JNLP_ENV
  64. labels:
  65. app: $JNLP_CONTROL_NAME-svc
  66. spec:
  67. type: NodePort
  68. ports:
  69. - port: $JNLP_CONTAINER_PORT
  70. targetPort: $JNLP_CONTAINER_PORT
  71. selector:
  72. app: $JNLP_CONTROL_NAME
  73. ---
  74. apiVersion: extensions/v1beta1
  75. kind: Ingress
  76. metadata:
  77. name: $JNLP_CONTROL_NAME-ing
  78. namespace: $JNLP_ENV
  79. annotations:
  80. kubernetes.io/ingress.class: $JNLP_INGRESS
  81. spec:
  82. rules:
  83. hosts:
  84. - $JNLP_ENV-$JNLP_CONTROL_NAME$JNLP_DOMAIN
  85. - test-$JNLP_ENV-$JNLP_CONTROL_NAME$JNLP_DOMAIN
  86. http:
  87. paths:
  88. - path: /
  89. backend:
  90. serviceName: $JNLP_CONTROL_NAME-svc
  91. servicePort: $JNLP_CONTAINER_PORT