deploy-tmp.yaml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. imagePullPolicy: Always
  26. volumeMounts:
  27. - name: volume
  28. mountPath: $JNLP_MOUNT_PATH
  29. nodeSelector:
  30. app.touchrs: touchrs
  31. containers:
  32. - name: $DRONE_REPO_NAME
  33. image: $JNLP_REPO/$JNLP_ENV/$DRONE_REPO_NAME:$JNLP_TAG
  34. imagePullPolicy: Always
  35. ports:
  36. - containerPort: $JNLP_CONTAINER_PORT
  37. name: port
  38. volumeMounts:
  39. - name: volume
  40. mountPath: $JNLP_MOUNT_PATH
  41. livenessProbe:
  42. tcpSocket:
  43. port: $JNLP_CONTAINER_PORT
  44. initialDelaySeconds: $JNLP_LIVENESS_INIT
  45. periodSeconds: $JNLP_LIVENESS_PER
  46. readinessProbe:
  47. tcpSocket:
  48. port: $JNLP_CONTAINER_PORT
  49. initialDelaySeconds: $JNLP_READINESS_INIT
  50. periodSeconds: $JNLP_READINESS_PER
  51. volumeClaimTemplates:
  52. - metadata:
  53. name: volume
  54. spec:
  55. accessModes: ["ReadWriteOnce"]
  56. storageClassName: rbd
  57. resources:
  58. requests:
  59. storage: $JNLP_STORAGE_CAPACITY
  60. ---
  61. apiVersion: v1
  62. kind: Service
  63. metadata:
  64. name: $DRONE_REPO_NAME-svc
  65. namespace: $JNLP_ENV
  66. labels:
  67. app: $DRONE_REPO_NAME-svc
  68. spec:
  69. type: NodePort
  70. ports:
  71. - port: $JNLP_CONTAINER_PORT
  72. targetPort: $JNLP_CONTAINER_PORT
  73. selector:
  74. app: $DRONE_REPO_NAME
  75. ---
  76. apiVersion: extensions/v1beta1
  77. kind: Ingress
  78. metadata:
  79. name: $DRONE_REPO_NAME-ingress
  80. namespace: $JNLP_ENV
  81. annotations:
  82. kubernetes.io/ingress.class: $JNLP_INGRESS
  83. spec:
  84. rules:
  85. - host: $JNLP_ENV-$DRONE_REPO_NAME$JNLP_DOMAIN
  86. http:
  87. paths:
  88. - path: /
  89. backend:
  90. serviceName: $DRONE_REPO_NAME-svc
  91. servicePort: $JNLP_CONTAINER_PORT