Kubernetes Ingress
Kubernetes Ingress
Kubernetes Ingress
Michael Robotics
Hi, I'm Michal. I'm a Robotics Engineer and DevOps enthusiast. My mission
is to create skill-learning platform that combats information overload by
adhering to the set of principles: simplify, prioritize, and execute.
https://github.com/MichaelRobotics
https://github.com/MichaelRobotics/DevOpsTools/blob/main/KubernetesIngress.pdf
Download PDF
Click there to go to ChatPdf website
Go to website
Browse file
Essential for this PDF is a thorough knowledge of networking. I highly recommend the HTB
platform's networking module, which offers extensive information to help build a
comprehensive understanding.
https://www.hackthebox.com/
What is Kubernetes?
Kubernetes is an open-source platform that automates the deployment, scaling, and
management of containerized applications. It helps manage clusters of nodes running
containers, ensuring efficient and reliable operation.
Kubernetes clusters consist of a control plane and multiple worker nodes. The control plane
manages cluster operations, while worker nodes run the actual container workloads.
System Requirements
RAM: 2 GB per node (1 GB can work for testing but may lead to limited performance)
10 GB free storage
Ubuntu
kube-apiserver: Central management component that exposes the Kubernetes API; acts
etcd: Distributed key-value store for storing all cluster data, ensuring data consistency
across nodes.
policies.
kubelet: Agent that runs on each node, responsible for managing pods and their
containers.
to services within a Kubernetes cluster. It interprets and applies rules defined by Ingress
resources to control how incoming HTTP and HTTPS traffic is routed to different services
external load balancer, unlike the costly LoadBalancer service provided by cloud providers.
2. Efficient Traffic Routing: Supports advanced routing, SSL termination, and load balancing,
3. Enhanced Security: Manages HTTPS, SSL certificates, and access control, adding a
An Ingress Controller streamlines access, enhances security, and reduces cloud costs, making
Ingress refers to external traffic that enters your Kubernetes cluster. But how is this traffic
Kubernetes use ingress resource, which is defined by the user through yaml file:
Deploying an Ingress resource in Kubernetes sets rules for routing external traffic to services
By default, the Ingress Controller requests a cloud-provided load balancer, but changing its
service type to NodePort allows it to create a load balancer within the cluster instead.
navigate to website:
And configure your private repo. Each user can create 1 free private repository.
Most important part to remember is your repo name, your username and password.
https://killercoda.com/playgrounds/course/kubernetes-playgrounds/two-node
3) Download app
in my case:
docker login
To allow Kubernetes to pull images from your private Docker repository, create a secret with
--docker-username=<your-username> \
--docker-password=<your-password> \
--docker-email=<your-email>
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world
labels:
app: hello-world
spec:
replicas: 1
selector:
matchLabels:
app: hello-world
template:
metadata:
labels:
app: hello-world
spec:
containers:
- name: hello-world
image: robclusterdev/clusterimages:Flask
ports:
- containerPort: 80
imagePullSecrets:
- name: my-dockerhub-secret
Then deploy service. Important to notice is a selector. It should point towards deployed
container.
apiVersion: v1
kind: Service
metadata:
name: hello-world
spec:
selector:
app: hello-world
ports:
- protocol: TCP
port: 80
targetPort: 80
Then deploy service manifest file and check its functionality. Should go as follows:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: hello-world
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
ingressClassName: nginx
rules:
- host: "example.com"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: hello-world
port:
number: 80
As specified in the manifest file, the NGINX controller routes traffic to the hello-world service
install helm
Install Ingress
Enter ingress controlelr configuration and change its service type to NodePort from
LoadBalancer
to edit service:
Additionally, check if your service has an assigned IP address. If it does, your ingress controller
is configured correctly.
Accessing the service IP won't yield a response from the load balancer, as it only responds
address.
restart network-manager
curl http://example.com
Michael Robotics
Hi, I'm Michal. I'm a Robotics Engineer and DevOps enthusiast. My mission
is to create skill-learning platform that combats skill information overload
by adhering to the set of principles: simplify, prioritize, and execute.
https://github.com/MichaelRobotics
https://github.com/piyushsachdeva/CKA-2024/tree/main/Resources/Day27
Kubernetes Documentation
This section lists the different ways to set up and run Kubernetes
https://kubernetes.io/docs/setup/
Michael Robotics
Hi, I'm Michal. I'm a Robotics Engineer and DevOps enthusiast. My mission
is to create skill-learning platform that combats skill information overload
by adhering to the set of principles: simplify, prioritize, and execute.
https://github.com/MichaelRobotics
PS.