DAY-38 | KUBERNETES INGRESS | WATCH DEMO USING LINK IN DESCRIPTION | #kubernetes #devops #freecourse
Résumé
TLDRIn this video, Abhishek discusses Kubernetes Ingress, a crucial component for managing external access to services in a Kubernetes cluster. He explains the common challenges users face, such as understanding the need for Ingress and the practical implementation issues. The video highlights the limitations of Kubernetes services, particularly in load balancing and cost implications when using multiple load balancer services. Ingress is introduced as a solution that provides advanced load balancing features and allows multiple services to share a single IP address, thus reducing costs. The video covers both theoretical concepts and practical steps for setting up Ingress, including the installation of an Ingress controller and creating Ingress resources for routing traffic to services. Abhishek emphasizes the importance of understanding these concepts for effective Kubernetes management and preparation for interviews.
A retenir
- 🔍 Understanding the necessity of Ingress in Kubernetes.
- 💡 Ingress solves load balancing limitations of Kubernetes services.
- 💰 Ingress reduces costs by sharing a single IP address for multiple services.
- 🛠️ Installation of Ingress controllers is essential for functionality.
- 📜 Ingress resources can be created for advanced traffic routing.
- 🔒 TLS-based routing can be configured using Ingress.
- 📈 Path-based routing allows directing traffic to specific services.
- 📊 Ingress provides enterprise-level load balancing capabilities.
- 📝 Practical implementation is crucial for mastering Ingress.
- 💬 Review and follow additional resources for deeper understanding.
Chronologie
- 00:00:00 - 00:05:00
Abhishek introduces the topic of Kubernetes Ingress, explaining its importance and the common difficulties people face with it, particularly in understanding its necessity and practical implementation. He mentions that he will cover both theory and practical aspects in the video.
- 00:05:00 - 00:10:00
He discusses the limitations of Kubernetes services, particularly in load balancing capabilities compared to traditional enterprise load balancers. He highlights the features that Kubernetes services lack, which are essential for users migrating from legacy systems.
- 00:10:00 - 00:15:00
Abhishek outlines two main problems that Kubernetes users face: the lack of enterprise-level load balancing features in Kubernetes services and the high costs associated with creating multiple load balancer services for numerous applications.
- 00:15:00 - 00:20:00
He explains that Ingress was introduced to address these issues by allowing users to create a single resource that can manage traffic routing for multiple services, thus reducing costs and providing advanced load balancing features.
- 00:20:00 - 00:25:00
The video details how Ingress works, including the role of Ingress controllers, which are necessary for implementing the Ingress resource. He emphasizes that users must choose and deploy an Ingress controller to utilize Ingress effectively.
- 00:25:00 - 00:30:00
Abhishek demonstrates how to install an Ingress controller, specifically the NGINX Ingress controller, on a Minikube cluster. He explains the steps involved and the importance of having the Ingress controller running to make use of the Ingress resource.
- 00:30:00 - 00:39:17
Finally, he shows how to create an Ingress resource for host-based routing and discusses the need to update the /etc/hosts file for local testing. He encourages viewers to explore further documentation and practical examples to deepen their understanding of Kubernetes Ingress.
Carte mentale
Vidéo Q&R
What is Kubernetes Ingress?
Kubernetes Ingress is a resource that manages external access to services in a Kubernetes cluster, typically HTTP.
Why is Ingress needed?
Ingress provides advanced load balancing features and reduces costs by allowing multiple services to share a single IP address.
What problems does Ingress solve?
Ingress addresses the limitations of Kubernetes services in load balancing capabilities and the high costs associated with using multiple load balancer services.
What is an Ingress controller?
An Ingress controller is a load balancer that implements the Ingress resource, managing traffic routing based on defined rules.
How do I install an Ingress controller?
You can install an Ingress controller like NGINX using commands specific to your Kubernetes setup, such as 'minikube addons enable ingress'.
Can I use Ingress for TLS-based routing?
Yes, Ingress can be configured for TLS-based routing to secure traffic.
What is the difference between a LoadBalancer service and Ingress?
A LoadBalancer service creates a separate IP for each service, while Ingress allows multiple services to share a single IP, reducing costs.
What is path-based routing in Ingress?
Path-based routing allows you to direct traffic to different services based on the request path.
How do I create an Ingress resource?
You create an Ingress resource by defining it in a YAML file and applying it using 'kubectl apply -f <filename>'.
What should I do if my Ingress resource is not working?
Ensure that the Ingress controller is installed and running, and check the logs for any errors.
Voir plus de résumés vidéo
Audit Snapshot: Risk Based Audit and the Audit Risk Model
Why do people want to be anonymous online? | Lewis Nitschinsk | TEDxUQ
Best Bond ETFs for Non-US Residents (US & Ireland Domiciled Bond ETFs)
This Changes Everything You Know
🚨 Trump faces HUMILIATING DEFEAT by Reporter in LAWSUIT
Hunter Biden’s laptop. The full story. | If You're Listening
- 00:00:02hello everyone my name is Abhishek and
- 00:00:04welcome back to my channel so today we
- 00:00:06are at day 38 of our complete devops
- 00:00:09course and in this class we will be
- 00:00:11learning about kubernetes Ingress so
- 00:00:14people find this concept slightly tricky
- 00:00:17or people find it slightly difficult
- 00:00:19because of two reasons one is they don't
- 00:00:21understand why Ingress is required right
- 00:00:24if you don't understand why Ingress is
- 00:00:25required then definitely you will find
- 00:00:27the topic complicated and the second
- 00:00:29thing is practical implementation so
- 00:00:32people try it on their mini Cube
- 00:00:34clusters or on their local kubernetes
- 00:00:35clusters and they will not succeed with
- 00:00:38the setup so that's one of the other
- 00:00:39reasons why people find it difficult
- 00:00:41I've also seen few videos and we also
- 00:00:44have created a end-to-end video on
- 00:00:46Ingress on our particular channel so
- 00:00:49I'll also share the link in the
- 00:00:50description so that you can follow the
- 00:00:52link where we have done end to end
- 00:00:54complete practical on how to set up
- 00:00:56Ingress and all of the things don't
- 00:00:57worry even in today's class I'm going to
- 00:00:59explain you both the theory
- 00:01:02and the Practical okay so even if you
- 00:01:05watch this video till the end you will
- 00:01:07get a very detailed understanding on why
- 00:01:09Ingress is required and how to
- 00:01:11practically install Ingress and try out
- 00:01:13the things so you know if you have
- 00:01:15followed our previous class on service
- 00:01:17Deep dive you know you'll be easily able
- 00:01:19to understand today's topic so if you
- 00:01:21haven't watched the video 37 that is on
- 00:01:24Deep dive of kubernetes services I'll
- 00:01:26highly recommend you to go and watch
- 00:01:28video number 37 on the complete devops
- 00:01:30course and only then come back so that
- 00:01:32you understand the concept of Ingress
- 00:01:33very well okay now without wasting any
- 00:01:36time because we have to cover a lot of
- 00:01:37things in this specific video let me
- 00:01:39jump onto the video okay so firstly what
- 00:01:42is ingress
- 00:01:46so you must be asking me that Abhishek
- 00:01:48in the last class we used kubernetes
- 00:01:50services
- 00:01:51and service was offering me a lot of
- 00:01:54good things right so I explained to that
- 00:01:56service was offering you service
- 00:01:58Discovery mechanism on kubernetes so it
- 00:02:00is solving this problem it was also
- 00:02:02doing a load balancing for you right
- 00:02:05services for doing the load balancing we
- 00:02:07have seen using the cube shark utility
- 00:02:08as well in the last video and it was
- 00:02:11also exposing the applications to
- 00:02:12external world then why you need a tool
- 00:02:16like Ingress or why you need a concept
- 00:02:17like Ingress and what problem is it
- 00:02:19solving so before 2015 uh December I
- 00:02:23guess or November so that was before
- 00:02:26kubernetes version release 1.1
- 00:02:29Ingress was not even there okay so
- 00:02:33people were using kubernetes without
- 00:02:35Ingress that was that means people were
- 00:02:38using kubernetes with just service
- 00:02:39concept okay and Ingress without Ingress
- 00:02:43so what they used to do was similarly uh
- 00:02:45like we were doing till the last class
- 00:02:47so people used to create a deployment
- 00:02:50which would create a pod right and
- 00:02:52additionally because you are creating a
- 00:02:54deployment you you will get Auto healing
- 00:02:57and auto scaling right these features
- 00:02:59and then you will create a service on
- 00:03:01top of it so that you can expose your
- 00:03:04application within your kubernetes
- 00:03:05cluster or outside the kubernetes
- 00:03:07cluster using the load balancer
- 00:03:10that is using the load balancer mode of
- 00:03:12your service but there are some
- 00:03:15practical problems which people realized
- 00:03:17after using kubernetes okay so once
- 00:03:19people started using kubernetes so
- 00:03:21obviously these users who migrated to
- 00:03:23kubernetes were migrating from the
- 00:03:25Legacy systems like like people used to
- 00:03:28have virtual machines or physical
- 00:03:30servers on top of that they used to
- 00:03:32install their applications okay and what
- 00:03:34people used to do was they used to use a
- 00:03:37load balancer
- 00:03:39so these load balancers were something
- 00:03:42like you know people used to use uh
- 00:03:45engine X
- 00:03:46engine X or you know people used to use
- 00:03:48fi load balancer or any other load
- 00:03:51balancers that they want to use on their
- 00:03:53virtual machines or physical servers
- 00:03:55okay and these are some Enterprise load
- 00:03:58balancers
- 00:03:59okay so what is enterprise load
- 00:04:01balancing so they offer very good load
- 00:04:04balance and capability load balancing
- 00:04:06capabilities like for example you can do
- 00:04:08ratio based load balancing that is you
- 00:04:11can say uh send three requests to pod
- 00:04:13number one seven request to pod number
- 00:04:15two you don't have pods in the virtual
- 00:04:17machines but just for your understanding
- 00:04:18I'm explaining you okay you can do ratio
- 00:04:20based you can do sticky sessions that
- 00:04:23means if one request is going to pod one
- 00:04:26then all the requests of that specific
- 00:04:28user have to go to pod one only okay so
- 00:04:31this is called sticky sessions they can
- 00:04:32use path based load balancing they can
- 00:04:35use domain or host based load balancing
- 00:04:38okay they support uh you know
- 00:04:40whitelisting that means only allow
- 00:04:43specific customers to access the
- 00:04:45application they can do blacklisting
- 00:04:48that means to say okay so these
- 00:04:50customers are like hackers do not allow
- 00:04:51any users coming from Pakistan for
- 00:04:53example or do not allow any users coming
- 00:04:56from USA do not allow any users coming
- 00:04:58from Russia so you can Define your
- 00:05:00traffic and you can say that okay so
- 00:05:03this is the concept or these are the
- 00:05:05capabilities that Enterprise load
- 00:05:07balancers support
- 00:05:09now the problem was when these people
- 00:05:12who were doing this virtual machines and
- 00:05:14applications when they migrated from
- 00:05:16this to kubernetes okay so initially
- 00:05:19they were very happy that kubernetes was
- 00:05:22offering you Auto healing Auto scaling
- 00:05:24automatic service Discovery uh exposing
- 00:05:27the applications to external world so
- 00:05:28you know people used to create the same
- 00:05:30things that we we did like you know they
- 00:05:32used to create a deployment after the
- 00:05:34deployment they used to create a service
- 00:05:36right and using the services they used
- 00:05:40to get all the features that are
- 00:05:41available and using the deployment they
- 00:05:43used to get the healing and scaling
- 00:05:45capabilities but off late they realized
- 00:05:47that okay service was providing load
- 00:05:49balancing mechanism but the load
- 00:05:51balancing mechanism the service was
- 00:05:53providing is a simple
- 00:05:55round
- 00:05:57Robin load balancing what is round robin
- 00:06:00if you are doing 10 requests what this
- 00:06:02specific uh service using Q proxy right
- 00:06:05Cube proxy is updating your IP table
- 00:06:07rules what it does is it will send file
- 00:06:09requests to pod number one and it will
- 00:06:10send five requests to pod number two
- 00:06:12let's assume there are two pods but this
- 00:06:15is a very simple load balancing because
- 00:06:17people were coming from uh virtual
- 00:06:19machines and they used to get all of
- 00:06:21these features against what they are
- 00:06:23getting in kubernetes is a very simple
- 00:06:24round robin they are not getting all of
- 00:06:26these features and these are only list
- 00:06:28of features I gave you the commercial or
- 00:06:30the Enterprise load balancers they can
- 00:06:33offer hundreds of features okay so you
- 00:06:35can simply read and you will see that
- 00:06:37you can do a web application firewall
- 00:06:39you can do uh you know a lot of
- 00:06:42configurations like TLS you can add more
- 00:06:45security using TLS so these load
- 00:06:47balancers offers all of these features
- 00:06:49okay so I within uh during this video
- 00:06:52itself I have listed 10 close to 10
- 00:06:54features which kubernetes was not
- 00:06:56supporting so these people were unhappy
- 00:06:59with kubernetes okay so they said that
- 00:07:01okay a service was doing few things but
- 00:07:03still we are not happy and the other
- 00:07:05thing that they have noticed this is
- 00:07:07problem number one and the problem
- 00:07:08number two is uh you can expose your
- 00:07:11applications to external World using
- 00:07:13load balancer mode service right you can
- 00:07:16create your service as load balancer
- 00:07:18mode
- 00:07:19but what is the problem is every time
- 00:07:22like let's say you have 100 Services if
- 00:07:25you take companies like Amazon they have
- 00:07:27some thousands of services okay so for
- 00:07:30each of the service when they create the
- 00:07:32service as type load balancer mode
- 00:07:35you know the cloud provider was charging
- 00:07:37them for each and every IP address
- 00:07:40because these are Dynamic and public IP
- 00:07:43address sorry sorry these are static
- 00:07:47public IP address so they don't charge
- 00:07:49for the dynamic IP address but whenever
- 00:07:50the IP address becomes static so for
- 00:07:53static load balancing IP addresses and
- 00:07:55static public load balancing IP address
- 00:07:57so if there are thousands of micro
- 00:07:59services or if there are thousands of
- 00:08:01services that you require for your
- 00:08:03applications on kubernetes so cloud
- 00:08:05provider was charging very heavy
- 00:08:09and Cloud providers are right in their
- 00:08:11terms because you are asking them for a
- 00:08:14static load balancing IP address and
- 00:08:15they are charging you for money okay so
- 00:08:18this is another problem that these these
- 00:08:20people were facing in the previous
- 00:08:22example okay what they used to do is
- 00:08:24because there was only one load balancer
- 00:08:27okay in the contrary you have for each
- 00:08:29application you have one service right
- 00:08:31but on the physical or virtual virtual
- 00:08:33servers people used to create one load
- 00:08:35balancer whether you have one
- 00:08:37application two application three
- 00:08:38applications so they used to configure
- 00:08:40in their load balancer like okay if the
- 00:08:42request is coming to amazon.com
- 00:08:46slash
- 00:08:47ABC send request to app one if it is
- 00:08:51coming to slash XYZ go to app2 and they
- 00:08:54used to only expose this application uh
- 00:08:56sorry they only used to expose these
- 00:08:58load balancer with static public IP
- 00:09:00address
- 00:09:03so what is happening is here they just
- 00:09:05have one IP address which they are
- 00:09:07getting from the cloud provider or even
- 00:09:09within their organization they are only
- 00:09:11exposing one specific IP address whereas
- 00:09:14here what is happening is you are
- 00:09:16exposing thousands of IP address and you
- 00:09:18are getting charged so this is problem
- 00:09:20number two so let us write the two
- 00:09:22problems so that it is very clear to you
- 00:09:24before I jump on to Ingress and how
- 00:09:25Ingress is solving this problem what is
- 00:09:28the problem number one
- 00:09:29okay so the problem number one that we
- 00:09:33discussed is
- 00:09:35Enterprise
- 00:09:39and
- 00:09:41TLS that is secure load balancing
- 00:09:44capabilities
- 00:09:45so if you are using a service this thing
- 00:09:48is missing people who are coming from
- 00:09:50the virtual machines they had very good
- 00:09:53load balancing capabilities like one two
- 00:09:55three four five that I discussed in the
- 00:09:57previous slide like for example I can
- 00:09:59give you a basic example like it is
- 00:10:01missing sticky sessions then it is
- 00:10:03missing uh TLS based load balancing that
- 00:10:05is secure load balancing https based
- 00:10:07load balancing then the other thing it
- 00:10:09is missing was uh some uh a path based
- 00:10:13load balancing like I just told you host
- 00:10:15based load balancing or domain-based
- 00:10:17load balancing so if request is going to
- 00:10:19amazon.com go to this specific
- 00:10:20application if the request is going to
- 00:10:22amazon.in go to other applications so
- 00:10:24that is host based load balancing and
- 00:10:26then there are many other things like uh
- 00:10:28like I told you ratio based load
- 00:10:30balancing
- 00:10:31so I can write this list to 15 to 20
- 00:10:34different things on top of my head but
- 00:10:37you know it will only waste our time so
- 00:10:39what what is the thing is the services
- 00:10:42in kubernetes was not offering all of
- 00:10:44this Enterprise level capabilities and
- 00:10:46the second point is
- 00:10:49I just told you that if you are creating
- 00:10:51a service of type load balancer
- 00:10:55then for each service kubernetes will
- 00:10:58charge you kubernetes will not charge
- 00:11:00you the cloud provider will actually
- 00:11:01charge you right so the cloud provider
- 00:11:03will charge you this is a very important
- 00:11:05interview question as well people will
- 00:11:07ask you what is the difference between
- 00:11:08load balancer type service and the uh
- 00:11:12traditional
- 00:11:13kubernetes Ingress okay so what you will
- 00:11:16answer is the load balancing type
- 00:11:18service was good but it was missing all
- 00:11:20of these capabilities and also you will
- 00:11:22say that the cloud provider will charge
- 00:11:24you for each and every load balancer
- 00:11:27service type like if there are thousands
- 00:11:29of services you will be getting charged
- 00:11:31for thousands of load balancer static
- 00:11:33public IP addresses okay so these are
- 00:11:35the two problems and these two problems
- 00:11:37you have to remember and it they have to
- 00:11:39be on top of your head because this is
- 00:11:41very important interview Point okay so
- 00:11:44people will definitely ask you in your
- 00:11:46uh interviews that what is ingress or
- 00:11:48why Ingress has to be created what is
- 00:11:50difference between load balancer service
- 00:11:52type and Ingress so these questions will
- 00:11:54keep coming so definitely you have to
- 00:11:56remember those two points and now how
- 00:11:59Ingress is solving those problem okay so
- 00:12:01what now kubernetes said is
- 00:12:03so kubernetes also admitted the problem
- 00:12:05so kubernetes said that yeah we
- 00:12:07understand and till that point what
- 00:12:09happened was open shift open shift which
- 00:12:12is red hat openshift which is again a
- 00:12:14kubernetes distribution they have
- 00:12:16implemented something called as
- 00:12:17openshift routes which is very similar
- 00:12:19to kubernetes Ingress so kubernetes has
- 00:12:22understood that okay openshift has also
- 00:12:23implemented something to solve the
- 00:12:25problem and even many users are
- 00:12:27requesting us saying that okay so this
- 00:12:29is a very valid problem when we were on
- 00:12:31Virtual machines this is VM and this is
- 00:12:33kubernetes
- 00:12:34okay so these customers kept on
- 00:12:37complaining on kubernetes GitHub page
- 00:12:39that when we were on Virtual machines we
- 00:12:41were enjoying all the good capabilities
- 00:12:43of load balancers
- 00:12:45okay and because of which our
- 00:12:48applications were very secure because of
- 00:12:50which you know we had reduced cost but
- 00:12:53once we moved to kubernetes we realized
- 00:12:55that this is a very big problem
- 00:12:58so kubernetes people have also agreed to
- 00:13:00it and what people at kubernetes said is
- 00:13:03okay we will Implement something called
- 00:13:05Ingress
- 00:13:07okay so we will allow the users of
- 00:13:11kubernetes to create a resource called
- 00:13:14Ingress and what you people have to do
- 00:13:16who are these people like nginx
- 00:13:20F5
- 00:13:22ambassador okay traffic
- 00:13:28uh what are the other things like okay
- 00:13:31there are bunch of h a proxy so
- 00:13:34these were the top load balancers that
- 00:13:37people were using uh here on the virtual
- 00:13:39machines I don't think Ambassador was
- 00:13:41there till now but okay that doesn't
- 00:13:42matter so people were using these uh top
- 00:13:45load balancers and what kubernetes said
- 00:13:47is okay I cannot Implement for each and
- 00:13:49every load balancer so what I'll do is I
- 00:13:52will tell my users to create something
- 00:13:54called as a Ingress resource okay so as
- 00:13:56a kubernetes user you will create a user
- 00:13:59sorry you will create a resource called
- 00:14:01Ingress resource and now all of these
- 00:14:06load balancers okay so all of these
- 00:14:08companies what they will do is
- 00:14:10kubernetes set them that you create
- 00:14:12something called as Ingress controller
- 00:14:15now what is this Ingress controller okay
- 00:14:18so on a high level if you are creating
- 00:14:20Ingress resource on your kubernetes
- 00:14:22cluster and if you are saying that I
- 00:14:24need a path based routing for example
- 00:14:26okay so you realize that you are missing
- 00:14:29the path based routing on kubernetes
- 00:14:31which you are very heavily using on your
- 00:14:32virtual machines so you can come to your
- 00:14:34kubernetes cluster create a Ingress
- 00:14:36resource I'll show you the example don't
- 00:14:38worry and you can say that okay I want
- 00:14:40to create path based routing so you can
- 00:14:42kubernetes at that okay create one yaml
- 00:14:44file and inside the DML file say that
- 00:14:47you know I want Pathways routing so you
- 00:14:49said the same thing but who will
- 00:14:51implement this okay so who will decide
- 00:14:54that which load balancer you want to use
- 00:14:57so there are hundreds of load balancers
- 00:14:59in the market so what kubernetes said is
- 00:15:01okay we cannot support all of you uh you
- 00:15:03know we cannot create the logic for all
- 00:15:05of you in the kubernetes master or the
- 00:15:07API server instead you people create
- 00:15:09something called as Ingress controller
- 00:15:10okay what does English controller mean
- 00:15:13so let's say that you want to create uh
- 00:15:16this specific capability using nginx
- 00:15:18load balancer so the nginx company will
- 00:15:21write a nginx Ingress controller and as
- 00:15:23kubernetes users on this kubernetes
- 00:15:26cluster you will deploy the Ingress
- 00:15:28controller okay you can deploy that
- 00:15:30using Helm charts you can deploy that
- 00:15:32using yaml manifest okay and once you
- 00:15:35deploy the developer or again the devops
- 00:15:38engineers they will create the Ingress
- 00:15:40ml service yaml resource for their
- 00:15:42kubernetes services okay so this Ingress
- 00:15:46controller will watch for the Ingress
- 00:15:47resource and it will provide you the
- 00:15:49path based routing okay so if it is
- 00:15:52complicated don't worry I'm explaining
- 00:15:54again okay so for example let's say this
- 00:15:57is your kubernetes cluster
- 00:16:00what you are doing is you are creating a
- 00:16:01pod for example okay so you are writing
- 00:16:04a yaml manifest for this and you have
- 00:16:06created a part now what will happen like
- 00:16:09I told you there is a component called
- 00:16:10cubelet
- 00:16:12this cubelet will deploy your pod onto
- 00:16:15one of the worker nodes so cubelet will
- 00:16:17also sit on the worker node and API
- 00:16:19server will notify cubelet using
- 00:16:21scheduler that okay a pod is created and
- 00:16:23cubelet will deploy the pod
- 00:16:26right and similarly let's say you are
- 00:16:29creating
- 00:16:31a service yaml manifest okay so there is
- 00:16:34Q proxy
- 00:16:36and this Q proxy will what it will do
- 00:16:39this Q proxy will update the IP table
- 00:16:41rules so for every resource that you are
- 00:16:44creating in kubernetes there is a
- 00:16:46component which is watching for that
- 00:16:48resource and it is performing the
- 00:16:49required action okay so similarly even
- 00:16:53if you are creating Ingress in
- 00:16:54kubernetes let's say you are creating
- 00:16:56Ingress
- 00:16:58so there has to be a resource
- 00:17:02or component or a controller
- 00:17:05which has to watch for this Ingress
- 00:17:07right so this was the problem so
- 00:17:09kubernetes said that okay I can create
- 00:17:12Ingress resource but if I have to
- 00:17:14implement Logic for all the load
- 00:17:16balancers that are available in the
- 00:17:17market that is nginx F5 traffic
- 00:17:20Ambassador HF proxy so kubernetes said
- 00:17:24that okay it is technically impossible I
- 00:17:26cannot do it so what I'll do is I'll
- 00:17:28come up with the architecture and the
- 00:17:30architecture is user
- 00:17:33will create Ingress resource
- 00:17:37okay
- 00:17:39load balancing companies
- 00:17:43like nginx
- 00:17:46F5 or any other load balancing companies
- 00:17:48they will write their own Ingress
- 00:17:51controllers
- 00:17:54and they will place these Ingress
- 00:17:55controllers on GitHub and they will
- 00:17:58provide the steps on how to install this
- 00:18:00Ingress controllers using Helm charts or
- 00:18:02any other ways and as a user instead of
- 00:18:06just creating Ingress resource you also
- 00:18:09have to deploy Ingress controller okay
- 00:18:12so it is up to the organization to
- 00:18:16choose which Ingress controller they
- 00:18:18want to use what is ingress control at
- 00:18:20the end of the day it is just a load
- 00:18:21balancer
- 00:18:23right sometimes it can be a load
- 00:18:26balancer plus API Gateway as well API
- 00:18:28Gateway offers you some additional
- 00:18:29capabilities okay
- 00:18:31so end of the day what you need to do as
- 00:18:35a user is on your kubernetes cluster the
- 00:18:38prerequisite is deploy a Ingress
- 00:18:40controller which Ingress controller you
- 00:18:42will deploy let's say in your virtual
- 00:18:44machines world before you move to
- 00:18:46kubernetes if you are using nginx
- 00:18:49so you will go to nginx GitHub page and
- 00:18:52you will deploy the nginx Ingress
- 00:18:54controller onto the kubernetes cluster
- 00:18:56after that you will create Ingress
- 00:18:58resource depending upon the capabilities
- 00:19:00that you need okay if you need path
- 00:19:02based routing you will create one type
- 00:19:05of Ingress if you need TLS based Ingress
- 00:19:07you will create one type of Ingress if
- 00:19:10you need host base you will create one
- 00:19:11type of Ingress so this is one time
- 00:19:13activity the one time activity for the
- 00:19:15devops engineers is to decide which
- 00:19:17Ingress controller they want what what
- 00:19:19is ingress controller to decide which
- 00:19:21load balancer they want okay it can be
- 00:19:23nginx it can be a file and they will go
- 00:19:26to their organizational GitHub page they
- 00:19:28will find the steps on how to deploy
- 00:19:30this and once they realize how to deploy
- 00:19:32they will after that it can be one
- 00:19:35service two service 100 Services they
- 00:19:37will only write the Ingress resource
- 00:19:39once they write the Ingress resource
- 00:19:41like you know Ingress does not have to
- 00:19:43be one-to-one mapping okay you can
- 00:19:45create one Ingress and you know you can
- 00:19:48handle 100 of services as well using
- 00:19:50paths you can say if path is a go to
- 00:19:53service one if path is B go to service
- 00:19:54two I'll show you that don't worry about
- 00:19:56it but you understood the topic here
- 00:19:59right what was the problem why Ingress
- 00:20:01was introduced what is ingress
- 00:20:03controller you understood all of these
- 00:20:04things so once you understand this
- 00:20:06concept it is very easy for you okay so
- 00:20:09the major thing that you have to
- 00:20:10understand is the problem number one
- 00:20:12that Ingress is solving that is the
- 00:20:15kubernetes services did not have
- 00:20:17Enterprise level load balancing
- 00:20:20capabilities and which is very very
- 00:20:21important you will say that move to
- 00:20:23kubernetes because containers are very
- 00:20:25lightweight because all of blah blah
- 00:20:27blah blah blah but without security
- 00:20:32without good load balancing capabilities
- 00:20:35nobody will move to kubernetes and
- 00:20:37kubernetes has realized that so that's
- 00:20:39why they have introduced Ingress and the
- 00:20:41problem number two was if you are
- 00:20:43creating a service of type load balancer
- 00:20:46mode
- 00:20:47Cloud providers were charging you for
- 00:20:49each and every IP address okay so these
- 00:20:51were the two problems that Ingress was
- 00:20:52solved you understood this thing and the
- 00:20:54next thing that you need to understand
- 00:20:55after this is okay how to install
- 00:20:58Ingress like if you just followed the uh
- 00:21:03document till here or the presentation
- 00:21:04tool here and to you will go to your
- 00:21:06kubernetes cluster you will find one
- 00:21:08Ingress example for the yaml file and
- 00:21:11you will just create a Ingress resource
- 00:21:13what will happen nothing will happen
- 00:21:15because you don't have Ingress
- 00:21:16controller on your cluster okay so if
- 00:21:19the Ingress controller is missing
- 00:21:22then you might create one Ingress two
- 00:21:25Ingress hundred Ingress nothing will
- 00:21:27happen because the Ingress is of no use
- 00:21:29without Ingress controller and what is
- 00:21:31ingress controller Ingress controller is
- 00:21:33a load balancer that you can choose from
- 00:21:35the requirement okay if you want engine
- 00:21:38mixing nginx load balancer you can
- 00:21:39create nginx Ingress controller if you
- 00:21:41want fi uh or big-ip load balancer you
- 00:21:45can choose fi Ingress controller if you
- 00:21:47want uh HF proxy then you can create h a
- 00:21:50proxy Ingress controller okay once you
- 00:21:52create this Ingress controllers once the
- 00:21:54Ingress resource is created on the
- 00:21:56cluster they will watch for the Ingress
- 00:21:57resource and they will what they will do
- 00:22:00is basically they will provide you the
- 00:22:02required capability if you require path
- 00:22:04based load balancing they will help you
- 00:22:05with path based load balancing if you
- 00:22:07require host base it will help you with
- 00:22:09host place so this is the theory part I
- 00:22:11hope the thing is clear till here if it
- 00:22:13is not clear you have to watch the video
- 00:22:15one more time before we jump onto the
- 00:22:16Practical because theory is very very
- 00:22:18important and your interview questions
- 00:22:20will be on Theory
- 00:22:21perfect so now let me stop sharing here
- 00:22:24and let me jump on to my other screen
- 00:22:27and show you how to install and how to
- 00:22:29configure
- 00:22:31okay so let me get my terminal
- 00:22:35let me start sharing the screen
- 00:22:40perfect so this is my screen and in the
- 00:22:42last class we learned to tell Services
- 00:22:44okay so what I'll do is let me check if
- 00:22:47I have the same state if I do Cube CTL
- 00:22:50get pods uh yeah I have this deployments
- 00:22:53that we create these pods that we
- 00:22:54created in the last class and if I do
- 00:22:56Cube CTL get service as well perfect the
- 00:22:59service is also available so this is the
- 00:23:00service and if you have followed my last
- 00:23:03class I showed you how to create
- 00:23:05deployment.yaml and how to create
- 00:23:06service.aml as well and many people have
- 00:23:08tried it I watched in the comment
- 00:23:10section so really appreciate you people
- 00:23:11for doing it perfect so now let us see
- 00:23:15if I can access the service on the first
- 00:23:17fall okay so I created this service as
- 00:23:19node Port service and this is the port
- 00:23:21so what I'll do is firstly I'll get the
- 00:23:24mini Cube IP address so this is the mini
- 00:23:26Cube IP address so I can just use the
- 00:23:28curl command
- 00:23:30perfect so I am getting the output learn
- 00:23:32devops with some strong foundational
- 00:23:34knowledge
- 00:23:36great so we are able to verify that our
- 00:23:40service is running our service is
- 00:23:43watching the pods and the application is
- 00:23:45running now let me create a Ingress
- 00:23:48resource for this and what we will do
- 00:23:50with Ingress is we will set up a host
- 00:23:53based load balancing okay so what is
- 00:23:55host based load balancing
- 00:23:57like I told you uh host based load
- 00:24:01balancing is nothing but we can say that
- 00:24:03okay in the previous example we try to
- 00:24:06access using a curl Command right so
- 00:24:08instead of this curl command I can say
- 00:24:10that allow users when they try to reach
- 00:24:13my uh specific service on example.com
- 00:24:16okay or you can say hello if they try to
- 00:24:18reach on example.com ABC okay so let us
- 00:24:23try to see how to create this so again
- 00:24:25there is no rocket science what I'll do
- 00:24:27is I'll simply go to the kubernetes
- 00:24:28official documentation so uh I'll just
- 00:24:31say kubernetes Ingress
- 00:24:36perfect so this is the official page for
- 00:24:38kubernetes Ingress and what I'll do is
- 00:24:40I'll just go here okay see the example
- 00:24:43also here what these people are saying
- 00:24:45is there is ingress managed load
- 00:24:47balancer that is ingress controller okay
- 00:24:49so you create an Ingress resource and
- 00:24:52using this Ingress controller you know
- 00:24:54you can Define how to route the traffic
- 00:24:56for your applications or how to route
- 00:24:59the traffic for your pods I'll also
- 00:25:01paste the link in the description of the
- 00:25:03previous video I I think I did the two
- 00:25:05to three months back that is a very very
- 00:25:07informative video because we spent
- 00:25:09almost more than one hour explaining you
- 00:25:11different types of Ingress resources how
- 00:25:14to create them how to create a path
- 00:25:16based load balancing how to do uh you
- 00:25:19know SSL offloading how to do pass
- 00:25:21through so lot of things in very detail
- 00:25:23after watching this video if you have
- 00:25:24time definitely watch that video as well
- 00:25:26okay
- 00:25:28perfect so here I'll just copy this
- 00:25:31example instead of this let me go for
- 00:25:33host okay so this is an example which
- 00:25:35has host go through all the examples uh
- 00:25:38you can just follow the documentation
- 00:25:40and you can go through all the examples
- 00:25:42as well so I will do Ingress Dot yaml
- 00:25:46okay and what I will do is I'll just
- 00:25:49modify these fields so instead of
- 00:25:51Ingress wildcard host I'll just say
- 00:25:54Ingress example
- 00:25:58so let let us keep the same food.bar.com
- 00:26:01no problem with it right instead of
- 00:26:03example.com let us just keep it as
- 00:26:05food.bar.com and now I'll say if anybody
- 00:26:08wants to reach my application my service
- 00:26:10okay so if they hit on food.word.com
- 00:26:14slash bar okay so they should reach the
- 00:26:17service one and they should you know
- 00:26:20typically you have to provide what is
- 00:26:22your service name and what is your
- 00:26:23service port so let us see what is my
- 00:26:26service name Cube CTL
- 00:26:28get SVC so this is my service name right
- 00:26:32so let me go to my Ingress yaml and let
- 00:26:36me just replace the service name my port
- 00:26:38number is 18 so I don't have any problem
- 00:26:40there
- 00:26:41perfect so now let us deploy this file
- 00:26:45Cube CDL apply minus F Ingress dot ml
- 00:26:49and let me see if something is happening
- 00:26:51okay so the Ingress is created if I do
- 00:26:54Cube CTL get Ingress you will notice
- 00:26:56that the Ingress is created but the
- 00:26:59address field is empty and you will see
- 00:27:01that nothing will happen like even if I
- 00:27:03try to replace this curl command and
- 00:27:05instead of this what I'll do is I'll
- 00:27:07just say
- 00:27:09food.bar.com
- 00:27:12so this is domain based routing okay so
- 00:27:15what we are achieving here is domain
- 00:27:16based routing and I will say
- 00:27:18food.bar.com
- 00:27:20for example what was the path that we
- 00:27:23have provided slash bar okay and if I
- 00:27:26try to hit nothing will happen here okay
- 00:27:28so the reason here nothing is happening
- 00:27:30is because you haven't created Ingress
- 00:27:33controller right so only if you create
- 00:27:36the Ingress controller then your uh this
- 00:27:40thing will start working right the
- 00:27:42Ingress should be read by Ingress
- 00:27:43controller so what we need to do is
- 00:27:45firstly install the Ingress controller
- 00:27:47so let me install nginx Ingress
- 00:27:50controller because nginx is a quite
- 00:27:52popular one so again I'll just follow
- 00:27:54the kubernetes documentation and say
- 00:27:55kubernetes Ingress install and this is
- 00:27:59the example documentation where I can
- 00:28:02search for Ingress controller here there
- 00:28:04are bunch of Ingress controllers that
- 00:28:06kubernetes supports like I explained you
- 00:28:08uh there is nothing like kubernetes
- 00:28:10supports actually as load balancing
- 00:28:12company is they can create the Ingress
- 00:28:14controllers okay so all of these
- 00:28:16companies have implemented their Ingress
- 00:28:17controllers like nginx has their own you
- 00:28:20know Ingress controller ha proxy as
- 00:28:21their own fi has their own okay so
- 00:28:24Apache has their own Ingress controller
- 00:28:25like you can also create your own
- 00:28:27Ingress controller if you have a load
- 00:28:28balancer
- 00:28:29perfect so let us see nginx Ingress
- 00:28:32controller because it's a very
- 00:28:33lightweight and simple Ingress
- 00:28:35controller let us see how to install
- 00:28:37so if you are trying to install on
- 00:28:40minicube like they provide you some very
- 00:28:42easy steps uh where is this
- 00:28:51nginx Ingress controller works with
- 00:28:53kubernetes perfect
- 00:28:55so you can just say try nginx Ingress
- 00:28:57controller okay here the steps are not
- 00:28:59good I can just say kubernetes
- 00:29:04nginx
- 00:29:06Ingress controller
- 00:29:08mini Cube because I am installing on
- 00:29:11minicube so you know there is a very
- 00:29:13good documentation straight forward like
- 00:29:15you can use this same example that I'm
- 00:29:17showing you just search for kubernetes
- 00:29:19engine X Ingress controller mini Cube
- 00:29:21and this is one simple command that will
- 00:29:23install nginx Ingress controller on your
- 00:29:26minicube cluster so all that you need to
- 00:29:28do is mini Cube enable add-ons sorry
- 00:29:32add-ons enable Ingress and that will
- 00:29:34create a Ingress controller for you
- 00:29:36right so it's a very simple step that
- 00:29:39you have to do uh additionally like if
- 00:29:41you want to know how to deploy Ingress
- 00:29:43controller for your production like you
- 00:29:46know in production you will not use mini
- 00:29:47Cube probably you are using uh eks
- 00:29:50clusters or openshift or some some
- 00:29:52things right so in such gate go back to
- 00:29:54the documentation that I showed you just
- 00:29:56search for kubernetes Ingress okay go
- 00:29:59back here and choose which Ingress
- 00:30:01controller you want let us say that you
- 00:30:03are doing this in your organization so
- 00:30:05the steps you will follow is go to this
- 00:30:07Ingress controller and let's say you are
- 00:30:08using same engine Ingress controller
- 00:30:10okay instead of choosing the page this
- 00:30:13page where you will only be able to
- 00:30:15install for mini Cube okay go back here
- 00:30:18and in the documentation what you need
- 00:30:20to do so these are individual
- 00:30:22documentations right for every Ingress
- 00:30:24controller you have their own
- 00:30:25documentation so you can come here and
- 00:30:28you can provide you can look for the
- 00:30:29steps to install uh where is this
- 00:30:35uh installation steps
- 00:30:40let us search for install directly
- 00:30:48okay let us choose a different Ingress
- 00:30:50controller I think they have complicated
- 00:30:52the steps here let me just search for
- 00:30:54Ambassador okay so I took this randomly
- 00:30:57and here once you click on a quick start
- 00:31:05so again this is asking for some okay
- 00:31:07don't worry uh so they are just asking
- 00:31:10for all the sign up and all the things
- 00:31:12but uh you can just search for their uh
- 00:31:15official product documentation and say
- 00:31:17for example Ambassador ambassador
- 00:31:20Ingress
- 00:31:21controller installation okay so just
- 00:31:24search in Google like this and you will
- 00:31:26directly find the steps for installing
- 00:31:28Ambassador uh Ingress controller or you
- 00:31:30know anything that is required for your
- 00:31:32organization so if you are doing on Mini
- 00:31:34Cube you don't have to worry about
- 00:31:35anything like you know this is the
- 00:31:37official documentation for Ambassador
- 00:31:38installing uh Ambassador Ingress
- 00:31:41controller okay so you have the direct
- 00:31:43steps here install with Helm install
- 00:31:45with Cube City ml so on your production
- 00:31:47cluster you can choose probably Helm so
- 00:31:50click on the helm instructions and you
- 00:31:51can install them using these specific
- 00:31:53commands but for mini Cube like I told
- 00:31:56you we just have to do mini Cube add-ons
- 00:31:58enable Ingress and it will install the
- 00:32:00Ingress controller for us so let us see
- 00:32:02if the Ingress controller is installed
- 00:32:04or not end of the day English controller
- 00:32:06is also a pod so Cube CDL get pods minus
- 00:32:10a because I am not sure in which
- 00:32:12namespaces that is installed and just
- 00:32:14say nginx
- 00:32:16so see here so nginx Ingress controller
- 00:32:19is up and running and in which namespace
- 00:32:21it has created its own namespace coil
- 00:32:24Ingress nginx okay and let us try to see
- 00:32:27the logs and let us see if it has
- 00:32:29identified the Ingress resource that we
- 00:32:31have created Cube CTL logs minus n
- 00:32:34uh what was the namespace Ingress hyphen
- 00:32:37engine X okay so click on enter and it
- 00:32:41should identify the Ingress resource
- 00:32:42that we have created so what was the
- 00:32:44Ingress resource that we have created
- 00:32:46see here Ingress example we have created
- 00:32:49in the default namespace and the name
- 00:32:51was Ingress example okay so it said that
- 00:32:54it has identified that we have created
- 00:32:56Ingress resource and it has successfully
- 00:32:58synced as well so what does it mean like
- 00:33:00it synced so it will go to the nginx
- 00:33:03load balancer configuration that is
- 00:33:05nginx.com file okay and it will update
- 00:33:09some Ingress related configuration for
- 00:33:12our load balancer related configuration
- 00:33:13for the English resource that we created
- 00:33:15and you don't have to go into these
- 00:33:17details at this point of time so with
- 00:33:19using the Ingress controllers you will
- 00:33:21understand like you know don't learn
- 00:33:22everything on day one eventually you
- 00:33:24will understand what is happening under
- 00:33:25the hood but as I showed you in the Pod
- 00:33:28logs it has unidentified that you know
- 00:33:30Abhishek has created an Ingress called
- 00:33:33example Ingress or Ingress example in
- 00:33:36the default namespace right this is a
- 00:33:38default namespace and it said that the
- 00:33:40configuration is synced okay for example
- 00:33:42tomorrow you are getting any error what
- 00:33:44you need to do is you have to go back
- 00:33:45and see in the pod.logs and now if you
- 00:33:48notice this address field was not there
- 00:33:51previously but it is updated now okay so
- 00:33:53if I can show you that I don't know if
- 00:33:55my terminal okay so the logs are deleted
- 00:33:58but address field was not there
- 00:34:00previously but after creating the
- 00:34:02Ingress controller this address field is
- 00:34:04populated that means to say nerve I can
- 00:34:07access says you know I can use the
- 00:34:11Ingress resource on food.bar.com
- 00:34:15what was the Ingress resource that we
- 00:34:17have created this Ingress example now
- 00:34:19can be accessed on food.bar.com bar the
- 00:34:24reason why I can access is because I
- 00:34:26have used the Ingress controller right
- 00:34:29and the Ingress controller has updated
- 00:34:31the configuration so in your production
- 00:34:34environment this is enough but if you
- 00:34:36are trying on your local kubernetes
- 00:34:38cluster you have to do one more
- 00:34:40configuration that is you have to update
- 00:34:43the slash Etc host configuration okay
- 00:34:46you have to update this file why you
- 00:34:49need to update this file and why you
- 00:34:51don't need to update this in production
- 00:34:52is because because you are doing on
- 00:34:54local and you have not done this domain
- 00:34:56mapping so this food.bar.com has to be
- 00:34:59mapped with the domain or IP address
- 00:35:01that is 192. 168 64.11 so this is my
- 00:35:05mini Cube or you know this is my Ingress
- 00:35:07IP address not mini Cube this is my
- 00:35:09Ingress IP address so whenever I try to
- 00:35:11say food.bot.com like if you ping and
- 00:35:14say food.bar.com this IP address does
- 00:35:16not exist right this domain does not
- 00:35:18exist in your real-time production
- 00:35:20environment for example for people at
- 00:35:23Amazon they might be using amazon.com
- 00:35:24and amazon.com is a real domain which
- 00:35:27does exist so in their Ingress resource
- 00:35:29what they will do is they will simply
- 00:35:31mention here as amazon.com but because
- 00:35:34we have not a company and we are just
- 00:35:36doing a domain uh sorry demo video so I
- 00:35:38cannot go to GoDaddy and purchase a
- 00:35:40domain right so that's why I simply said
- 00:35:41food.bar.com but what you can do is you
- 00:35:45can mock this Behavior or you know you
- 00:35:47can create a dummy Behavior here like
- 00:35:49you can confuse your uh laptop or you
- 00:35:52can you know you can update the ETC host
- 00:35:55file like sudo
- 00:36:00update this host file and tell the host
- 00:36:02file that let's just provide the
- 00:36:05password
- 00:36:06so you can just tell it right I know
- 00:36:09this IP address called
- 00:36:11what was the IP address
- 00:36:13uh uh
- 00:36:15sorry I have to go back so you can tell
- 00:36:19them that okay if somebody is trying to
- 00:36:22reach food or bar.com okay you can tell
- 00:36:25them that I know this domain called
- 00:36:27fuba.bar.com and just provide this IP
- 00:36:30address and tell them that or tell the
- 00:36:32machine that
- 00:36:34foo.bar.com okay so this IP address
- 00:36:38sorry this domain will be resolved on
- 00:36:40this specific IP address okay so now if
- 00:36:43you try to access food.bar.com it will
- 00:36:45try to reach
- 00:36:47192.168.64.11 so this way you can mimic
- 00:36:50the behavior or mock the behavior but
- 00:36:52this is not production use case in
- 00:36:53production you don't have to do all of
- 00:36:55these things you can simply ask your
- 00:36:56manager or you can simply ask your
- 00:36:58company what is the domain that we use
- 00:36:59and you can provide the domain name now
- 00:37:01if I try to Pink food.bar.com
- 00:37:05okay so you will notice that okay so the
- 00:37:08request is not reaching yet but in some
- 00:37:10time you will notice that the request
- 00:37:12will reach onto food.bar.com okay so did
- 00:37:16I do any mistake here no there is no
- 00:37:18mistake so okay uh there are some
- 00:37:20previous entries I have to delete this
- 00:37:21entries okay uh
- 00:37:24right perfect so in some time what you
- 00:37:27will notice is when somebody tries to
- 00:37:29reach on the specific food.bar.com you
- 00:37:32can tell through your curl request or
- 00:37:34you can tell through uh you know slash
- 00:37:37Etc host even if you don't want to
- 00:37:38update the ctcos you can also tell that
- 00:37:41in your curl command that okay I know
- 00:37:43what is uh food.bar.com you can resolve
- 00:37:46if somebody tries to access food or
- 00:37:47bar.com just resolve this on IP address
- 00:37:50192 168 64.11.
- 00:37:52okay so now what will happen after some
- 00:37:55time is you will be able to reach the
- 00:37:56application uh just replace the curl
- 00:37:59command with uber.paul.com and your
- 00:38:01application will be reached now okay I
- 00:38:04can go into that practicals but before
- 00:38:06that you need to understand that go
- 00:38:08through this document where you will
- 00:38:10find multiple other things like this was
- 00:38:12just example of uh host and Pathways
- 00:38:15routing right similarly you can do TLS
- 00:38:18based routing so what is TLS just search
- 00:38:20for TLS here and you will see that you
- 00:38:23can create uh secure kubernetes
- 00:38:25ingresses as well that means to say
- 00:38:28that you know uh this Ingress resource
- 00:38:30that I have created anybody can accept
- 00:38:32access access on the HTTP request but in
- 00:38:35production real-time use cases for
- 00:38:37example you are accessing google.com you
- 00:38:39will access on https so these all things
- 00:38:41can also be done using Ingress and if
- 00:38:44you want to do this if you want to try
- 00:38:45the Practical okay you can follow the
- 00:38:48video that I am pasting in the
- 00:38:49description okay it has everything like
- 00:38:52I have shown all the types of Ingress
- 00:38:54that were available I think it was made
- 00:38:56two to three months back I have shown
- 00:38:58all the type of Ingress as TLS without
- 00:39:00TLS host based path based wildcard entry
- 00:39:03so follow that video after this so that
- 00:39:05you understand the entire concept okay
- 00:39:07so if you like the button click on the
- 00:39:08like button if you have understood the
- 00:39:10concept of Ingress definitely comment on
- 00:39:12the video and I'll see in the next video
- 00:39:14take care everyone bye
- Kubernetes
- Ingress
- Load Balancer
- DevOps
- Cloud Computing
- Networking
- Kubernetes Services
- Ingress Controller
- Path-based Routing
- TLS