I'm implementing this example with az aks
. I want to use ingress in order to use easily the reverse proxy as in the example with a container redirected to /tea
and the other to /coffee
based on the ingress simple rules.
rules:
- host: cafe.example.com
http:
paths:
- path: /tea
backend:
serviceName: tea-svc
servicePort: 80
- path: /coffee
backend:
serviceName: coffee-svc
servicePort: 80
I follow the steps, however, azure wont give an ip address to my ingress as you can see.
$ kubectl get ingress
NAME HOSTS ADDRESS PORTS AGE
demo-ingress demo.mydomain.com 80, 443 17h
I think azure only give addresses to the loadbalancers. Is there any workaround or solution for this? Can I somehow say azure
to give an IP to my ingress?
As some additional info, I also tried `helm:
helm install stable/nginx-ingress --set controller.publishService.enabled=true
However I'm a complete novice and it seems to do nothing.
It took me a while to publish the answer. I wanted to understand a bit more what was happening in the container.
Anyway, the problem with the implementation I was testing, it is that a azure compatible ingress controller has to be installed (that's kind of my best guess, I'm not an expert though). The steps to install the ingress controller are here.
All the documents concerned are in the folder /install. What I did in the end was a makefile
containing the following instructions:
kubectl apply -f install/common/ns-and-sa.yaml
kubectl apply -f install/common/default-server-secret.yaml
kubectl apply -f install/common/nginx-config.yaml
kubectl apply -f install/rbac/rbac.yaml
kubectl apply -f install/deployment/nginx-ingress.yaml
kubectl apply -f install/daemon-set/nginx-ingress.yaml
kubectl create -f install/service/nodeport.yaml
kubectl apply -f install/service/loadbalancer.yaml
kubectl get svc nginx-ingress --namespace=nginx-ingress
It's a bit cumbersome, but as long that it is only one command in my makefile, it's ok.
I hope this helps anyone who encounters the same problem.