deploy-tmp.yaml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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/$JNLP_ENV/$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. livenessProbe:
  43. tcpSocket:
  44. port: $JNLP_CONTAINER_PORT
  45. initialDelaySeconds: $JNLP_LIVENESS_INIT
  46. periodSeconds: $JNLP_LIVENESS_PER
  47. readinessProbe:
  48. tcpSocket:
  49. port: $JNLP_CONTAINER_PORT
  50. initialDelaySeconds: $JNLP_READINESS_INIT
  51. periodSeconds: $JNLP_READINESS_PER
  52. volumeClaimTemplates:
  53. - metadata:
  54. name: volume
  55. spec:
  56. accessModes: ["ReadWriteOnce"]
  57. storageClassName: rbd
  58. resources:
  59. requests:
  60. storage: $JNLP_STORAGE_CAPACITY
  61. ---
  62. apiVersion: v1
  63. kind: Service
  64. metadata:
  65. name: $DRONE_REPO_NAME-svc
  66. namespace: $JNLP_ENV
  67. labels:
  68. app: $DRONE_REPO_NAME-svc
  69. spec:
  70. type: NodePort
  71. ports:
  72. - port: $JNLP_CONTAINER_PORT
  73. targetPort: $JNLP_CONTAINER_PORT
  74. selector:
  75. app: $DRONE_REPO_NAME
  76. ---
  77. apiVersion: networking.k8s.io/v1
  78. kind: Ingress
  79. metadata:
  80. name: $DRONE_REPO_NAME-ingress
  81. namespace: $JNLP_ENV
  82. spec:
  83. rules:
  84. - host: $JNLP_ENV-$DRONE_REPO_NAME$JNLP_DOMAIN
  85. http:
  86. paths:
  87. - path: /
  88. pathType: Prefix
  89. backend:
  90. service:
  91. name: $DRONE_REPO_NAME-svc
  92. port:
  93. number: $JNLP_CONTAINER_PORT
  94. - host: douyin-video-content-callback.novelsee.cn
  95. http:
  96. paths:
  97. - path: /
  98. pathType: Prefix
  99. backend:
  100. service:
  101. name: $DRONE_REPO_NAME-svc
  102. port:
  103. number: $JNLP_CONTAINER_PORT
  104. ingressClassName: nginx