loading...
Cover image for What is Ingress Controller in Kubernetes?

What is Ingress Controller in Kubernetes?

sagarjadhv23 profile image Sagar Jadhav Originally published at developersthought.in ・1 min read

Kubernetes Primer (5 Part Series)

1) What is Deployment, Service, Secret and ConfigMap in Kubernetes? 2) What is Persistent Volume (PV) & Persistent Volume Claim (PVC) in Kubernetes? 3) What is Ingress Controller in Kubernetes? 4) What is Readiness & Liveness Probes in Kubernetes? 5) How to deploy applications using Helm in Kubernetes?

In Deploy phpMyAdmin application on kubernetes blog I used NodePort service type to expose application to external world but disadvantage with that approach is port needs to be exposed on each node and there is a dependency on external load balancer for load balancing requests, custom hostname and SSL/TLS encryption support etc. With the help of Ingress controllers I can eliminate dependency on external load balancer. In this blog I am using Nginx Ingress controller to expose PHPMyAdmin application to external world. Learn more about ingress controller here

Architecture

Alt Text

Prerequisites:

Deploy PHPMyAdmin Application

Follow Deploy phpMyAdmin application on kubernetes blog

Go to session_2 directory

cd ../session_3/

Step 1: Enable Nginx ingress controller

minikube addons enable ingress
kubectl get pods --watch -n kube-system

Exit once controller pod goes into running state

This step is valid only for Minikube. Check steps to enable Nginx Ingress controller on Kubernetes here

Step 2: Delete PHPMyAdmin NodePort service

kubectl delete svc phpmyadmin

Step 3: Deploy PHPMyAdmin ClusterIP service

kubectl create -f phpmyadmin-service.yaml

Step 4: Deploy PHPMyAdmin Ingress rule

kubectl create -f phpmyadmin-ingress.yaml
kubectl get ingress --watch

Exit once address gets populated

Step 5: Update hosts file custome hostname

Add below entry in /etc/hosts

<INGRESS_ADDRESS> myapp.xyz

Get INGRESS_ADDRESS from kubectl get ingress

Demo

Kubernetes Primer (5 Part Series)

1) What is Deployment, Service, Secret and ConfigMap in Kubernetes? 2) What is Persistent Volume (PV) & Persistent Volume Claim (PVC) in Kubernetes? 3) What is Ingress Controller in Kubernetes? 4) What is Readiness & Liveness Probes in Kubernetes? 5) How to deploy applications using Helm in Kubernetes?

Posted on Jun 13 by:

sagarjadhv23 profile

Sagar Jadhav

@sagarjadhv23

Backend Developer (Cloud ☁️) | Cloud Technology Enthusiast (🐳 ☸) Redhat Certified OpenShift Administrator

Discussion

markdown guide