deploy-tmp.yaml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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