--- apiVersion: apps/v1 kind: StatefulSet metadata: name: offline-process-charge-callback namespace: qa labels: app: offline-process-charge-callback spec: serviceName: offline-process-charge-callback replicas: 1 selector: matchLabels: app: offline-process-charge-callback template: metadata: labels: app: offline-process-charge-callback spec: terminationGracePeriodSeconds: 60 initContainers: - name: init image: hub.evbj.easou.com/dev/busybox command: [ "chmod","777","-R","/data" ] imagePullPolicy: Always volumeMounts: - name: volume mountPath: /data #nodeSelector: # app.touchrs: touchrs containers: - name: offline-process-charge-callback image: hub.evbj.easou.com/qa/offline-process-charge-callback:v1.0.26 imagePullPolicy: Always env: - name: JAVA_OPTS value: "-server -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8001,suspend=n -Xmx2g -Xms2g -Xss512k -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=test" ports: - containerPort: 8080 name: port - containerPort: 8001 name: "jvm-debug" volumeMounts: - name: volume mountPath: /data lifecycle: preStop: exec: command: ["/bin/sh","-c","curl -u amdin:ea1so2ua3dm4in5 -X POST 127.0.0.1:8080/actuator/shutdown"] livenessProbe: httpGet: path: /actuator/health port: 8080 httpHeaders: - name: Custom-Header value: Awesome - name: Custom-Header value: Awesome initialDelaySeconds: 30 #60s后启动第一次探测 periodSeconds: 10 # 每隔10s启动一次探测 timeoutSeconds: 3 # 超时时间3s successThreshold: 1 # 成功1次即表示容器健康 failureThreshold: 5 # 连续5次失败,则判定容器不健康,默认3次 readinessProbe: tcpSocket: port: 8080 initialDelaySeconds: 30 periodSeconds: 15 volumeClaimTemplates: - metadata: name: volume spec: accessModes: [ "ReadWriteOnce" ] storageClassName: rbd resources: requests: storage: 100Gi --- apiVersion: v1 kind: Service metadata: name: offline-process-charge-callback-svc namespace: qa labels: app: offline-process-charge-callback-svc spec: type: NodePort ports: - port: 80 targetPort: 8080 name: "main" selector: app: offline-process-charge-callback --- apiVersion: extensions/v1beta1 kind: Ingress metadata: name: offline-process-charge-callback-ingress namespace: qa annotations: kubernetes.io/ingress.class: nginx spec: rules: - host: qa-offline-process-charge-callback.ieasou.cn http: paths: - path: / backend: serviceName: offline-process-charge-callback-svc servicePort: 80