简体   繁体   English

Minikube 仪表板入口

[英]Minikube dashboard ingress

Im trying to make an ingress for the minikube dashboard using the embedded dashboard internal service.我正在尝试使用嵌入式仪表板内部服务为 minikube 仪表板创建入口。

I enabled both ingress and dashboard minikube addons.我启用了ingressdashboard minikube 插件。

I also wrote this ingress YAML file:我还写了这个入口 YAML 文件:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: dashboard-ingress
  namespace: kubernetes-dashboard
spec:
  rules:
  - host: dashboard.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: kubernetes-dashboard
            port: 
              number: 80

My Ingress is being created well as u can see:如您所见,我的 Ingress 正在创建良好:

NAME                CLASS   HOSTS           ADDRESS     PORTS   AGE
dashboard-ingress   nginx   dashboard.com   localhost   80      15s

I edited my /etc/hosts to add this line: 127.0.0.1 dashboard.com .我编辑了我的/etc/hosts以添加这一行: 127.0.0.1 dashboard.com

Now im trying to access the dashboard trough dashboard.com .现在我试图通过dashboard.com访问仪表板槽。 But it's not working.但它不起作用。

kubectl describe ingress dashboard-ingress -n kubernetes-dashboard gives me this: kubectl describe ingress dashboard-ingress -n kubernetes-dashboard给了我这个:

Name:             dashboard-ingress
Namespace:        kubernetes-dashboard
Address:          localhost
Default backend:  default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
Rules:
  Host           Path  Backends
  ----           ----  --------
  dashboard.com  
                 /   kubernetes-dashboard:80 (172.17.0.4:9090)
Annotations:     <none>
Events:
  Type    Reason  Age                From                      Message
  ----    ------  ----               ----                      -------
  Normal  Sync    14m (x2 over 14m)  nginx-ingress-controller  Scheduled for sync

I don't really understand what <error: endpoints "default-http-backend" not found> means, but maybe my issue comes from this.我真的不明白<error: endpoints "default-http-backend" not found>是什么意思,但也许我的问题来自这个。

kubectl get pods -n ingress-nginx result: kubectl get pods -n ingress-nginx结果:

NAME                                        READY   STATUS      RESTARTS   AGE
ingress-nginx-admission-create--1-8krc7     0/1     Completed   0          100m
ingress-nginx-admission-patch--1-qblch      0/1     Completed   1          100m
ingress-nginx-controller-5f66978484-hvk9j   1/1     Running     0          100m

Logs for nginx-controller pod: nginx-controller pod 的日志:

-------------------------------------------------------------------------------
NGINX Ingress controller
  Release:       v1.0.4
  Build:         9b78b6c197b48116243922170875af4aa752ee59
  Repository:    https://github.com/kubernetes/ingress-nginx
  nginx version: nginx/1.19.9

-------------------------------------------------------------------------------

