deploy-tmp.yaml 1.6 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. - name: mkdir
  29. image: $JNLP_REPO/dev/busybox
  30. command: ["mkdir","-p","/data/ecom/asp/logs"]
  31. volumeMounts:
  32. - name: volume
  33. mountPath: $JNLP_MOUNT_PATH
  34. containers:
  35. - name: $DRONE_REPO_NAME
  36. image: $JNLP_REPO/$JNLP_ENV/$DRONE_REPO_NAME:$JNLP_TAG
  37. imagePullPolicy: Always
  38. ports:
  39. - containerPort: $JNLP_CONTAINER_PORT
  40. name: port
  41. volumeMounts:
  42. - name: volume
  43. mountPath: $JNLP_MOUNT_PATH
  44. volumeClaimTemplates:
  45. - metadata:
  46. name: volume
  47. spec:
  48. accessModes: ["ReadWriteOnce"]
  49. storageClassName: rbd
  50. resources:
  51. requests:
  52. storage: $JNLP_STORAGE_CAPACITY
  53. ---
  54. apiVersion: v1
  55. kind: Service
  56. metadata:
  57. name: $DRONE_REPO_NAME-svc
  58. namespace: $JNLP_ENV
  59. labels:
  60. app: $DRONE_REPO_NAME-svc
  61. spec:
  62. type: NodePort
  63. ports:
  64. - port: $JNLP_CONTAINER_PORT
  65. targetPort: $JNLP_CONTAINER_PORT
  66. selector:
  67. app: $DRONE_REPO_NAME