apiVersion: apps/v1 kind: Deployment metadata: name: {{ deployment_name }} namespace: {{ namespace }} spec: replicas: {{ replicas }} selector: matchLabels: app: {{ deployment_name }} template: metadata: labels: app: {{ deployment_name }} spec: containers: - name: {{ deployment_name }} env: - name: SERVICE_NAME value: {{ deployment_name }} - name: POD_IP valueFrom: fieldRef: apiVersion: v1 fieldPath: status.podIP image: {{ image }} imagePullPolicy: IfNotPresent lifecycle: preStop: exec: command: - /bin/sh - /config/pre-Stop.sh resources: limits: cpu: {{ limits_cpu }} memory: {{ limits_memory }} requests: cpu: {{ requests_cpu }} memory: {{ requests_memory }} ports: - containerPort: 8080 protocol: TCP livenessProbe: failureThreshold: 3 initialDelaySeconds: 30 periodSeconds: 10 successThreshold: 1 tcpSocket: port: 8080 timeoutSeconds: 1 volumeMounts: - mountPath: /etc/localtime name: localtime - mountPath: /config/logback-spring.xml name: backend subPath: logback-spring.xml - mountPath: /config/pre-Stop.sh name: backend subPath: pre-Stop.sh - mountPath: /config/run-env.sh name: backend subPath: run-env.sh imagePullSecrets: - name: {{ imageSecret }} volumes: - hostPath: path: /etc/localtime type: '' name: localtime - configMap: defaultMode: 420 name: backend name: backend