deploy-tmp.yaml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. ---
  2. apiVersion: apps.kruise.io/v1beta1
  3. #apiVersion: apps/v1
  4. kind: $JNLP_CONTROL
  5. metadata:
  6. name: $DRONE_REPO_NAME
  7. namespace: $JNLP_ENV
  8. labels:
  9. app: $DRONE_REPO_NAME
  10. spec:
  11. serviceName: $DRONE_REPO_NAME
  12. replicas: $JNLP_REPLICAS
  13. selector:
  14. matchLabels:
  15. app: $DRONE_REPO_NAME
  16. template:
  17. metadata:
  18. labels:
  19. app: $DRONE_REPO_NAME
  20. spec:
  21. terminationGracePeriodSeconds: 180
  22. initContainers:
  23. - name: init
  24. image: $JNLP_REPO/dev/busybox
  25. command: ["chmod","777","-R","$JNLP_MOUNT_PATH"]
  26. imagePullPolicy: Always
  27. volumeMounts:
  28. - name: volume
  29. mountPath: $JNLP_MOUNT_PATH
  30. containers:
  31. - name: $DRONE_REPO_NAME
  32. image: $JNLP_REPO/$JNLP_ENV/$DRONE_REPO_NAME:$JNLP_TAG
  33. imagePullPolicy: Always
  34. ports:
  35. - containerPort: $JNLP_CONTAINER_PORT
  36. name: port
  37. volumeMounts:
  38. - name: volume
  39. mountPath: $JNLP_MOUNT_PATH
  40. livenessProbe:
  41. tcpSocket:
  42. port: $JNLP_CONTAINER_PORT
  43. initialDelaySeconds: $JNLP_LIVENESS_INIT
  44. periodSeconds: $JNLP_LIVENESS_PER
  45. readinessProbe:
  46. tcpSocket:
  47. port: $JNLP_CONTAINER_PORT
  48. initialDelaySeconds: $JNLP_READINESS_INIT
  49. periodSeconds: $JNLP_READINESS_PER
  50. updateStrategy:
  51. type: RollingUpdate
  52. rollingUpdate:
  53. podUpdatePolicy: InPlaceIfPossible
  54. inPlaceUpdateStrategy:
  55. gracePeriodSeconds: 10
  56. volumeClaimTemplates:
  57. - metadata:
  58. name: volume
  59. spec:
  60. accessModes: ["ReadWriteOnce"]
  61. storageClassName: rbd
  62. resources:
  63. requests:
  64. storage: $JNLP_STORAGE_CAPACITY
  65. ---
  66. apiVersion: v1
  67. kind: Service
  68. metadata:
  69. name: $DRONE_REPO_NAME-svc
  70. namespace: $JNLP_ENV
  71. labels:
  72. app: $DRONE_REPO_NAME-svc
  73. spec:
  74. type: NodePort
  75. ports:
  76. - port: $JNLP_CONTAINER_PORT
  77. targetPort: $JNLP_CONTAINER_PORT
  78. selector:
  79. app: $DRONE_REPO_NAME
  80. ---
  81. apiVersion: extensions/v1beta1
  82. kind: Ingress
  83. metadata:
  84. name: $DRONE_REPO_NAME-ingress
  85. namespace: $JNLP_ENV
  86. annotations:
  87. kubernetes.io/ingress.class: $JNLP_INGRESS
  88. spec:
  89. rules:
  90. - host: $JNLP_ENV-$DRONE_REPO_NAME$JNLP_DOMAIN
  91. http:
  92. paths:
  93. - path: /
  94. backend:
  95. serviceName: $DRONE_REPO_NAME-svc
  96. servicePort: $JNLP_CONTAINER_PORT