kubernetes 为什么我不能在minikube中启用入口?

jtoj6r0c  于 2022-11-28  发布在  Kubernetes
关注(0)|答案(6)|浏览(251)

我尝试在minkube中启用入口。当我运行minikube addons enable ingress时,它挂起了一段时间,然后我得到以下错误信息:

❌  Exiting due to MK_ADDON_ENABLE: run callbacks: running callbacks: [sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.19.15/kubectl apply -f /etc/kubernetes/addons/ingress-deploy.yaml: Process exited with status 1
stdout:
namespace/ingress-nginx unchanged
serviceaccount/ingress-nginx unchanged
configmap/ingress-nginx-controller unchanged
configmap/tcp-services unchanged
configmap/udp-services unchanged
clusterrole.rbac.authorization.k8s.io/ingress-nginx unchanged
clusterrolebinding.rbac.authorization.k8s.io/ingress-nginx unchanged
role.rbac.authorization.k8s.io/ingress-nginx unchanged
rolebinding.rbac.authorization.k8s.io/ingress-nginx unchanged
service/ingress-nginx-controller-admission unchanged

stderr:
error: error validating "/etc/kubernetes/addons/ingress-deploy.yaml": error validating data: [ValidationError(Service.spec): unknown field "ipFamilies" in io.k8s.api.core.v1.ServiceSpec, ValidationError(Service.spec): unknown field "ipFamilyPolicy" in io.k8s.api.core.v1.ServiceSpec]; if you choose to ignore these errors, turn validation off with --validate=false
 waiting for app.kubernetes.io/name=ingress-nginx pods: timed out waiting for the condition]

╭───────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                           │
│    😿  If the above advice does not help, please let us know:                             │
│    👉  https://github.com/kubernetes/minikube/issues/new/choose                           │
│                                                                                           │
│    Please run `minikube logs --file=logs.txt` and attach logs.txt to the GitHub issue.    │
│    Please also attach the following file to the GitHub issue:                             │
│    - /tmp/minikube_addons_2c0e0cafd16ea0f95ac51773aeef036b316005b6_0.log                  │
│                                                                                           │
╰───────────────────────────────────────────────────────────────────────────────────────────╯

下面是我使用的minikube启动命令:minikube start --kubernetes-version=v1.19.15 --vm-driver=docker
我试过重新安装minikube。上周当我运行同样的命令时,它工作得很好。
如果需要更具体的信息,请让我知道,我将编辑问题。有人知道我如何可以去解决这个问题吗?
先谢谢你。

nafvub8i

nafvub8i1#

降级到minikube v1.23.2解决了该问题。

sirbozc5

sirbozc52#

1.您使用的是哪种操作系统?

# If you are using Mac:
brew install docker-machine-driver-vmware
# Start a cluster using the vmware driver:
minikube start --driver=vmware
# To make vmware the default driver:
minikube config set driver vmware
5us2dqdw

5us2dqdw3#

升级到minikube v1.26.0解决了此问题。

sz81bmfz

sz81bmfz4#

在我的案例中的错误是:
X由于MK_ADDON_ENABLE而退出:正在运行回调:运行回调:[新会话:新客户:新客户:使用以下命令从ssh创建新的本机配置时出错:用户名:打开C:\用户.minikube\计算机\minikube\id_rsa:**访问被拒绝。**等待app.kubernetes.io/name=ingress-nginx pod:等待条件超时]
简单的修复是使用管理员运行PowerShell(我在Windows上)。我使用的是v1.26.0。

gab6jxml

gab6jxml5#

有点晚了,但我希望有人发现这个有用,这是因为minikube不能及时拉图像(ingress-nginx-controller),知道的方法是:

kubectl get pod -n ingress-nginx

如果ingress-nginx-controller-xxxx(xxxx是pod的标识符)的状态为ImagePullBackOff或类似状态,则您处于此场景中。
要解决此问题,您需要首先描述您的pod:

kubectl describe pod ingress-nginx-controller-xxxxx -n ingress-nginx

在containers/controller/images下查找并复制它的值(如果它包含@sha256:...,则不需要复制它)。您必须手动拉取它,但在此之前可能还要删除相关的部署:

kubectl delete deployment ingress-nginx-controller -n ingress-nginx

然后从虚拟机本身提取映像,在我的示例中如下所示:

minikube ssh docker pull k8s.gcr.io/ingress-nginx/controller:v1.2.1

等待它,然后尝试“插件启用入口”再次,看看它是否工作,它为我做到了。

f1tvaqid

f1tvaqid6#

minikube delete --all --purge

minikube addons enable ingress

相关问题