deployment.yaml11 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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: hub.evbj.easou.com/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: $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: rbd
  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