一、kubernetes服务账号的删除

### 创建service account并绑定默认cluster-admin管理员集群角色
## 创建用户
kubectl create serviceaccount dashboard-admin -n kube-system
### 查看用户
kubectl get serviceaccounts
kubectl get serviceaccounts -n rook  ### 查看指定命名空间
### 删除默认命名空间账号:default
kubectl delete serviceaccount rook-ceph-system
kubectl delete serviceaccount rook-ceph-system -n rook   ## 删除指定命名空间账号


二、kubernetes 删除 service

### 查看
kubectl get services
### 删除
kubectl delete service nginx-service

三、kubernetes 删除 pods

### 查看rs和deployment以及pod
kubectl get pods
kubectl get rs
kubectl get deployment
### 删除deployment
kubectl delete deployment nginx

先删除pod,再删除对应的deployment
否则只是删除pod是不管用的,还会看到pod,因为deployment.yaml文件中定义了副本数量
kubectl delete pod jenkins2-8698b5449c-grbdm -n jenkins
kubectl delete deployment jenkins2 -n jenkins
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