first commit

This commit is contained in:
iProbe 2022-10-18 16:59:37 +08:00
commit ba848e218d
1001 changed files with 152333 additions and 0 deletions

View file

@ -0,0 +1,56 @@
#### preStoppod停止前操作优雅停止服务
```
apiVersion: v1
kind: Pod
metadata:
name: PreStop-demo-v1
namespace: demo-ns
labels:
app: prestop
version: v1
spec:
containers:
- name: prestop-demo
image: busybox
ports:
- name: pre-port
containerPort: 80
protocol: TCP
lifecycle:
preStop:
exec: ## httpGet 或 tcpSocket
command:
- '/bin/sh'
- '-c'
- 'echo stop'
```
#### postStart,pod启动前操作
```
apiVersion: v1
kind: Pod
metadata:
name: PostStart-demo-v1
namespace: demo-ns
labels:
app: poststart
version: v1
spec:
containers:
- name: poststart-demo
image: busybox
ports:
- name: post-port
containerPort: 80
protocol: TCP
lifecycle:
postStart:
tcpSocket:
port: 80
```