DevOps Classroom notes 09/Jul/2026

Layer 4 and Layer 7 LB

  • Prompt
I'm trying to understand the differences of 
 Layer 4 and Layer 7 Load Balancing.

I want to understand
  when to use which approach

Explain in detail by simple example

Service and ingress

  • K8s service deals at L4 and ingress deals at L7
  • K8s ingress comes with
    • ingress => Rules
    • ingressController => Implements the rules
  • In k8s there is no default ingress controller.
  • popular ingress controllers
Give me the list of popular ingress controllers and also how to deploy them into kubernetes,
Also give me cloud provider specific ingress controllers supported for AWS, Azure and GCP
  • Use this deployment
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: nginx-service
spec:
  selector:
    app: nginx
  ports:
  - port: 80
    targetPort: 80

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: httpd
spec:
  replicas: 1
  selector:
    matchLabels:
      app: httpd
  template:
    metadata:
      labels:
        app: httpd
    spec:
      containers:
      - name: httpd
        image: httpd:2.4
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: httpd-service
spec:
  selector:
    app: httpd
  ports:
  - port: 80
    targetPort: 80
  • in killercoda lets install nginx ingress kubectl apply -f \
    https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/cloud/deploy.yaml
  • Prompt
Give me examples of ingress rules

   - simple path based routing no redirection
   - simple path based routing with redirection
   - header based routing
   - other possibilities

one by one with manifests and explanations
  • Our example
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: my-ingress
  annotations:
    nginx.ingress.kubernetes.io/use-regex: "true"
    nginx.ingress.kubernetes.io/rewrite-target: /$2

spec:
  ingressClassName: nginx

  rules:
  - http:
      paths:
      - path: /nginx(/|$)(.*)
        pathType: ImplementationSpecific
        backend:
          service:
            name: nginx-service
            port:
              number: 80

      - path: /httpd(/|$)(.*)
        pathType: ImplementationSpecific
        backend:
          service:
            name: httpd-service
            port:
              number: 80

Purpose of CNI and Kube-proxy

Facts

  • Every pod gets an ip address
  • A service which is a virtual ip address when accessed is forwarding the request to pod

How?

  • who is giving ip to Pod
  • how does a Container running in a Pod communicate with
    • Container running in a Same Pod
    • Pod running in the same node
    • Pod running in the different node

Basics

  • iptables
  • NAT

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube