Ingress
K8s Load Balancer
NGINX Ingress
Deploy NGINX ingress
Deploy NGINX ingress:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yamlDeploy NGINX ingress service (example for bare-metal):
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/baremetal/service-nodeport.yamlCheck if the service was created:
kubectl get services --namespace=ingress-nginxOutput example:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
ingress-nginx NodePort 10.111.35.186 <none> 80:32022/TCP,443:31845/TCP 29mTest a deployment
Let's create two different deployments to test.
Create the first deployment:
Create the second deployment:
Create ingress
Text:
Check the ingress:
Test
Get your cluster IP:
Edit your hosts file accordingly, for example:
http://test-001.com:30808/ http://test-002.com:30808/ http://test-003.com:30808/test-001 http://test-003.com:30808/test-002
References
http://fabricioveronez.net/2019/04/05/kubernetes-ingress-controller/
https://kubernetes.github.io/ingress-nginx/deploy/
https://itnext.io/kubernetes-ingress-controllers-how-to-choose-the-right-one-part-1-41d3554978d2
https://github.com/kubernetes/ingress-nginx/blob/master/docs/examples/rewrite/README.md
Last updated