W1205 19:33:42.303136       7 client_config.go:615] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
I1205 19:33:42.303261       7 main.go:221] "Creating API client" host="https://10.96.0.1:443"
I1205 19:33:42.319750       7 main.go:265] "Running in Kubernetes cluster" major="1" minor="22" git="v1.22.3" state="clean" commit="c92036820499fedefec0f847e2054d824aea6cd1" platform="linux/amd64"
I1205 19:33:42.402223       7 main.go:104] "SSL fake certificate created" file="/etc/ingress-controller/ssl/default-fake-certificate.pem"
I1205 19:33:42.413477       7 ssl.go:531] "loading tls certificate" path="/usr/local/certificates/cert" key="/usr/local/certificates/key"
I1205 19:33:42.420838       7 nginx.go:253] "Starting NGINX Ingress controller"
I1205 19:33:42.424731       7 event.go:282] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress-nginx", Name:"ingress-nginx-controller", UID:"f2d27cc7-b103-490f-807f-18ccaa614e6b", APIVersion:"v1", ResourceVersion:"664", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/ingress-nginx-controller
I1205 19:33:42.427171       7 event.go:282] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress-nginx", Name:"tcp-services", UID:"e174971d-df1c-4826-85d4-194598ab1912", APIVersion:"v1", ResourceVersion:"665", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/tcp-services
I1205 19:33:42.427195       7 event.go:282] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress-nginx", Name:"udp-services", UID:"0ffc7ee9-2435-4005-983d-ed41aac1c9aa", APIVersion:"v1", ResourceVersion:"666", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/udp-services
I1205 19:33:43.622661       7 nginx.go:295] "Starting NGINX process"
I1205 19:33:43.622746       7 leaderelection.go:243] attempting to acquire leader lease ingress-nginx/ingress-controller-leader...
I1205 19:33:43.623402       7 nginx.go:315] "Starting validation webhook" address=":8443" certPath="/usr/local/certificates/cert" keyPath="/usr/local/certificates/key"
I1205 19:33:43.623683       7 controller.go:152] "Configuration changes detected, backend reload required"
I1205 19:33:43.643547       7 leaderelection.go:253] successfully acquired lease ingress-nginx/ingress-controller-leader
I1205 19:33:43.643635       7 status.go:84] "New leader elected" identity="ingress-nginx-controller-5f66978484-hvk9j"
I1205 19:33:43.691342       7 controller.go:169] "Backend successfully reloaded"
I1205 19:33:43.691395       7 controller.go:180] "Initial sync, sleeping for 1 second"
I1205 19:33:43.691435       7 event.go:282] Event(v1.ObjectReference{Kind:"Pod", Namespace:"ingress-nginx", Name:"ingress-nginx-controller-5f66978484-hvk9j", UID:"55d45c26-eda7-4b37-9b04-5491cde39fd4", APIVersion:"v1", ResourceVersion:"697", FieldPath:""}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
I1205 21:06:47.402756       7 main.go:101] "successfully validated configuration, accepting" ingress="dashboard-ingress/kubernetes-dashboard"
I1205 21:06:47.408929       7 store.go:371] "Found valid IngressClass" ingress="kubernetes-dashboard/dashboard-ingress" ingressclass="nginx"
I1205 21:06:47.409343       7 controller.go:152] "Configuration changes detected, backend reload required"
I1205 21:06:47.409352       7 event.go:282] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"kubernetes-dashboard", Name:"dashboard-ingress", UID:"be1ebfe9-fdb3-4d0c-925b-0c206cd0ece3", APIVersion:"networking.k8s.io/v1", ResourceVersion:"5529", FieldPath:""}): type: 'Normal' reason: 'Sync' Scheduled for sync
I1205 21:06:47.458273       7 controller.go:169] "Backend successfully reloaded"
I1205 21:06:47.458445       7 event.go:282] Event(v1.ObjectReference{Kind:"Pod", Namespace:"ingress-nginx", Name:"ingress-nginx-controller-5f66978484-hvk9j", UID:"55d45c26-eda7-4b37-9b04-5491cde39fd4", APIVersion:"v1", ResourceVersion:"697", FieldPath:""}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
I1205 21:07:43.654037       7 status.go:300] "updating Ingress status" namespace="kubernetes-dashboard" ingress="dashboard-ingress" currentValue=[] newValue=[{IP: Hostname:localhost Ports:[]}]
I1205 21:07:43.660598       7 event.go:282] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"kubernetes-dashboard", Name:"dashboard-ingress", UID:"be1ebfe9-fdb3-4d0c-925b-0c206cd0ece3", APIVersion:"networking.k8s.io/v1", ResourceVersion:"5576", FieldPath:""}): type: 'Normal' reason: 'Sync' Scheduled for sync

Anyone has a clue on how i can solve my problem?任何人都知道如何解决我的问题?

(Im using minikube v1.24.0) (我使用 minikube v1.24.0)

Regards,问候,

I had similar issues with Minikube's Ingress, but I was using Windows. Minikube 的 Ingress 也有类似的问题,但我使用的是 Windows。

After indepth search, I discovered that the problem came from Docker's driver.经过深入搜索,发现问题出在Docker的驱动上。

I changed the driver to VirtualBox and Ingress started behaving as expected.我将驱动程序更改为 VirtualBox,Ingress 开始按预期运行。

This entry provides further details.此条提供了更多详细信息。

I have also faced the same issue with minikube(v1.25.1) running in my local.我在本地运行的 minikube(v1.25.1) 也遇到了同样的问题。

kubectl get ingress -n kubernetes-dashboard

NAME                CLASS   HOSTS           ADDRESS     PORTS   AGE
dashboard-ingress   nginx   dashboard.com   localhost   80      34m

After debug I have found this.调试后我发现了这个。 "If you are running Minikube locally, use minikube ip to get the external IP. The IP address displayed within the ingress list will be the internal IP". “如果您在本地运行 Minikube,请使用 minikube ip 获取外部 IP。入口列表中显示的 IP 地址将是内部 IP。”

Run this command运行此命令

minikube ip
XXX.XXX.64.2

add this ip in the host file,after that I am able to access dashboard.com在主机文件中添加这个 ip,之后我就可以访问仪表板了。com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM