k8s pod管理
# 1. yaml文件创建Pod对象:
cat pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
# 2. 基本管理:
创建pod资源
kubectl create -f pod.yaml
1
查看pods
kubectl get pods nginx-pod
1
查看pod描述
kubectl describe pod nginx-pod
1
更新资源
kubectl apply -f pod.yaml
1
删除资源
kubectl delete pod nginx-pod
kubectl delete -f nginx-deployment.yaml
kubectl delete -f pod.yaml
1
2
3
2
3
上次更新: 2022/10/05, 15:51:58