Ingress — Kubernetes

Always learning
3 min readNov 14, 2023

--

Kubernetes Ingress enables customization of how entities outside a network communicate with Kubernetes applications that run within the network.

Kubernetes Ingress is an API object that provides routing rules to manage external user’s access to the services in a Kubernetes cluster.

In other words, it allows you to expose your Kubernetes services to the outside world in a way that is scalable, secure, and flexible.

Ingress ← Theory Part

Ingress 2

Some of the benefits of using Kubernetes Ingress

Simplified service exposure

Advanced traffic management

Load balancing

Enhanced security

Scalability and flexibility

Ingress Controller

Ingress controller is something which implements the information carried by ingress resource

Ingress controller example are nginx-ingress, HAProxy etc..,

Nginx ingress is most widely used controller

This controller runs in a pod of the same cluster

We need to enable ingress in minikube

minikube addons enable ingress

Create a ingress.yml file

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-example
spec:
rules:
- host: "foo.bar.com"
http:
paths:
- pathType: Prefix
path: "/bar"
backend:
service:
name: nginx-np-svc
port:
number: 80

Check kubectl service

kubectl get svc

Create a deployment

kubectl apply -f ingress.yml

Check ingress.yml file

kubectl get ingress

If you try to ping domain or IP address

If manually add the /etc/hosts file 192.168.49.2 foo.bar.com

If trying to connect maybe ping sometimes

Most of the internally used to http connect but outside connections need to https. So purchase godaddy domain add to the secure connection.

The transport layer security (TLS) protocol uses certificates to provide security for communication, encryption, authentication, and integrity.

Services — Kubernetes → See previous blog

--

--

Always learning
Always learning

Written by Always learning

கற்றுக் கொள்ளும் மாணவன்...