deploy-tmp.yaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. dnsPolicy: ClusterFirstWithHostNet
  22. dnsConfig:
  23. nameservers:
  24. - 223.5.5.5
  25. - 223.6.6.6
  26. initContainers:
  27. - name: init
  28. image: $JNLP_REPO/dev/busybox
  29. command: ["chmod","777","-R","$JNLP_MOUNT_PATH"]
  30. imagePullPolicy: Always
  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. env:
  39. - name: JAVA_OPTS
  40. value: $JNLP_JAVA_OPTS -Dspring.profiles.active=$JNLP_ACTIVE_PROFILE
  41. ports:
  42. - containerPort: $JNLP_CONTAINER_PORT
  43. name: port
  44. volumeMounts:
  45. - name: volume
  46. mountPath: $JNLP_MOUNT_PATH
  47. livenessProbe:
  48. tcpSocket:
  49. port: $JNLP_CONTAINER_PORT
  50. initialDelaySeconds: $JNLP_LIVENESS_INIT
  51. periodSeconds: $JNLP_LIVENESS_PER
  52. readinessProbe:
  53. tcpSocket:
  54. port: $JNLP_CONTAINER_PORT
  55. initialDelaySeconds: $JNLP_READINESS_INIT
  56. periodSeconds: $JNLP_READINESS_PER
  57. volumeClaimTemplates:
  58. - metadata:
  59. name: volume
  60. spec:
  61. accessModes: ["ReadWriteOnce"]
  62. storageClassName: $JNLP_STORAGE_CLASS #ceph-block
  63. resources:
  64. requests:
  65. storage: $JNLP_STORAGE_CAPACITY
  66. ---
  67. apiVersion: v1
  68. kind: Service
  69. metadata:
  70. name: $DRONE_REPO_NAME-svc
  71. namespace: $JNLP_ENV
  72. labels:
  73. app: $DRONE_REPO_NAME-svc
  74. spec:
  75. type: NodePort
  76. ports:
  77. - port: $JNLP_CONTAINER_PORT
  78. targetPort: $JNLP_CONTAINER_PORT
  79. selector:
  80. app: $DRONE_REPO_NAME
  81. ---
  82. apiVersion: networking.k8s.io/v1
  83. kind: Ingress
  84. metadata:
  85. name: $DRONE_REPO_NAME-ingress
  86. namespace: $JNLP_ENV
  87. spec:
  88. rules:
  89. - host: $JNLP_ENV-$DRONE_REPO_NAME$JNLP_DOMAIN
  90. http:
  91. paths:
  92. - path: /
  93. pathType: Prefix
  94. backend:
  95. service:
  96. name: $DRONE_REPO_NAME-svc
  97. port:
  98. number: $JNLP_CONTAINER_PORT
  99. ingressClassName: nginx