deploy.yaml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. ---
  2. #apiVersion: apps.kruise.io/v1beta1
  3. apiVersion: apps/v1
  4. kind: StatefulSet
  5. metadata:
  6. name: apptj
  7. namespace: bi
  8. labels:
  9. app: apptj
  10. spec:
  11. serviceName: apptj
  12. replicas: 2
  13. selector:
  14. matchLabels:
  15. app: apptj
  16. template:
  17. metadata:
  18. labels:
  19. app: apptj
  20. spec:
  21. terminationGracePeriodSeconds: 30
  22. dnsPolicy: "None"
  23. dnsConfig:
  24. nameservers:
  25. - 223.5.5.5
  26. - 10.108.30.101
  27. searches:
  28. - pro.svc.cluster.local
  29. - svc.cluster.local
  30. - cluster.local
  31. options:
  32. - name: ndots
  33. value: "5"
  34. initContainers:
  35. - name: init
  36. image: hub.evbj.easou.com/dev/busybox
  37. command: ['sh', "-c", 'chmod 777 -R /data/ && mkdir -p /data/webapps']
  38. imagePullPolicy: IfNotPresent
  39. volumeMounts:
  40. - name: volume
  41. mountPath: /data
  42. - name: init-package
  43. image: hub.evbj.easou.com/dev/busybox
  44. command: ['sh', '-c', 'rm -rf /data/webapps/* && wget http://10.40.20.61/release/search-wapage/prod-64/easou-bi/1.0.13/easou-bi_1.0.13_dataMigration_T1.0.12-5783_1.0.13_20241107-105647_RBL/ROOT.war -O /data/webapps/ROOT.war && md5sum /data/webapps/ROOT.war']
  45. imagePullPolicy: IfNotPresent
  46. volumeMounts:
  47. - name: volume
  48. mountPath: /data
  49. containers:
  50. - name: apptj
  51. image: hub.evbj.easou.com/bi/apptj:v1base
  52. imagePullPolicy: Always
  53. ports:
  54. - containerPort: 8080
  55. name: port
  56. lifecycle:
  57. preStop:
  58. exec:
  59. command: ["/bin/sh","-c","supervisorctl stop all"]
  60. volumeMounts:
  61. - name: volume
  62. mountPath: /data
  63. livenessProbe:
  64. tcpSocket:
  65. port: 8080
  66. initialDelaySeconds: 60
  67. periodSeconds: 15
  68. readinessProbe:
  69. tcpSocket:
  70. port: 8080
  71. initialDelaySeconds: 60
  72. periodSeconds: 15
  73. volumeClaimTemplates:
  74. - metadata:
  75. name: volume
  76. spec:
  77. accessModes: ["ReadWriteOnce"]
  78. storageClassName: rbd
  79. resources:
  80. requests:
  81. storage: 200Gi
  82. ---
  83. apiVersion: v1
  84. kind: Service
  85. metadata:
  86. name: apptj-svc
  87. namespace: bi
  88. labels:
  89. app: apptj-svc
  90. spec:
  91. type: NodePort
  92. ports:
  93. - port: 8080
  94. targetPort: 8080
  95. nodePort: 30010
  96. selector:
  97. app: apptj
  98. ---
  99. apiVersion: networking.k8s.io/v1
  100. kind: Ingress
  101. metadata:
  102. name: apptj-ingress
  103. namespace: bi
  104. spec:
  105. rules:
  106. - host: bi-apptj.ieasou.cn
  107. http:
  108. paths:
  109. - path: /
  110. pathType: Prefix
  111. backend:
  112. service:
  113. name: apptj-svc
  114. port:
  115. number: 8080
  116. ingressClassName: nginx