kubectl wait - error:没有找到匹配的资源



我正在安装metallb,但是需要等待创建资源

kubectl wait --for=condition=ready --timeout=60s -n metallb-system --all pods

但是我得到:

error: no matching resources found

如果我不等待,我得到:

Error from server (InternalError): error when creating "STDIN": Internal error occurred: failed calling webhook "ipaddresspoolvalidationwebhook.metallb.io": failed to call webhook: Post "https://webhook-service.metallb-system.svc:443/validate-metallb-io-v1beta1-ipaddresspool?timeout=10s": dial tcp 10.106.91.126:443: connect: connection refused

你知道如何在真正能够等待条件之前等待资源被创建吗?

信息:

kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.4", GitCommit:"872a965c6c6526caa949f0c6ac028ef7aff3fb78", GitTreeState:"clean", BuildDate:"2022-11-09T13:36:36Z", GoVersion:"go1.19.3", Compiler:"gc", Platform:"linux/arm64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.4", GitCommit:"872a965c6c6526caa949f0c6ac028ef7aff3fb78", GitTreeState:"clean", BuildDate:"2022-11-09T13:29:58Z", GoVersion:"go1.19.3", Compiler:"gc", Platform:"linux/arm64"}

对于错误" no matching resources found ":

请等待一分钟再试一次,会解决的。

您可以在以下链接中找到关于该错误的解释设置配置连接器

对于错误STDIN:

按照下面提到的步骤操作:

你得到这个错误是因为API服务器无法连接到webhook

1)检查防火墙规则是否允许TCP端口443。

2)暂时禁用操作符
kubectl -n config-management-system scale deployment config-management-operator --replicas=0
deployment.apps/config-management-operator scaled

删除部署

kubectl delete deployments.apps  -n <namespace> -system <namespace>-controller-manager
deployment.apps "namespace-controller-manager" deleted

3)在默认命名空间

中创建一个configmap
kubectl create configmap foo
configmap/foo created

4)检查configmap不能与对象

上的标签一起工作
cat <<EOF | kubectl create -f -
apiVersion: v1
kind: ConfigMap
metadata:
labels:
configmanagement.gke.io/debug-force-validation-webhook: "true"
name: foo
EOF

来自服务器的错误(内部错误):创建"STDIN"时出错;内部错误发生:调用webhook失败"debug-validation. namspace .sh":调用webhook失败" Post "https://namespace-webhook-service.namespace-system.svc:443/v1/admit?timeout=3s":没有端点可用于服务"命名空间-webhook-service">

5)最后使用下面的命令进行清理:

kubectl delete configmap foo
configmap "foo" deleted
kubectl -n config-management-system scale deployment config-management-operator --replicas=1
deployment.apps/config-management-operator scaled

相关内容

  • 没有找到相关文章

最新更新