I am learning some Kubernetes and am in the ingress section of this tutorial. There I have had to change my config file for the ingress to the newer version of Kubernes. That starts also so far quite well, but unfortunately the ingress is not assigned my host IP. The orginal file for the ingress looks like this
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: dashboard-ingress
namespace: kubernetes-dashboard
spec:
rules:
- host: dashboard.com
http:
paths:
- backend:
serviceName: kubernetes-dashboard
servicePort: 80
My adjustment is the following:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: dashboard-ingress
namespace: kubernetes-dashboard
spec:
defaultBackend:
service:
name: kubernetes-dashboard
port:
number: 80
rules:
- host: dashboard.com
http:
paths:
- path: "/"
pathType: Prefix
backend:
service:
name: kubernetes-dashboard
port:
number: 80
If I then look at the ingress with "get" I get the following result
kubectl get ingress -n kubernetes-dashboard
NAME CLASS HOSTS ADDRESS PORTS AGE
dashboard-ingress <none> dashboard.com 80 18m
and with describe comes out the following
kubectl describe ingress -n kubernetes-dashboard
Name: dashboard-ingress
Namespace: kubernetes-dashboard
Address:
Default backend: kubernetes-dashboard:80 (172.17.0.6:9090)
Rules:
Host Path Backends
---- ---- --------
dashboard.com
/ kubernetes-dashboard:80 (172.17.0.6:9090)
Annotations: <none>
Events: <none>
when i look at the logs from ingress pod, this is what catches my eye
8 main.go:101] "successfully validated configuration, accepting" ingress="dashboard-ingress/kubernetes-dashboard"
I0917 14:56:01.607654 8 store.go:361] "Ignoring ingress because of error while validating ingress class" ingress="kubernetes-dashboard/dashboard-ingress" error="ingress does not contain a valid IngressClass"
E0917 14:56:11.341175 8 leaderelection.go:361] Failed to update lock: configmaps "ingress-controller-leader" is forbidden: User "system:serviceaccount:ingress-nginx:ingress-nginx" cannot update resource "configmaps" in API group "" in the namespace "ingress-nginx"
What am I doing wrong here?
Greetings niesel
That's a bug that has been reported and solved in minikube 1.23.1. You must just update minikube to 1.23.1 and ingress will work properly.