minikube 中未启用入口

ingress not enabled in minikube

我在 minikube

上启用了 ingress
C:\WINDOWS\system32>minikube addons enable ingress
  - Using image k8s.gcr.io/ingress-nginx/controller:v0.44.0
  - Using image docker.io/jettech/kube-webhook-certgen:v1.5.1
  - Using image docker.io/jettech/kube-webhook-certgen:v1.5.1
* Verifying ingress addon...
* The 'ingress' addon is enabled

但是我列出来的时候没看到

C:\WINDOWS\system32>minikube kubectl -- get pod -n kube-system
NAME                               READY   STATUS    RESTARTS   AGE
coredns-74ff55c5b-px725            1/1     Running   0          13d
etcd-minikube                      1/1     Running   0          13d
kube-apiserver-minikube            1/1     Running   6          13d
kube-controller-manager-minikube   1/1     Running   0          13d
kube-proxy-h7r79                   1/1     Running   0          13d
kube-scheduler-minikube            1/1     Running   0          13d
storage-provisioner                1/1     Running   76         13d

ingress没有启用吗?我该如何检查?

我重现了这种情况,得到了同样的情况。执行命令后:

minikube addons enable ingress

我的输出和你的一样:

  - Using image k8s.gcr.io/ingress-nginx/controller:v0.44.0
  - Using image docker.io/jettech/kube-webhook-certgen:v1.5.1
  - Using image docker.io/jettech/kube-webhook-certgen:v1.5.1
* Verifying ingress addon...
* The 'ingress' addon is enabled

我也有相同的输出,当我执行时:

minikube kubectl -- get pod -n kube-system

解法: 首先,您可以使用命令列出名称空间:

minikube kubectl get namespaces

你的输出应该如下:

NAME              STATUS   AGE
default           Active   4m46s
ingress-nginx     Active   2m28s
kube-node-lease   Active   4m47s
kube-public       Active   4m47s
kube-system       Active   4m47s

入口应该在 ingress-nginx 命名空间中。执行:

minikube kubectl -- get pods --namespace ingress-nginx

然后你的输出应该如下:

NAME                                        READY   STATUS      RESTARTS   AGE
ingress-nginx-admission-create-nqnvj        0/1     Completed   0          2m56s
ingress-nginx-admission-patch-62z9z         0/1     Completed   0          2m55s
ingress-nginx-controller-5d88495688-ssv5c   1/1     Running     0          2m56s

总结 - 您的入口控制器应该可以工作,只是在不同的命名空间中。