deploy-tmp.yaml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. 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. volumeMounts:
  36. - name: volume
  37. mountPath: $JNLP_MOUNT_PATH
  38. livenessProbe:
  39. tcpSocket:
  40. port: $JNLP_CONTAINER_PORT
  41. initialDelaySeconds: $JNLP_LIVENESS_INIT
  42. periodSeconds: $JNLP_LIVENESS_PER
  43. readinessProbe:
  44. tcpSocket:
  45. port: $JNLP_CONTAINER_PORT
  46. initialDelaySeconds: $JNLP_READINESS_INIT
  47. periodSeconds: $JNLP_READINESS_PER
  48. volumeClaimTemplates:
  49. - metadata:
  50. name: volume
  51. spec:
  52. accessModes: ["ReadWriteOnce"]
  53. storageClassName: rbd
  54. resources:
  55. requests:
  56. storage: $JNLP_STORAGE_CAPACITY
  57. ---
  58. apiVersion: v1
  59. kind: Service
  60. metadata:
  61. name: $DRONE_REPO_NAME-svc
  62. namespace: $JNLP_ENV
  63. labels:
  64. app: $DRONE_REPO_NAME-svc
  65. spec:
  66. type: NodePort
  67. ports:
  68. - port: $JNLP_CONTAINER_PORT
  69. targetPort: $JNLP_CONTAINER_PORT
  70. selector:
  71. app: $DRONE_REPO_NAME