Im trying to make an ingress for the minikube dashboard using the embedded dashboard internal service.
I enabled both ingress
and dashboard
minikube addons.
I also wrote this ingress YAML file :
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 :
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
.
Now im trying to access the dashboard trough dashboard.com
. But it’s not working.
kubectl describe ingress dashboard-ingress -n kubernetes-dashboard
gives me this :
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.
kubectl get pods -n ingress-nginx
result :
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 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)
Regards,
2
Answers
I had similar issues with Minikube’s Ingress, but I was using Windows.
After indepth search, I discovered that the problem came from Docker’s driver.
I changed the driver to VirtualBox and Ingress started behaving as expected.
This entry provides further details.
I have also faced the same issue with minikube(v1.25.1) running in my local.
kubectl get ingress -n kubernetes-dashboard
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".
Run this command
add this ip in the host file,after that I am able to access dashboard.com