deploy-tmp.yaml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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: 8080
  34. name: cifport
  35. - containerPort: 9090
  36. name: cdpport
  37. volumeMounts:
  38. - name: volume
  39. mountPath: $JNLP_MOUNT_PATH
  40. volumeClaimTemplates:
  41. - metadata:
  42. name: volume
  43. spec:
  44. accessModes: ["ReadWriteOnce"]
  45. storageClassName: rbd
  46. resources:
  47. requests:
  48. storage: $JNLP_STORAGE_CAPACITY
  49. ---
  50. apiVersion: v1
  51. kind: Service
  52. metadata:
  53. name: $DRONE_REPO_NAME-svc
  54. namespace: $JNLP_ENV
  55. labels:
  56. app: $DRONE_REPO_NAME-svc
  57. spec:
  58. type: NodePort
  59. ports:
  60. - name: cif
  61. port: 8080
  62. targetPort: 8080
  63. - name: cdp
  64. port: 9090
  65. targetPort: 9090
  66. selector:
  67. app: $DRONE_REPO_NAME