deploy-tmp.yaml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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: None
  22. dnsConfig:
  23. nameservers:
  24. - 10.26.22.50
  25. - 223.6.6.6
  26. containers:
  27. - name: $DRONE_REPO_NAME
  28. image: $JNLP_REPO/$JNLP_ENV/$DRONE_REPO_NAME:$JNLP_TAG
  29. imagePullPolicy: Always
  30. env:
  31. - name: JAVA_OPTS
  32. value: $JNLP_JAVA_OPTS -Dserver.port=$JNLP_CONTAINER_PORT -Dspring.profiles.active=$JNLP_ACTIVE_PROFILE
  33. ports:
  34. - containerPort: $JNLP_CONTAINER_PORT
  35. name: port
  36. lifecycle:
  37. preStop:
  38. exec:
  39. command: ["/bin/sh","-c","curl -H 'loginName:admin' -H 'password:ea1so2ua3dm4in5' -X POST 127.0.0.1:8080/actuator/shutdown"]
  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. ---
  51. apiVersion: v1
  52. kind: Service
  53. metadata:
  54. name: $DRONE_REPO_NAME-svc
  55. namespace: $JNLP_ENV
  56. labels:
  57. app: $DRONE_REPO_NAME-svc
  58. spec:
  59. type: NodePort
  60. ports:
  61. - port: $JNLP_CONTAINER_PORT
  62. targetPort: $JNLP_CONTAINER_PORT
  63. selector:
  64. app: $DRONE_REPO_NAME
  65. ---
  66. apiVersion: networking.k8s.io/v1
  67. kind: Ingress
  68. metadata:
  69. name: $DRONE_REPO_NAME-ingress
  70. namespace: $JNLP_ENV
  71. spec:
  72. rules:
  73. - host: $JNLP_ENV-$DRONE_REPO_NAME$JNLP_DOMAIN
  74. http:
  75. paths:
  76. - path: /
  77. pathType: Prefix
  78. backend:
  79. service:
  80. name: $DRONE_REPO_NAME-svc
  81. port:
  82. number: $JNLP_CONTAINER_PORT
  83. ingressClassName: nginx