deploy-tmp.yaml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. volumeClaimTemplates:
  39. - metadata:
  40. name: volume
  41. spec:
  42. accessModes: ["ReadWriteOnce"]
  43. storageClassName: rbd
  44. resources:
  45. requests:
  46. storage: $JNLP_STORAGE_CAPACITY
  47. ---
  48. apiVersion: v1
  49. kind: Service
  50. metadata:
  51. name: $DRONE_REPO_NAME-svc
  52. namespace: $JNLP_ENV
  53. labels:
  54. app: $DRONE_REPO_NAME-svc
  55. spec:
  56. type: NodePort
  57. ports:
  58. - port: $JNLP_CONTAINER_PORT
  59. targetPort: $JNLP_CONTAINER_PORT
  60. selector:
  61. app: $DRONE_REPO_NAME