deploy-tmp.yaml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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: misport
  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. - name: mis
  59. port: $JNLP_CONTAINER_PORT
  60. targetPort: $JNLP_CONTAINER_PORT
  61. selector:
  62. app: $DRONE_REPO_NAME
  63. ---
  64. apiVersion: extensions/v1beta1
  65. kind: Ingress
  66. metadata:
  67. name: $DRONE_REPO_NAME-ingress
  68. namespace: $JNLP_ENV
  69. annotations:
  70. kubernetes.io/ingress.class: $JNLP_INGRESS
  71. spec:
  72. rules:
  73. - host: $JNLP_ENV-$DRONE_REPO_NAME$JNLP_DOMAIN
  74. http:
  75. paths:
  76. - path: /
  77. backend:
  78. serviceName: $DRONE_REPO_NAME-svc
  79. servicePort: $JNLP_CONTAINER_PORT