简体   繁体   English

找不到 Minikube 标志

[英]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.

相关问题 Minikube 无法启动:“未找到节点‘minikube’” - Minikube failed to start: "node 'minikube' not found" Minikube 在启动时一直显示无效标志的错误 - Minikube keeps showing error for invalid flag on start 在 minikube 上设置 Kubeflow:在 kubeflow 命名空间中找不到资源 - Setup Kubeflow on minikube: No resources found in kubeflow namespace Minikube,python alpine:未找到 python 命令 - Minikube, python alpine : python command not found 运行 minikube start 时 vswitch 未找到 hyperV - vswitch not found hyperV while running minikube start 在 Windows 上使用 docker 桌面找不到 NGINX Ingress 404(不是 minikube) - NGINX Ingress 404 not found using docker desktop on windows (not minikube) Spark 2.3-Minikube-Kubernetes-Windows-演示-未找到SparkPi - Spark 2.3 - Minikube - Kubernetes - Windows - Demo - SparkPi not found 未找到 404 nginx:无法通过 minikube 上的入口 ip 进行连接 - Not found 404 nginx: Unable to connect through ingress ip on minikube 由于 PROVIDER_HYPERV_NOT_FOUND,无法启动 minikube 并退出 - Unable to start minikube and exiting due to PROVIDER_HYPERV_NOT_FOUND 找不到`kubectl`。 如果需要,请尝试:'minikube kubectl -- get pods -A' - `kubectl` not found. If you need it, try: 'minikube kubectl -- get pods -A'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM