SERVICIOS y LOAD BALANCERS en KUBERNETES
Summary
TLDRThe video script discusses the process of setting up a cluster and deploying posts using Kubernetes. It explains different types of services, including NodePort, ClusterIP, and LoadBalancer, and how they are used to access applications within a cluster. The script also covers the dynamic nature of pods, the creation of a WordPress service, and the use of external IPs for accessing services. It highlights the importance of load balancers for maintaining a consistent IP address and ensuring high availability, even when pods are destroyed and recreated.
Takeaways
- 😀 The script discusses learning to set up one's own cluster and deploying posts.
- 💡 It introduces the concept of services within a cluster and their different types.
- 🔧 The script explains how to create load balancers automatically using cloud services.
- 📈 It highlights the dynamic nature of pods, which can be recreated with new IPs if they die.
- 🌐 Discusses the use of services to route traffic to pods based on labels or tags.
- 🚀 Demonstrates how to create a service with a fixed IP within the cluster for internal access.
- 🌐 Explains the use of NodePort services to expose applications on a specific port on each node's public IP.
- 🔄 Covers the creation of LoadBalancer services that integrate with cloud providers to manage external access.
- 🛠️ The script touches on the automation of service creation and how it simplifies the management of dynamic infrastructure.
- 📝 It concludes by emphasizing the ease of managing services with Kubernetes, including the ability to create and delete them without manual intervention.
Q & A
What is the purpose of creating a cluster in the context of the video script?
-The purpose of creating a cluster is to support the deployment of applications and services, ensuring they can scale and be managed more efficiently.
What does the term 'service' refer to in the script, and why is it important?
-In the script, a 'service' refers to a Kubernetes resource that defines a logical set of pods and a policy by which to access them. It's important because it enables communication between different parts of an application and provides a way to access them consistently, regardless of the underlying pods' lifecycle.
What is the issue with using NodePort for accessing services in a cluster?
-The issue with NodePort is that it requires pointing to the public IP of each worker node to reach a specific port, which is not ideal for maintaining a stable access point as pods can be rescheduled or recreated on different nodes.
How does a ClusterIP service differ from a NodePort service?
-A ClusterIP service is accessible only within the cluster, providing a stable IP address that remains the same regardless of the pods it targets, whereas a NodePort service is accessible from outside the cluster by directing traffic to a specific port on each worker node.
What is the role of a LoadBalancer service in Kubernetes?
-A LoadBalancer service in Kubernetes connects to the cloud provider's API and creates an external load balancer that distributes traffic across all worker nodes, providing a stable external IP for accessing the application.
Why might a service be unable to access a backend if the backend's IP changes?
-If the backend's IP changes, any service that is not configured to handle dynamic IP assignments will be unable to access it, as it will still be trying to connect to the old IP address.
What happens when a pod is destroyed in Kubernetes?
-When a pod is destroyed, it is removed from the cluster, and its IP address is no longer available. If a service was pointing to that pod, it would need to be updated to point to a new pod with a new IP address.
How can a service ensure it always points to the correct backend, even if the backend's IP changes?
-A service can ensure it always points to the correct backend by using a selector that targets the appropriate labels on pods, allowing it to redirect traffic to any pod that matches those labels, regardless of IP changes.
What is the significance of using a DNS name to access a service in Kubernetes?
-Using a DNS name to access a service allows for a more flexible and stable access point, as the DNS resolver will automatically direct traffic to the correct service IP, even if the underlying pods or their IPs change.
How can one view the list of services in a Kubernetes cluster?
-One can view the list of services in a Kubernetes cluster by using the command `kubectl get services`, which will display the services along with their types and cluster IPs.
What does the script suggest about managing services and pods in Kubernetes?
-The script suggests that Kubernetes manages services and pods dynamically, allowing for the creation, destruction, and rescheduling of pods without affecting the stability of the services that rely on them.
Outlines
🤖 Deploying and Managing Cluster Services
This paragraph discusses the process of deploying a self-hosted cluster and the intricacies of managing services within it. The speaker explains the initial learning curve and cost involved in setting up a cluster, and then delves into the concept of services, their types, and how to create and manage them. The explanation includes the use of 'NodePorts' for internal access, the dynamic nature of pods, and the creation of a service to provide stable access to applications within the cluster. The paragraph also touches on the challenges of using public IPs for external access and introduces the idea of using 'LoadBalancer' services for cloud provider-managed load balancing.
🌐 Advanced Service Configurations and Load Balancing
The second paragraph focuses on advanced configurations for services within a cluster, particularly on the use of 'LoadBalancer' services. It explains how to create a 'LoadBalancer' service that connects to the cloud provider's API to manage external traffic. The speaker provides a step-by-step guide on verifying the creation of the load balancer through the web interface and emphasizes the importance of persistent IP addresses for stable access to services. The paragraph also covers the automatic handling of service creation and destruction, ensuring that the load balancer always directs traffic to the correct nodes, even when pods are destroyed and recreated. Additionally, it mentions the possibility of adding further configurations such as certificates and health check rules to enhance service security and reliability.
Mindmap
Keywords
💡Cluster
💡Service
💡Pod
💡Deployment
💡Load Balancer
💡IP Address
💡DNS
💡Kubernetes
💡Controller
💡Cloud Provider
💡Persistence
Highlights
Learning to create your own cluster at a cost of 100 dollars.
Understanding how to support initial posts with an application to control and create a small service.
Explanation of what services are and the different types of services.
Creating balances automatically using Digital Ocean.
Introduction to Kubernetes services and how they work.
The downside of using NodePort services as they require pointing to the public IP from each worker.
How pods are dynamic and can be recreated with new IPs.
Using services to direct traffic based on labels for consistent access.
The creation of a service for WordPress with an internal cluster IP for internal access.
Exploring the use of external IPs and NodePorts for external access to services.
The importance of not relying on the public IP of a node for consistent service access.
Introduction to LoadBalancer services that integrate with cloud providers for external access.
How LoadBalancer services maintain a constant IP while workers can be recycled.
The process of creating a LoadBalancer service and its automatic setup with cloud provider APIs.
Demonstration of destroying and recreating nodes without affecting the LoadBalancer's constant IP.
The ability to add custom settings like certificates and health checks to services.
Automatic management of services including creation and deletion without manual intervention.
The option to create and delete LoadBalancer services and their impact on the application's accessibility.
Transcripts
así que triste aprendiendo y creas tu
propio clúster me imagino cosas
a 100 dólares
aprendimos cómo apoyar los primeros
posts con la application controlar y
crear un pequeño servicio pero no
explicamos bien lo que era un servicio
luego sabrán de lo que son servicios los
diferentes tipos de servicios
y vamos a ver cómo crear un los balances
automáticamente
usando colgantes en digital option
mira la intro vive en sólo tienen se lo
digo medito realmente lo mismo voy a
hacer la intro solo
[Música]
me trajo 9 4x lm
gracias
como decía recién hemos aprendido cómo
levanta nuestro propio clúster hemos
aprendido cómo desplegar los posts ya
tenemos el pod corriendo y queremos
acceder a ese apodo de la otra vez lo
que vimos fue de acceder usando un tipo
de servicio que se llama nou porta que
básicamente lo que hace es crear un
puerto específico que apunta el servicio
en cada no lo malo de eso es que tienes
que apuntarle al la ip pública desde
cada uno de los workers para llegar
hacia ese puerto no es una muy buena
idea hay mejores formas vamos a
plantarles los posts de cuadrantes son
mortales se mueren cuando se mueren no
vuelven a crecer
no resucitan si el replec hecho
controller o el de pluma lo reemplaza
por otro se crea un nuevo pot con una
nueva ip se como puedes ver esos posts
son dinámicos o sea se pueden morir se
puede ante reductor nuevo se puede mover
otro nodo usar el ipad del post para
llegar a ese punto es una buena idea
qué pasa si tenemos por ejemplo un front
end yumba que ni queremos desde el front
el apuntarle al back-end para acceder a
un servicio algo así
si nosotros usamos la ip depot s&p puede
cambiar porque es el post tipo de morir
y puede crearse otro post entonces no
vamos a poder estar accediendo a ese
back end de forma
constante el cual no tenga cosas que se
llaman servicios que son los servicios
es una extracción que define un set
lógico de posts basado en una política
si finalmente esa política es por
ejemplo una etiqueta como le ponía cada
post entonces el servicio dice tengo que
mandar el tráfico a todos los posts que
tengan esta etiqueta de esa forma sabe
que puedo llegar a hacer un get potts
para ver todos los posts que estamos
corriendo debe estarle wordpress que
creamos la otra vez
pero no puedo acceder a ese post porque
no hay ningún servicio creado entonces
vamos a crear un servicio una vez que
queremos el servicio podemos hacer un
get sleazy para ver los servicios y
fíjate que creó el servicio wordpress y
le dio una ip de clúster si a ese
servicio en el puerto 80 que quiere
decir esto que este servicio solamente
puede ser accedido dentro del plástico
por ejemplo si está dentro un pot no
puedes acceder desde uno porque es un ip
interna de la red de los bots esto
serviría solamente si yo quiero acceder
por ejemplo desde un bot que está en el
back end aún porque está en forma de no
viceversa y lo que hago es apuntarle a
a esta ip de wordpress que siempre va a
ser la misma
este es el servicio siempre va a ser la
misma y va a llegar a los posts basado
en las reglas etiquetas
también se puede usar el nombre se puede
hacer desde cualquier punto le apunta al
nombre wordpress y el dns de gobernantes
debería resolver el servicio si nos
mantenemos en segundo tipo de servicio
que es el que creamos la otra vez que lo
que hace es crear un puerto en el nodo
que accede a
entonces
y acá ya que ahora va a decir tipo no
port sí entonces lo que hace es apuntar
el puerto 30.000 en el que apunta al 80
del servicio de simon get 'notes - o
wire si para traernos la ip pública
podemos apuntar a esta ip al puerto
30.000
y voy a llegar al wordpress perfecto
ahora pero sólo un buen lo malo que
tiene como decía recién es que tenemos
que estar buscando la ip pública del bus
del nodo y no es no es muy feliz bueno
ahora vamos a ver el tercer tipo de
servicio que llama load balance el este
servicio lo que va a hacer es conectarse
a lápiz del proveedor de nube que tengas
que estés usando en tu clúster y va a
crear un loop balance en el lado de
ellos que lo que son los van a ser los
manejadores de carga que va adelante
todos los workers y entonces vos tenés
que estar aprendiendo te la ip de los
workers apuntar tu dns a la ip de
externa de cada worker porque acordate
que los walker también son descartables
son ganados igual apuntada solamente los
van a hacer todos los workers van a
estar dentro de trajes en los balances y
por más que vos recicles esos workers
vos simplemente la punta sala los van a
ser y vas a llegar siempre a tu
aplicación si la sintaxis es bastante
simple es simplemente le decís tipo los
van a ser el protocolo el por dónde vas
a ir si y de nuevo tienes que crear el
selector que es la forma en que lo van a
hacer sabe a dónde mandar el tráfico
tengo mucho como
lo que hacemos es asegurarnos que
tenemos en el servicio
y vamos a aplicar
el nuevo y el nuevo los balances que va
a ser tipo load o arancel fíjate que si
ahora hacemos un get service es decir
tipo load a lanzar fíjate que dice
externa light vending de nuevo lo que
hace esto es conectarse a la api del del
proveedor nubes y en este caso existe la
opción y pedirle que creó un los
balances si vamos a la interfaz web de
10 de lo bien y hacemos clic en
networking vamos a los balances fíjate
que se está creando si un los balances
automáticamente desde cuba
gracias a que digite elogian provee este
este servicio pone desde guantes ya
tiene configurados las credenciales para
conectarse de la api de y de las jons y
si lo creamos a mano alzada un clúster
basado en los nuevos tenemos que agregar
esas credenciales que lo vamos a ver en
otro vídeo por ahora lo importante es
que esto ya lo tienes resuelto y lo
único que tenemos que hacer es pedirle
que creó un servicio tipo los van a ser
y automáticamente va a crear un los
balances en el proveedor si una vez que
se termine de crear si hacemos acá un
get service fíjate y ya tenemos la ip
externa de este los balances pero ésta
es la única ip que no tenemos que
acordar o incluso en días de algo ya no
puedes crear un dominio de puntal sólo
los ghaneses directamente o sea que si
se cambia
va a tener la no hay p entonces
simplemente hacemos clic a s&p y nos
trajo de wordpress vamos a probar algo
vamos a ir a drop let's sí que son las
instancias de dieta low jean-jacques
hasta nuestra instancia y vamos a
destruirla
recordemos que toda la metadata o sea
todos los posts todas las de definición
de los servicios toda la definición de
que necesitamos saber qué contenedores
queremos correr todo eso está guardado
en los controladores mejor dicho está
guardado en la base de datos de los
controladores que éste cede y entonces
nosotros sin ningún problema deberíamos
poder destruir los nuevos pueblos no son
ganados son descartables entonces a
nosotros destruirlos no obviamente el
nuevo nuevo trae una ip diferente pero
debería el los van a hacer mantener la
misma ip si debería cargar el nodo nuevo
dentro de los balances si nos vamos a la
interfaz al club city le hacemos un get
'notes
no hay no porque lo destruir bueno vamos
a drop les refrescamos y vemos que ya
creó un nuevo fijate que es otro nodo
tiene una ip diferente a la que teníamos
recién y ahora hacemos un get loud
como ver que luego de 77 segundos aún no
hacemos un testing de bots
debería haberse creado el nuevo por sí y
si hacemos un get service debería estar
todo como recién y fíjate que la ip es
la misma de ración si deberíamos poder
refrescar este esta página y debería
cargar sin ningún programa afectando
entonces que hicimos matamos el nodo y
como tenemos un loop van a ser adelante
son los sólo podemos acceder e sólo
actuarán servir tener que acordarnos de
la ip de cada uno de los nodos y poder
verles nuestro sitio perfecto y todo
esto lo maneja como net es con billete a
luchas hay muchas más opciones que
nosotros podemos agregar si al archivo
éste le podemos agregar por ejemplo
certificados le podemos agregar reglas
de help cheque todo eso eso es pues
vamos a ver más adelante pero lo bueno
que nosotros podemos crear nos van a ser
sedes de cornetes quienes afectan la
nube automáticamente y obviamente si
queremos
podemos borrar este servicio
sí
y esto lo que debería hacer es borrar el
loto al hacer también fíjate se borró
perfecto entonces todo esto lo maneja
con arte no queremos estar haciendo nada
más no tenés no tenemos concerté reforma
o esas cosas para crear este los van a
hacer lo maneja automáticamente se borra
y se crea solo
y bueno
para más videos si te gustó
a esta altura no esto porque para esto
dale no me gusta
si el barça dual answers creado un pot
con h aproxima
y la ventaja no se aproxima
[Música]
تصفح المزيد من مقاطع الفيديو ذات الصلة
How to Propagate Secrets Everywhere with External Secrets Operator (ESO) and Crossplane
Custom Networking for Amazon EKS using Rafay
¿QUE ES KUBERNETES? - Introducción al orquestador más usado
קורס kubernetes (k8s) המלא - שיעור 2 - ארכיטקטורה של אשכול (cluster architecture)
Pods and Containers - Kubernetes Networking | Container Communication inside the Pod
NGINX Tutorial - What is Nginx
5.0 / 5 (0 votes)