How to configure nginx on kubernetes 1.8.1 as ingress controller

Last modified date

What is an Ingress controller

An ingress controller is component in the kubernetes cluster that manages the trafic coming into the cluster. Through ingress configurations you can define the rules to access the containers in you pod. For more info refer to the official documentation.

Default backend

A default backend is required so ingress can redirect all the requests not matching any rule in ingress configuration.

First of all we are going to create a namespace for our ingress controller

Now we can create the default-backend-service.yaml and default-backend-deployment.yaml and apply them:

Ingress controller

The following nginx-ingress-controller-config-map.yaml, nginx-ingress-controller-roles.yaml and
nginx-ingress-controller-deployment.yaml will, define a config map for the controller, define cluster role permissions and finally define the ingress controller itself.

Now you should have the following files:
– nginx-ingress-controller-config-map.yaml
– nginx-ingress-controller-roles.yaml
– nginx-ingress-controller-deployment.yaml

You can now load them by running the following command:

This is the third of three articles, the other two are
How to install Kubernetes on Centos 7.3
Configure Kubernetes Dashboard