deploy-tmp.yaml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. containers:
  30. - name: $DRONE_REPO_NAME
  31. image: $JNLP_REPO/datagroup-pro/$DRONE_REPO_NAME:$JNLP_TAG
  32. imagePullPolicy: Always
  33. env:
  34. - name: JAVA_OPTS
  35. value: $JNLP_JAVA_OPTS -Dspring.profiles.active=$JNLP_ACTIVE_PROFILE -Dserver.port=$JNLP_CONTAINER_PORT
  36. ports:
  37. - containerPort: $JNLP_CONTAINER_PORT
  38. name: port
  39. volumeMounts:
  40. - name: volume
  41. mountPath: $JNLP_MOUNT_PATH
  42. lifecycle:
  43. preStop:
  44. exec:
  45. command: ["/bin/sh","-c","curl -H 'loginName:admin' -H 'password:ea1so2ua3dm4in5' -X POST 127.0.0.1:80/actuator/shutdown"]
  46. livenessProbe:
  47. tcpSocket:
  48. port: $JNLP_CONTAINER_PORT
  49. initialDelaySeconds: $JNLP_LIVENESS_INIT
  50. periodSeconds: $JNLP_LIVENESS_PER
  51. readinessProbe:
  52. tcpSocket:
  53. port: $JNLP_CONTAINER_PORT
  54. initialDelaySeconds: $JNLP_READINESS_INIT
  55. periodSeconds: $JNLP_READINESS_PER
  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: networking.k8s.io/v1
  82. kind: Ingress
  83. metadata:
  84. name: $DRONE_REPO_NAME-ingress
  85. namespace: $JNLP_ENV
  86. spec:
  87. rules:
  88. - host: $JNLP_ENV-$DRONE_REPO_NAME$JNLP_DOMAIN
  89. http:
  90. paths:
  91. - path: /
  92. pathType: Prefix
  93. backend:
  94. service:
  95. name: $DRONE_REPO_NAME-svc
  96. port:
  97. number: $JNLP_CONTAINER_PORT
  98. - host: mccallback.easou.com
  99. http:
  100. paths:
  101. - path: /
  102. pathType: Prefix
  103. backend:
  104. service:
  105. name: $DRONE_REPO_NAME-svc
  106. port:
  107. number: $JNLP_CONTAINER_PORT
  108. ingressClassName: nginx