kubernetes之六: lifecycle preStop

apiVersion: batch/v1
kind: Job
metadata:
  name: lifecycle-summer
spec:
  parallelism: 1
  template:
    spec:
      restartPolicy: Never
      containers:
        - name: lifecycle-demo-container
          image: nginx
          lifecycle:
            preStop:
              httpGet:
                host: 192.168.4.170
                path: api/v2/devops/pkg/upload_hooks
                port: 8090
apiVersion: v1
kind: Pod
metadata:
  name: lifecycle-summer
spec:
  containers:
    - name: lifecycle-demo-container
      image: nginx
      volumeMounts:
        - mountPath: /app
          name: repo-path
      lifecycle:
        preStop:
          httpGet:
            host: 192.168.4.170
            path: api/v2/devops/pkg/upload_hooks
            port: 8090
  volumes:
    - emptyDir: {}
      name: repo-path

你可能感兴趣的:(kubernetes)