deploy-tmp-v2.yaml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. ---
  2. apiVersion: apps/v1
  3. kind: $JNLP_CONTROL
  4. metadata:
  5. name: $DRONE_REPO_NAME-v2
  6. namespace: $JNLP_ENV
  7. labels:
  8. app: $DRONE_REPO_NAME
  9. spec:
  10. serviceName: $DRONE_REPO_NAME-v2
  11. replicas: $JNLP_REPLICAS
  12. selector:
  13. matchLabels:
  14. app: $DRONE_REPO_NAME-v2
  15. template:
  16. metadata:
  17. labels:
  18. app: $DRONE_REPO_NAME-v2
  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. containers:
  30. - name: $DRONE_REPO_NAME-v2
  31. image: $JNLP_REPO/$JNLP_ENV/$DRONE_REPO_NAME:$JNLP_TAG
  32. imagePullPolicy: Always
  33. ports:
  34. - containerPort: $JNLP_CONTAINER_PORT
  35. name: port
  36. volumeMounts:
  37. - name: volume
  38. mountPath: $JNLP_MOUNT_PATH
  39. livenessProbe:
  40. tcpSocket:
  41. port: $JNLP_CONTAINER_PORT
  42. initialDelaySeconds: $JNLP_LIVENESS_INIT
  43. periodSeconds: $JNLP_LIVENESS_PER
  44. readinessProbe:
  45. tcpSocket:
  46. port: $JNLP_CONTAINER_PORT
  47. initialDelaySeconds: $JNLP_READINESS_INIT
  48. periodSeconds: $JNLP_READINESS_PER
  49. volumeClaimTemplates:
  50. - metadata:
  51. name: volume
  52. spec:
  53. accessModes: ["ReadWriteOnce"]
  54. storageClassName: rbd
  55. resources:
  56. requests:
  57. storage: $JNLP_STORAGE_CAPACITY
  58. ---
  59. apiVersion: v1
  60. kind: Service
  61. metadata:
  62. name: $DRONE_REPO_NAME-v2-svc
  63. namespace: $JNLP_ENV
  64. labels:
  65. app: $DRONE_REPO_NAME-v2-svc
  66. spec:
  67. type: NodePort
  68. ports:
  69. - port: $JNLP_CONTAINER_PORT
  70. targetPort: $JNLP_CONTAINER_PORT
  71. selector:
  72. app: $DRONE_REPO_NAME-v2
  73. ---
  74. apiVersion: extensions/v1beta1
  75. kind: Ingress
  76. metadata:
  77. name: $DRONE_REPO_NAME-v2-ingress
  78. namespace: $JNLP_ENV
  79. annotations:
  80. kubernetes.io/ingress.class: $JNLP_INGRESS
  81. nginx.ingress.kubernetes.io/canary: "true"
  82. nginx.ingress.kubernetes.io/canary-weight: "10"
  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-v2-svc
  91. servicePort: $JNLP_CONTAINER_PORT