[ec2-user@ip-172-31-80-45 k8s-demo]minikube dashboard
[ec2-user@ip-172-31-80-45 ~]$ minikube addons enable ingress
💡 ingress is an addon maintained by Kubernetes. For any concerns contact minikube on GitHub.
You can view the list of minikube maintainers at: https://github.com/kubernetes/minikube/blob/master/OWNERS
▪ Using image registry.k8s.io/ingress-nginx/controller:v1.11.2
▪ Using image registry.k8s.io/ingress-nginx/kube-webhook-certgen:v1.4.3
▪ Using image registry.k8s.io/ingress-nginx/kube-webhook-certgen:v1.4.3
🔎 Verifying ingress addon...
🌟 The 'ingress' addon is enabled
Create a YAML file:
[ec2-user@ip-172-31-80-45 k8s-demo]$ kubectl apply -f dashboard-ingress.yaml
ingress.networking.k8s.io/dashboard-ingress created
[ec2-user@ip-172-31-80-45 ~]$ kubectl get ns
NAME STATUS AGE
default Active 2d22h
ingress-nginx Active 2d15h
kube-node-lease Active 2d22h
kube-public Active 2d22h
kube-system Active 2d22h
kubernetes-dashboard Active 41h
[ec2-user@ip-172-31-80-45 k8s-demo]$ kubectl get ingress -n kubernetes-dashboard
NAME CLASS HOSTS ADDRESS PORTS AGE
dashboard-ingress nginx * 192.168.49.2 80 40h
[ec2-user@ip-172-31-80-45 k8s-demo]$ sudo iptables -A PREROUTING -t nat -i enX0 -p tcp --dport 80 -j DNAT --to-destination 192.168.49.2:80
sudo iptables -A FORWARD -p tcp -d 192.168.49.2 --dport 80 -j ACCEPT
[ec2-user@ip-172-31-80-45 ~]$ kubectl describe ingress dashboard-ingress -n kubernetes-dashboard
Name: dashboard-ingress
Labels: <none>
Namespace: kubernetes-dashboard
Address: 192.168.49.2
Ingress Class: nginx
Default backend: kubernetes-dashboard:80 (10.244.0.40:9090)
Rules:
Host Path Backends
---- ---- --------
* * kubernetes-dashboard:80 (10.244.0.40:9090)
Annotations: <none>
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Sync 8m29s (x3 over 9m29s) nginx-ingress-controller Scheduled for sync
[ec2-user@ip-172-31-80-45 ~]$ kubectl delete ingress dashboard-ingress -n kubernetes-dashboard
ingress.networking.k8s.io "dashboard-ingress" deleted
No hay comentarios:
Publicar un comentario