网站首页 文章专栏 k8s常用命令
k8s常用命令
编辑时间:2022-03-03 17:03:47 作者:admin 浏览量:313

1、清除资源实例

1.1   kubectl delete daemonset -n cmk-namespace cmk-reconcile-nodereport-ds-node1 # 清除nodereport

1.2   kubectl delete deployment -n cmk-namespace cmk-webhook-deployment # 清除webhook

1.3   kubectl delete service -n cmk-namespace  cmk-webhook-service #删除webhook service

1.4   kubectl delete secret -n cmk-namespace cmk-webhook-certs #删除webhook 证书

1.5   kubectl delete cm -n cmk-namespace cmk-webhook-configmap #删除webhook configmap

1.6   kubectl delete pod -n cmk-namespace cmk-init-discover-install-pod-node1#删除init pod

1.7   kubectl delete cm -n cmk-namespace   cmk-config-node1 #删除节点configmap

1.8   kubectl delete pod -n cmk-namespace cmk-cluster-init-pod #删除init pod

1.9   kubectl get MutatingWebhookConfiguration -A -o wide # 查询MutatingWebhookConfiguration

1.10 kubectl delete MutatingWebhookConfiguration cmk-webhook-config # 删除 MutatingWebhookConfiguration

1.11 kubectl delete crd cmk-reconcilereports.intel.com #删除crd

1.12 kubectl delete crd cmk-nodereports.intel.com #删除crd


1.13 kubectl delete serviceaccount -n cmk-namespace cmk-serviceaccount #删除账户

1.14 kubectl delete ns cmk-namespace # 删除命令空间


1.15 kubectl get pods -A -o wide |grep cmk #查询 cmk pod

1.16 kubectl get no -o json | jq .items[].metadata.labels


2、强制删除

2.1  kubectl delete pod pod-name -n namespace --force --grace-period=0 #强制删除pod




来说两句吧
最新评论