For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.yaml

Deploy NGINX ingress service (example for bare-metal):

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/baremetal/service-nodeport.yaml

Check if the service was created:

kubectl get services --namespace=ingress-nginx

Output example:

NAME            TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
ingress-nginx   NodePort   10.111.35.186   <none>        80:32022/TCP,443:31845/TCP   29m

Note port(s) of the service. It will be used later to access your host.

Test 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

Use you ingress service port.

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