Kubernetes版本是: 1.27.2
安装方式: kubeadm
主机OS: Ubuntu 20.04.4 LTS
CNI和版本: calico v3.26.0
CRI和版本: containerd v1.6.2
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: stacksimplify/kube-nginxapp1:1.0.0
ports:
- containerPort: 80
部署后输出:
NAME READY STATUS RESTARTS AGE
pod/nginx-deployment-7d94b5f487-7q2hd 1/1 Running 0 8s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/nginx-deployment 1/1 1 1 8s
NAME DESIRED CURRENT READY AGE
replicaset.apps/nginx-deployment-7d94b5f487 1 1 1 8s
之后我运行:kubectl delete deploy nginx-deployment
NAME READY STATUS RESTARTS AGE
pod/nginx-deployment-7d94b5f487-7q2hd 1/1 Running 0 5m22s
NAME DESIRED CURRENT READY AGE
replicaset.apps/nginx-deployment-7d94b5f487 1 1 1 5m23s
即使我运行:kubectl delete deploy nginx-deployment --cascade=background
, replicasets 和 pods 也不会被删除。
我该怎么做呢?
谢谢!
Calico的问题。
从 v3.26.0 升级到 v3.26.1 解决了这个问题。
你的答案