deploy-tmp.yaml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. env:
  34. - name: JAVA_OPTS
  35. value: $JNLP_JAVA_OPTS -Dspring.profiles.active=$JNLP_ACTIVE_PROFILE
  36. ports:
  37. - containerPort: $JNLP_CONTAINER_PORT
  38. name: port
  39. volumeMounts:
  40. - name: volume
  41. mountPath: $JNLP_MOUNT_PATH
  42. livenessProbe:
  43. tcpSocket:
  44. port: $JNLP_CONTAINER_PORT
  45. initialDelaySeconds: $JNLP_LIVENESS_INIT
  46. periodSeconds: $JNLP_LIVENESS_PER
  47. readinessProbe:
  48. tcpSocket:
  49. port: $JNLP_CONTAINER_PORT
  50. initialDelaySeconds: $JNLP_READINESS_INIT
  51. periodSeconds: $JNLP_READINESS_PER
  52. volumeClaimTemplates:
  53. - metadata:
  54. name: volume
  55. spec:
  56. accessModes: ["ReadWriteOnce"]
  57. storageClassName: rbd
  58. resources:
  59. requests:
  60. storage: $JNLP_STORAGE_CAPACITY
  61. ---
  62. apiVersion: v1
  63. kind: Service
  64. metadata:
  65. name: $DRONE_REPO_NAME-svc
  66. namespace: $JNLP_ENV
  67. labels:
  68. app: $DRONE_REPO_NAME-svc
  69. spec:
  70. type: NodePort
  71. ports:
  72. - port: $JNLP_CONTAINER_PORT
  73. targetPort: $JNLP_CONTAINER_PORT
  74. selector:
  75. app: $DRONE_REPO_NAME
  76. ---
  77. apiVersion: extensions/v1beta1
  78. kind: Ingress
  79. metadata:
  80. name: $DRONE_REPO_NAME-ingress
  81. namespace: $JNLP_ENV
  82. annotations:
  83. kubernetes.io/ingress.class: $JNLP_INGRESS
  84. spec:
  85. rules:
  86. - host: $JNLP_ENV-$DRONE_REPO_NAME$JNLP_DOMAIN
  87. http:
  88. paths:
  89. - path: /
  90. backend:
  91. serviceName: $DRONE_REPO_NAME-svc
  92. servicePort: $JNLP_CONTAINER_PORT