[英]Minikube flag not found
I have a problem with minikube when I want to create deployment manifest files, I receive an error when I write this code: minikube kubectl create -f.
我想创建部署清单文件时遇到 minikube 问题,编写此代码时收到错误:
minikube kubectl create -f.
I got this Error:我得到了这个错误:
Error: unknown shorthand flag: 'f' in -f See 'minikube kubectl --help' for usage.错误:未知速记标志:'f' in -f 有关用法,请参阅'minikube kubectl --help'。
but not only this, I try to write another command but again same error happening但不仅如此,我尝试编写另一个命令,但同样的错误再次发生
minikube kubectl delete daemonsets,replicasets,services,deployments,pods,rc,pvc --all
Error: unknown flag: --all See 'minikube kubectl --help' for usage. minikube kubectl delete daemonsets,replicasets,services,deployments,pods,rc,pvc --all
Error: unknown flag: --all 有关用法,请参见“minikube kubectl --help”。
please help me.请帮我。 thanks
谢谢
AFAIK, --all is not a valid flag. AFAIK,--all 不是有效标志。 Valid flag is --all-namespaces or just -A.
有效标志是 --all-namespaces 或只是 -A。
However, "kubectl delete" does not take -A as it needs the resource name for deletion.但是,“kubectl delete”不需要-A,因为它需要资源名称才能删除。
To accomplish what you are trying to do you will have to write a loop to delete the objects 1 by one using为了完成你想要做的事情,你必须编写一个循环来删除对象 1 使用
kubectl get daemonsets,replicasets,services,deployments,pods,rc,pvc -A --no-headers | while read line; do
namespace=$(echo $line | awk '{print $1}')
resource=$(echo $line | awk '{print $2}')
kubectl delete ${resource} -n ${namespace}
done
Execution - BE extremely careful with this as it will delete all queried resources in all namespaces including those in kube-system namespace :执行 - 对此要非常小心,因为它会删除所有命名空间中的所有查询资源,包括 kube-system 命名空间中的资源:
controlplane $ kubectl get daemonsets,replicasets,services,deployments,pods,rc,pvc -A --no-headers | while read line; do
> namespace=$(echo $line | awk '{print $1}')
> resource=$(echo $line | awk '{print $2}')
> kubectl delete ${resource} -n ${namespace}
> done
daemonset.extensions "kube-keepalived-vip" deleted
daemonset.extensions "kube-proxy" deleted
daemonset.extensions "weave-net" deleted
replicaset.extensions "coredns-fb8b8dccf" deleted
replicaset.extensions "katacoda-cloud-provider-d5cb9d656" deleted
service "kubernetes" deleted
service "kube-dns" deleted
deployment.extensions "coredns" deleted
deployment.extensions "katacoda-cloud-provider" deleted
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.