From 4aa14c3022efc4642dba2b2138a886e349a545ed Mon Sep 17 00:00:00 2001 From: Manuel Vergara Date: Wed, 17 May 2023 22:52:04 +0200 Subject: [PATCH 1/9] Translated to Spanish the day51 file Signed-off-by: Manuel Vergara --- 2022/es/Days/day51.md | 186 ++++++++++++++++++++---------------------- 1 file changed, 87 insertions(+), 99 deletions(-) diff --git a/2022/es/Days/day51.md b/2022/es/Days/day51.md index da1cb4a..e6c0811 100644 --- a/2022/es/Days/day51.md +++ b/2022/es/Days/day51.md @@ -1,135 +1,136 @@ -## Deploying your first Kubernetes Cluster +## Despliegue del primer clúster de Kubernetes -In this post we are going to get a Kubernetes cluster up and running on our local machine using minikube, this will give us a baseline Kubernetes cluster for the rest of the Kubernetes section, although we will look at deploying a Kubernetes cluster also in VirtualBox later on. The reason for choosing this method vs spinning a managed Kubernetes cluster up in the public cloud is that this is going to cost money even with the free tier, I shared some blogs though if you would like to spin up that environment in the previous section [Day 50](day50.md). +En esta publicación, vamos a poner en marcha un clúster de Kubernetes en nuestra máquina local utilizando minikube. Esto nos proporcionará un clúster de Kubernetes básico para el resto de la sección de Kubernetes, aunque también veremos cómo implementar un clúster de Kubernetes en VirtualBox más adelante. La razón por la que elegimos este método en lugar de crear un clúster de Kubernetes administrado en la nube pública es que esto va a costar dinero incluso con el nivel gratuito. Sin embargo, compartí algunos blogs en la sección anterior [Día 50](day50.md) si deseas crear ese entorno. -### What is Minikube? +### ¿Qué es Minikube? -> “minikube quickly sets up a local Kubernetes cluster on macOS, Linux, and Windows. We proudly focus on helping application developers and new Kubernetes users.” +> "Minikube configura rápidamente un clúster local de Kubernetes en macOS, Linux y Windows. Nos enfocamos en ayudar a los desarrolladores de aplicaciones y a los nuevos usuarios de Kubernetes". -You might not fit into the above but I have found minikube is a great little tool if you just want to test something out in a Kubernetes fashion, you can easily deploy an app and they have some amazing add-ons which I will also cover. +Es posible que no encajes en la descripción anterior, pero he descubierto que Minikube es una excelente herramienta si solo quieres probar algo con Kubernetes. Puedes implementar fácilmente una aplicación y también tienen algunos complementos increíbles que también cubriré. -To begin with, regardless of your workstation OS, you can run minikube. First, head over to the [project page here](https://minikube.sigs.k8s.io/docs/start/). The first option you have is choosing your installation method. I did not use this method, but you might choose to vs my way (my way is coming up). +Para empezar, independientemente de tu sistema operativo de trabajo, puedes ejecutar Minikube. Primero, dirígete a la [página del proyecto aquí](https://minikube.sigs.k8s.io/docs/start/). La primera opción que tienes es elegir el método de instalación. No utilicé este método, pero puedes elegir usarlo en lugar del mío (mi método se explicará a continuación). -mentioned below it states that you need to have a “Container or virtual machine managers, such as Docker, Hyper kit, Hyper-V, KVM, Parallels, Podman, VirtualBox, or VMware” this is where MiniKube will run and the easy option and unless stated in the repository I am using Docker. You can install Docker on your system using the following [link](https://docs.docker.com/get-docker/). +A continuación, se indica que debes tener "contenedores o administradores de máquinas virtuales, como Docker, HyperKit, Hyper-V, KVM, Parallels, Podman, VirtualBox o VMware". Aquí es donde se ejecutará Minikube, y la opción más sencilla, a menos que se indique lo contrario en el repositorio que estoy utilizando, es Docker. Puedes instalar Docker en tu sistema utilizando el siguiente [enlace](https://docs.docker.com/get-docker/). -![](Images/Day51_Kubernetes1.png) +![Day51_Kubernetes1](Images/Day51_Kubernetes1.png) -### My way of installing minikube and other prereqs… +### Mi forma de instalar Minikube y otros requisitos previos... -I have been using arkade for some time now to get all those Kubernetes tools and CLIs, you can see the installation steps on this [github repository](https://github.com/alexellis/arkade) for getting started with Arkade. I have also mentioned this in other blog posts where I needed something installed. The simplicity of just hitting arkade get and then seeing if your tool or cli is available in handy. In the Linux section, we spoke about package manager and the process for getting our software, you can think about Arkade as that marketplace for all your apps and CLIs for Kubernetes. A very handy little tool to have on your systems, written in Golang and cross-platform. +He estado utilizando Arkade durante algún tiempo para obtener todas esas herramientas y CLIs de Kubernetes. Puedes ver los pasos de instalación en este [repositorio de GitHub](https://github.com/alexellis/arkade) para comenzar con Arkade. También he mencionado esto en otras publicaciones de blog donde necesitaba instalar algo. La simplicidad de simplemente ejecutar `arkade get` y luego verificar si tu herramienta o CLI está disponible es muy útil. En la sección de Linux, hablamos sobre el administrador de paquetes y el proceso para obtener nuestro software. Puedes pensar en Arkade como ese mercado de aplicaciones y CLIs para Kubernetes. Es una herramienta muy útil para tener en tus sistemas, escrita en Golang y multiplataforma. -![](Images/Day51_Kubernetes2.png) +![Day51_Kubernetes2](Images/Day51_Kubernetes2.png) -As part of the long list of available apps within arkade minikube is one of them so with a simple `arkade get minikube` command we are now downloading the binary and we are good to go. +Como parte de la larga lista de aplicaciones disponibles en Arkade, Minikube es una de ellas. Por lo tanto, con un simple comando `arkade get minikube`, ahora estamos descargando el binario y listos para continuar. -![](Images/Day51_Kubernetes3.png) +![Day51_Kubernetes3](Images/Day51_Kubernetes3.png) -We will also need kubectl as part of our tooling so you can also get this via arkade or I believe that the minikube documentation brings this down as part of the curl commands mentioned above. We will cover more on kubectl later on in the post. +También necesitaremos kubectl como parte de nuestras herramientas, por lo que también puedes obtenerlo a través de Arkade o creo que la documentación de Minikube lo descarga mediante los comandos curl mencionados anteriormente. Hablaremos más sobre kubectl más adelante en la publicación. -### Getting a Kubernetes cluster up and running +### Poner en marcha un clúster de Kubernetes -For this particular section, I want to cover the options available to us when it comes to getting a Kubernetes cluster up and running on your local machine. We could simply run the following command and it would spin up a cluster for you to use. +En esta sección en particular, quiero cubrir las opciones disponibles para poner en marcha un clúster de Kubernetes en tu máquina local. Simplemente podríamos ejecutar el siguiente comando y se crearía un clúster para que lo utilices. -minikube is used on the command line, and simply put once you have everything installed you can run `minikube start` to deploy your first Kubernetes cluster. You will see below that the Docker Driver is the default as to where we will be running our nested virtualisation node. I mentioned at the start of the post the other options available, the other options help when you want to expand what this local Kubernetes cluster needs to look like. +Minikube se utiliza en la línea de comandos y, simplemente, una vez que tienes todo instalado, puedes ejecutar `minikube start` para implementar tu primer clúster de Kubernetes. A continuación, verás que el controlador de Docker es el predeterminado para ejecutar nuestro nodo de virtualización anidado. Mencioné al principio de la publicación las otras opciones disponibles, las cuales te ayudarán cuando desees ampliar cómo debe verse este clúster de Kubernetes local. -A single Minikube cluster is going to consist of a single docker container in this instance which will have the control plane node and worker node in one instance. Whereas typically you would separate those nodes. Something we will cover in the next section where we look at still home lab type Kubernetes environments but a little closer to production architecture. +Un clúster de Minikube consistirá en un solo contenedor de Docker en este caso, el cual tendrá el nodo del plano de control y el nodo de trabajo en una sola instancia. Por lo general, separaríamos esos nodos. Esto es algo que cubriremos en la siguiente sección, donde veremos entornos de Kubernetes tipo laboratorio doméstico, pero un poco más cercanos a la arquitectura de producción. -![](Images/Day51_Kubernetes4.png) +![Day51_Kubernetes4](Images/Day51_Kubernetes4.png) -I have mentioned this a few times now, I like minikube because of the add-ons available, the ability to deploy a cluster with a simple command including all the required addons from the start helps me deploy the same required setup every time. +He mencionado esto varias veces antes, me gusta Minikube debido a los complementos disponibles, la capacidad de implementar un clúster con un simple comando, incluidos todos los complementos requeridos desde el principio, me ayuda a implementar la misma configuración requerida cada vez. -Below you can see a list of those add-ons, I generally use the `CSI-host path-driver` and the `volumesnapshots` addons but you can see the long list below. Sure these addons can generally be deployed using Helm again something we will cover later on in the Kubernetes section but this makes things much simpler. +A continuación, puedes ver una lista de esos complementos. Por lo general, utilizo los complementos `CSI-host path-driver` y `volumesnapshots`, pero puedes ver la lista completa a continuación. Estos complementos generalmente se pueden implementar utilizando Helm, algo que también cubriremos más adelante en la sección de Kubernetes, pero esto hace las cosas mucho más simples. -![](Images/Day51_Kubernetes5.png) +![Day51_Kubernetes5](Images/Day51_Kubernetes5.png) -I am also defining in our project some additional configuration, apiserver is set to 6433 instead of a random API port, and I define the container runtime also to containerd however docker is default and CRI-O is also available. I am also setting a specific Kubernetes version. +También estoy definiendo en nuestro proyecto alguna configuración adicional. El servidor de API se establece en 6433 en lugar de un puerto API aleatorio, y también defino el tiempo de ejecución del contenedor como containerd. Sin embargo, Docker es el valor predeterminado y CRI-O también está disponible. También estoy estableciendo una versión específica de Kubernetes. -![](Images/Day51_Kubernetes6.png) +![Day51_Kubernetes6](Images/Day51_Kubernetes6.png) -Now we are ready to deploy our first Kubernetes cluster using minikube. I mentioned before though that you will also need `kubectl` to interact with your cluster. You can get kubectl installed using arkade with the command `arkade get kubectl` +Ahora estamos listos para implementar nuestro primer clúster de Kubernetes utilizando Minikube. Sin embargo, mencioné anteriormente que también necesitarás `kubectl` para interactuar con tu clúster. Puedes obtener kubectl instalado mediante Arkade con el comando `arkade get kubectl` -![](Images/Day51_Kubernetes7.png) +![Day51_Kubernetes7](Images/Day51_Kubernetes7.png) -or you can download cross-platform from the following +o puedes descargarlo para varias plataformas desde los siguientes enlaces: - [Linux](https://kubernetes.io/docs/tasks/tools/install-kubectl-linux) - [macOS](https://kubernetes.io/docs/tasks/tools/install-kubectl-macos) - [Windows](https://kubernetes.io/docs/tasks/tools/install-kubectl-windows) -Once you have kubectl installed we can then interact with our cluster with a simple command like `kubectl get nodes` +Una vez que hayas instalado kubectl, puedes interactuar con tu clúster con un simple comando como `kubectl get nodes` -![](Images/Day51_Kubernetes8.png) +![Day51_Kubernetes8](Images/Day51_Kubernetes8.png) -### What is kubectl? +### ¿Qué es kubectl? -We now have our minikube | Kubernetes cluster up and running and I have asked you to install both Minikube where I have explained at least what it does but I have not explained what kubectl is and what it does. +Ahora tenemos nuestro clúster minikube | Kubernetes en funcionamiento y te he pedido que instales tanto Minikube, donde he explicado al menos qué hace, pero no he explicado qué es kubectl y qué hace. -kubectl is a cli that is used or allows you to interact with Kubernetes clusters, we are using it here for interacting with our minikube cluster but we would also use kubectl for interacting with our enterprise clusters across the public cloud. +kubectl es una interfaz de línea de comandos que se utiliza para interactuar con clústeres de Kubernetes. Lo estamos utilizando aquí para interactuar con nuestro clúster minikube, pero también usaríamos kubectl para interactuar con nuestros clústeres empresariales en la nube pública. -We use kubectl to deploy applications and inspect and manage cluster resources. A much better [Overview of kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) can be found here on the Kubernetes official documentation. +Usamos kubectl para implementar aplicaciones, inspeccionar y gestionar recursos del clúster. Puedes encontrar una [Descripción general de kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) mucho más detallada aquí en la documentación oficial de Kubernetes. -kubectl interacts with the API server found on the Control Plane node which we briefly covered in an earlier post. +kubectl interactúa con el servidor de API que se encuentra en el nodo de plano de control, del cual hablamos brevemente en una publicación anterior. -### kubectl cheat sheet +### Hoja de referencia de kubectl -Along with the official documentation, I have also found myself with this page open all the time when looking for kubectl commands. [Unofficial Kubernetes](https://unofficial-kubernetes.readthedocs.io/en/latest/) +Además de la documentación oficial, también he encontrado que siempre tengo abierta esta página cuando busco comandos de kubectl. [Kubernetes no oficial](https://unofficial-kubernetes.readthedocs.io/en/latest/) -| Listing Resources | | -| ------------------------ | ------------------------------------------ | -| kubectl get nodes | List all nodes in cluster | -| kubectl get namespaces | List all namespaces in cluster | -| kubectl get pods | List all pods in default namespace cluster | -| kubectl get pods -n name | List all pods in the "name" namespace | +| Listar recursos | | +| -------------------------- | --------------------------------------------------------------------------- | +| kubectl get nodes | Listar todos los nodos en el clúster | +| kubectl get namespaces | Listar todos los espacios de nombres en el clúster | +| kubectl get pods | Listar todas las pods en el clúster en el espacio de nombres predeterminado | +| kubectl get pods -n nombre | Listar todas las pods en el espacio de nombres "nombre" | -| Creating Resources | | -| ----------------------------- | ------------------------------------------- | -| kubectl create namespace name | Create a namespace called "name" | -| kubectl create -f [filename] | Create a resource from a JSON or YAML file: | +| Crear recursos | | +| ------------------------------- | --------------------------------------------------- | +| kubectl create namespace nombre | Crear un espacio de nombres llamado "nombre" | +| kubectl create -f [archivo] | Crear un recurso a partir de un archivo JSON o YAML | -| Editing Resources | | -| ---------------------------- | ----------------- | -| kubectl edit svc/servicename | To edit a service | +| Editar recursos | | +| -------------------------------- | ------------------ | +| kubectl edit svc/nombre-servicio | Editar un servicio | -| More detail on Resources | | -| ------------------------ | ------------------------------------------------------- | -| kubectl describe nodes | display the state of any number of resources in detail, | +| Más detalles sobre los recursos | | +| ------------------------------- | -------------------------------------------------------------- | +| kubectl describe nodes | mostrar el estado de cualquier cantidad de recursos en detalle | -| Delete Resources | | -| ------------------ | ------------------------------------------------ | -| kubectl delete pod | Remove resources, this can be from stdin or file | +| Eliminar recursos | | +| ------------------ | ------------------------------------------------------------------------- | +| kubectl delete pod | Eliminar recursos, puede ser desde la entrada estándar o desde un archivo | -You will find yourself wanting to know the short names for some of the kubectl commands, for example `-n` is the short name for `namespace` which makes it easier to type a command but also if you are scripting anything you can have much tidier code. +Te encontrarás deseando conocer los nombres cortos para algunos de los comandos de kubectl. Por ejemplo, `-n` es el nombre corto para `namespace`, lo que facilita escribir un comando y, si estás escribiendo scripts, puedes tener un código más ordenado. -| Short name | Full name | -| ---------- | -------------------------- | -| csr | certificatesigningrequests | -| cs | componentstatuses | -| cm | configmaps | -| ds | daemonsets | -| deploy | deployments | -| ep | endpoints | -| ev | events | -| hpa | horizontalpodautoscalers | -| ing | ingresses | -| limits | limitranges | -| ns | namespaces | -| no | nodes | -| pvc | persistentvolumeclaims | -| pv | persistentvolumes | -| po | pods | -| pdb | poddisruptionbudgets | -| psp | podsecuritypolicies | -| rs | replicasets | -| rc | replicationcontrollers | -| quota | resourcequotas | -| sa | serviceaccounts | -| svc | services | +| Nombre corto | Nombre completo | +| ------------ | -------------------------- | +| csr | certificatesigningrequests | +| cs | componentstatuses | +| cm | configmaps | +| ds | daemonsets | +| deploy | deployments | +| ep | endpoints | +| ev | events | +| hpa | horizontalpodautoscalers | +| ing | ingresses | +| limits | limitranges | +| ns | namespaces | +| no | nodes | +| pvc | persistentvolumeclaims | +| pv | persistentvolumes | +| po | pods | +| pdb | poddisruptionbudgets | +| psp | podsecuritypolicies | +| rs | replicasets | +| rc | replicationcontrollers | +| quota | resourcequotas | +| sa | serviceaccounts | +| svc | services | -The final thing to add here is that I created another project around minikube to help me quickly spin up demo environments to display data services and protect those workloads with Kasten K10, [Project Pace](https://github.com/MichaelCade/project_pace) can be found there and would love your feedback or interaction, it also displays or includes some automated ways of deploying your minikube clusters and creating different data services applications. +Lo último que quiero añadir aquí es que he creado otro proyecto en torno a minikube para ayudarme a crear rápidamente entornos de demostración para mostrar servicios de datos y proteger esas cargas de trabajo con Kasten K10. Puedes encontrar [Project Pace](https://github.com/MichaelCade/project_pace) allí y me encantaría recibir tus comentarios o interactuar contigo. También muestra o incluye algunas formas automatizadas de implementar tus clústeres de minikube y crear diferentes aplicaciones de servicios de datos. -Next up, we will get into deploying multiple nodes into virtual machines using VirtualBox but we are going to hit the easy button there as we did in the Linux section where we used vagrant to quickly spin up the machines and deploy our software how we want them. +A continuación, pasaremos a implementar varios nodos en máquinas virtuales utilizando VirtualBox, pero vamos a utilizar la opción fácil como lo hicimos en la sección de Linux, donde usamos Vagrant para crear rápidamente las máquinas y desplegar nuestro software según lo deseemos. + +Añadí esta lista a la publicación de ayer, que son blogs explicativos que he hecho sobre la implementación de diferentes clústeres de Kubernetes. -I added this list to the post yesterday which are walkthrough blogs I have done around different Kubernetes clusters being deployed. - [Kubernetes playground – How to choose your platform](https://vzilla.co.uk/vzilla-blog/building-the-home-lab-kubernetes-playground-part-1) - [Kubernetes playground – Setting up your cluster](https://vzilla.co.uk/vzilla-blog/building-the-home-lab-kubernetes-playground-part-2) @@ -141,26 +142,13 @@ I added this list to the post yesterday which are walkthrough blogs I have done - [Getting started with CIVO Cloud](https://vzilla.co.uk/vzilla-blog/getting-started-with-civo-cloud) - [Minikube - Kubernetes Demo Environment For Everyone](https://vzilla.co.uk/vzilla-blog/project_pace-kasten-k10-demo-environment-for-everyone) -### What we will cover in the series on Kubernetes +## Recursos -We have started covering some of these mentioned below but we are going to get more hands-on tomorrow with our second cluster deployment then we can start deploying applications into our clusters. - -- Kubernetes Architecture -- Kubectl Commands -- Kubernetes YAML -- Kubernetes Ingress -- Kubernetes Services -- Helm Package Manager -- Persistent Storage -- Stateful Apps - -## Resources - -If you have FREE resources that you have used then please feel free to add them here via a PR to the repository and I will be happy to include them. +Si tienes recursos GRATUITOS que has utilizado, no dudes en agregarlos aquí a través de una solicitud de extracción (PR) al repositorio y estaré encantado de incluirlos. - [Kubernetes Documentation](https://kubernetes.io/docs/home/) - [TechWorld with Nana - Kubernetes Tutorial for Beginners [FULL COURSE in 4 Hours]](https://www.youtube.com/watch?v=X48VuDVv0do) - [TechWorld with Nana - Kubernetes Crash Course for Absolute Beginners](https://www.youtube.com/watch?v=s_o8dwzRlu4) - [Kunal Kushwaha - Kubernetes Tutorial for Beginners | What is Kubernetes? Architecture Simplified!](https://www.youtube.com/watch?v=KVBON1lA9N8) -See you on [Day 52](day52.md) +Nos vemos en el [Día 52](day52.md) From 31df7c503e65ac80e480e02bf691b4546d7e8ed0 Mon Sep 17 00:00:00 2001 From: Manuel Vergara Date: Wed, 17 May 2023 23:10:10 +0200 Subject: [PATCH 2/9] Translated to Spanish the day52 file Signed-off-by: Manuel Vergara --- 2022/es/Days/day52.md | 102 +++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 57 deletions(-) diff --git a/2022/es/Days/day52.md b/2022/es/Days/day52.md index 1e3ed8d..53a4607 100644 --- a/2022/es/Days/day52.md +++ b/2022/es/Days/day52.md @@ -1,52 +1,52 @@ -## Setting up a multinode Kubernetes Cluster +## Configuración de un clúster de Kubernetes multinodo -I wanted this title to be "Setting up a multinode Kubernetes cluster with Vagrant" but thought it might be a little too long! +Quería que este título fuera "Configuración de un clúster de Kubernetes multinodo con Vagrant", pero pensé que podría ser un poco largo. -In the session yesterday we used a cool project to deploy our first Kubernetes cluster and get a little hands-on with the most important CLI tool you will come across when using Kubernetes (kubectl). +En la sesión de ayer, utilizamos un proyecto interesante para implementar nuestro primer clúster de Kubernetes y tener un poco de práctica con la herramienta CLI más importante que encontrarás al usar Kubernetes (`kubectl`). -Here we are going to use VirtualBox as our base but as mentioned the last time we spoke about Vagrant back in the Linux section we can use any hypervisor or virtualisation tool supported. It was [Day 14](day14.md) when we went through and deployed an Ubuntu machine for the Linux section. +Aquí vamos a utilizar VirtualBox como base, pero como mencioné la última vez que hablamos de Vagrant en la sección de Linux, podemos usar cualquier hipervisor o herramienta de virtualización compatible. Fue [Día 14](day14.md) cuando pasamos por el proceso de implementar una máquina Ubuntu para la sección de Linux. -### A quick recap on Vagrant +### Un breve repaso sobre Vagrant -Vagrant is a CLI utility that manages the lifecycle of your virtual machines. We can use vagrant to spin up and down virtual machines across many different platforms including vSphere, Hyper-v, Virtual Box and also Docker. It does have other providers but we will stick with that we are using Virtual Box here so we are good to go. +Vagrant es una utilidad de línea de comandos que gestiona el ciclo de vida de tus máquinas virtuales. Podemos usar Vagrant para crear y eliminar máquinas virtuales en diferentes plataformas, incluyendo vSphere, Hyper-V, VirtualBox y también Docker. Tiene otros proveedores, pero nos quedaremos con el que estamos usando aquí, que es VirtualBox. -I am going to be using a baseline this [blog and repository](https://devopscube.com/kubernetes-cluster-vagrant/) to walk through the configuration. I would however advise that if this is your first time deploying a Kubernetes cluster then maybe also look into how you would do this manually and then at least you know what this looks like. Although I will say that this Day 0 operations and effort is being made more efficient with every release of Kubernetes. I liken this very much to the days of VMware and ESX and how you would need at least a day to deploy 3 ESX servers now we can have that up and running in an hour. We are heading in that direction when it comes to Kubernetes. +Voy a utilizar como referencia el [blog y repositorio](https://devopscube.com/kubernetes-cluster-vagrant/) para guiarme en la configuración. Sin embargo, te recomendaría que si es la primera vez que implementas un clúster de Kubernetes, también investigues cómo hacerlo manualmente, así al menos sabrás cómo se ve el proceso. Aunque debo decir que las operaciones del Día 0 y el esfuerzo se están volviendo más eficientes con cada versión de Kubernetes. Esto me recuerda mucho a los días de VMware y ESX, cuando necesitábamos al menos un día para implementar 3 servidores ESX, y ahora podemos tener todo funcionando en una hora. Nos estamos acercando a ese nivel en lo que respecta a Kubernetes. -### Kubernetes Lab environment +### Entorno de laboratorio de Kubernetes -I have uploaded in [Kubernetes folder](Kubernetes) the vagrantfile that we will be using to build out our environment. Grab this and navigate to this directory in your terminal. I am again using Windows so I will be using PowerShell to perform my workstation commands with vagrant. If you do not have vagrant then you can use arkade, we covered this yesterday when installing minikube and other tools. A simple command `arkade get vagrant` should see your download and install the latest version of vagrant. +He subido en la [carpeta de Kubernetes](Kubernetes) el archivo `vagrantfile` que usaremos para construir nuestro entorno. Descárgalo y navega hasta este directorio en tu terminal. En mi caso, estoy usando Windows, así que usaré PowerShell para ejecutar los comandos de mi estación de trabajo con Vagrant. Si no tienes Vagrant instalado, puedes usar arkade, que cubrimos ayer al instalar minikube y otras herramientas. Un simple comando `arkade get vagrant` debería descargar e instalar la última versión de Vagrant. -When you are in your directory then you can simply run `vagrant up` and if all is configured correctly then you should see the following kick-off in your terminal. +Cuando estés en el directorio, simplemente ejecuta `vagrant up` y, si todo está configurado correctamente, deberías ver que se inicia el proceso en tu terminal. -![](Images/Day52_Kubernetes1.png) +![Day52_Kubernetes1.png](https://example.com/Day52_Kubernetes1.png) -In the terminal, you are going to see several steps taking place, but in the meantime let's take a look at what we are building here. +En la terminal, verás que se ejecutan varios pasos, pero mientras tanto, echemos un vistazo a lo que estamos construyendo aquí. -![](Images/Day52_Kubernetes2.png) +![Day52_Kubernetes2.png](https://example.com/Day52_Kubernetes2.png) -From the above you can see that we are going to build out 3 virtual machines, we will have a control plane node and then two worker nodes. If you head back to [Day 49](day49.md) You will see some more descriptions of these areas we see in the image. +Desde lo anterior, puedes ver que vamos a crear 3 máquinas virtuales. Tendremos un nodo de control y luego dos nodos de trabajo. Si vuelves al [Día 49](day49.md), verás más descripciones de estas áreas que vemos en la imagen. -Also in the image, we indicate that our kubectl access will come from outside of the cluster and hit that kube apiserver when in fact as part of the vagrant provisioning we are deploying kubectl on each of these nodes so that we can access the cluster from within each of our nodes. +Además, en la imagen indicamos que nuestro acceso a `kubectl` vendrá desde fuera del clúster y llegará al `kube-apiserver`. En realidad, como parte de la provisión de Vagrant, estamos implementando `kubectl` en cada uno de estos nodos para poder acceder al clúster desde dentro de cada uno de ellos. -The process of building out this lab could take anything from 5 minutes to 30 minutes depending on your setup. +El proceso de construcción de este laboratorio puede tardar entre 5 y 30 minutos, según la configuración que tengas. -I am going to cover the scripts shortly as well but you will notice if you look into the vagrant file that we are calling on 3 scripts as part of the deployment and this is really where the cluster is created. We have seen how easy it is to use vagrant to deploy our virtual machines and OS installations using vagrant boxes but having the ability to run a shell script as part of the deployment process is where it gets quite interesting around automating these lab build-outs. +Voy a cubrir los scripts en breve, pero notarás que, si examinas el archivo Vagrant, estamos llamando a 3 scripts como parte de la implementación, y es aquí donde se crea realmente el clúster. Hemos visto lo fácil que es usar Vagrant para implementar nuestras máquinas virtuales e instalaciones del sistema operativo mediante cajas de Vagrant, pero la capacidad de ejecutar un script de shell como parte del proceso de implementación es lo que resulta interesante para automatizar la creación de estos laboratorios. -Once complete we can then ssh to one of our nodes `vagrant ssh master` from the terminal should get you access, the default username and password is `vagrant/vagrant` +Una vez completado, podemos acceder a uno de nuestros nodos con `vagrant ssh master` desde la terminal. El nombre de usuario y contraseña predeterminados son `vagrant/vagrant`. -You can also use `vagrant ssh node01` and `vagrant ssh node02` to gain access to the worker nodes should you wish. +También puedes usar `vagrant ssh node01` y `vagrant ssh node02` para acceder a los nodos de trabajo si así lo deseas. -![](Images/Day52_Kubernetes3.png) +![Day52_Kubernetes3.png](https://example.com/Day52_Kubernetes3.png) -Now we are in one of the above nodes in our new cluster we can issue `kubectl get nodes` to show our 3 node cluster and the status of this. +Ahora estamos en uno de los nodos anteriores de nuestro nuevo clúster y podemos ejecutar `kubectl get nodes` para mostrar nuestro clúster de 3 nodos y su estado. -![](Images/Day52_Kubernetes4.png) +![Day52_Kubernetes4.png](https://example.com/Day52_Kubernetes4.png) -At this point, we have a running 3 node cluster, with 1 control plane node and 2 worker nodes. +En este punto, tenemos un clúster de 3 nodos en funcionamiento, con 1 nodo de control y 2 nodos de trabajo. -### Vagrantfile and Shell Script walkthrough +### Recorrido por el Vagrantfile y los scripts de shell -If we take a look at our vagrantfile, you will see that we are defining several worker nodes, networking IP addresses for the bridged network within VirtualBox and then some naming. Another you will notice is that we are also calling upon some scripts that we want to run on specific hosts. +Si echamos un vistazo a nuestro Vagrantfile, verás que estamos definiendo varios nodos de trabajo, direcciones IP de red para la red puente dentro de VirtualBox y algunos nombres. Otra cosa que notarás es que también estamos llamando a algunos scripts que queremos ejecutar en hosts específicos. ``` NUM_WORKER_NODES=2 @@ -91,51 +91,52 @@ Vagrant.configure("2") do |config| end ``` -Let's break down those scripts that are being run. We have three scripts listed in the above VAGRANTFILE to run on specific nodes. +Vamos a analizar esos scripts que se están ejecutando. Tenemos tres scripts enumerados en el VAGRANTFILE anterior que se ejecutarán en nodos específicos. `master.vm.provision "shell", path: "scripts/common.sh"` -This script above is going to focus on getting the nodes ready, it is going to be run on all 3 of our nodes and it will remove any existing Docker components and reinstall Docker and ContainerD as well kubeadm, kubelet and kubectl. This script will also update existing software packages on the system. +Este script se centrará en preparar los nodos, se ejecutará en los 3 de nuestros nodos y eliminará cualquier componente de Docker existente y volverá a instalar Docker y ContainerD, así como kubeadm, kubelet y kubectl. Este script también actualizará los paquetes de software existentes en el sistema. `master.vm.provision "shell", path: "scripts/master.sh"` -The master.sh script will only run on the control plane node, this script is going to create the Kubernetes cluster using kubeadm commands. It will also prepare the config context for access to this cluster which we will cover next. +El script master.sh solo se ejecutará en el nodo del plano de control, este script creará el clúster de Kubernetes utilizando comandos de kubeadm. También preparará el contexto de configuración para acceder a este clúster, lo cual veremos a continuación. `node.vm.provision "shell", path: "scripts/node.sh"` -This is simply going to take the config created by the master and join our nodes to the Kubernetes cluster, this join process again uses kubeadm and another script which can be found in the config folder. +Esto simplemente tomará la configuración creada por el nodo maestro y unirá nuestros nodos al clúster de Kubernetes. Este proceso de unión también utiliza kubeadm y otro script que se puede encontrar en la carpeta de configuración. -### Access to the Kubernetes cluster +### Acceso al clúster de Kubernetes -Now we have two clusters deployed we have the minikube cluster that we deployed in the previous section and we have the new 3 node cluster we just deployed to VirtualBox. +Ahora que tenemos dos clústeres desplegados, el clúster minikube que desplegamos en la sección anterior y el nuevo clúster de 3 nodos que acabamos de desplegar en VirtualBox. -Also, that config file that you will also have access to on the machine, you ran vagrant from consists of how we can gain access to our cluster from our workstation. +Además, ese archivo de configuración al que también tendrás acceso en la máquina desde la que ejecutaste Vagrant, consiste en cómo podemos acceder a nuestro clúster desde nuestro puesto de trabajo. -Before we show that let me touch on the context. +Antes de mostrar eso, permíteme hablar sobre el contexto. ![](Images/Day52_Kubernetes5.png) -Context is important, the ability to access your Kubernetes cluster from your desktop or laptop is required. Lots of different options out there and people use different operating systems as their daily drivers. +El contexto es importante, se requiere la capacidad de acceder a tu clúster de Kubernetes desde tu escritorio o portátil. Hay muchas opciones diferentes y las personas utilizan diferentes sistemas operativos como sus controladores diarios. -By default, the Kubernetes CLI client (kubectl) uses the C:\Users\username\.kube\config to store the Kubernetes cluster details such as endpoint and credentials. If you have deployed a cluster you will be able to see this file in that location. But if you have been using maybe the master node to run all of your kubectl commands so far via SSH or other methods then this post will hopefully help you get to grips with being able to connect with your workstation. +Por defecto, el cliente de línea de comandos de Kubernetes (kubectl) utiliza el archivo C:\Users\nombredeusuario.kube\config para almacenar los detalles del clúster de Kubernetes, como el punto final y las credenciales. Si has desplegado un clúster, podrás ver este archivo en esa ubicación. Pero si hasta ahora has estado utilizando quizás el nodo maestro para ejecutar todos tus comandos de kubectl a través de SSH u otros métodos, esta publicación espero que te ayude a familiarizarte con la capacidad de conectarte desde tu estación de trabajo. -We then need to grab the kubeconfig file from the cluster or we can also get this from our config file once deployed, grab the contents of this file either via SCP or just open a console session to your master node and copy to the local windows machine. +Luego debemos obtener el archivo kubeconfig del clúster, o también podemos obtenerlo de nuestro archivo de configuración una vez desplegado, obtener el contenido de este archivo ya sea mediante SCP o simplemente abrir una sesión de consola en tu nodo maestro y copiarlo a la máquina local de Windows. ![](Images/Day52_Kubernetes6.png) -We then want to take a copy of that config file and move it to our `$HOME/.kube/config` location. +Luego queremos hacer una copia de ese archivo de configuración y moverlo a nuestra ubicación $HOME/.kube/config. ![](Images/Day52_Kubernetes7.png) -Now from your local workstation, you will be able to run `kubectl cluster-info` and `kubectl get nodes` to validate that you have access to your cluster. +Ahora, desde tu estación de trabajo local, podrás ejecutar `kubectl cluster-info` y `kubectl get nodes` para validar que tienes acceso a tu clúster. ![](Images/Day52_Kubernetes8.png) -This not only allows for connectivity and control from your windows machine but this then also allows us to do some port forwarding to access certain services from our windows machine +Esto no solo permite la conectividad y el control desde tu máquina con Windows, sino que también nos permite realizar un reenvío de puertos para acceder a ciertos servicios desde nuestra máquina con Windows. -If you are interested in how you would manage multiple clusters on your workstation then I have a more detailed walkthrough [here](https://vzilla.co.uk/vzilla-blog/building-the-home-lab-kubernetes-playground-part-6). +Si te interesa saber cómo gestionar múltiples clústeres en tu estación de trabajo, tengo un tutorial más detallado [aquí](https://vzilla.co.uk/vzilla-blog/building-the-home-lab-kubernetes-playground-part-6). + +He añadido esta lista de blogs explicativos que he realizado sobre el despliegue de diferentes clústeres de Kubernetes. -I have added this list which are walkthrough blogs I have done around different Kubernetes clusters being deployed. - [Kubernetes playground – How to choose your platform](https://vzilla.co.uk/vzilla-blog/building-the-home-lab-kubernetes-playground-part-1) - [Kubernetes playground – Setting up your cluster](https://vzilla.co.uk/vzilla-blog/building-the-home-lab-kubernetes-playground-part-2) @@ -147,26 +148,13 @@ I have added this list which are walkthrough blogs I have done around different - [Getting started with CIVO Cloud](https://vzilla.co.uk/vzilla-blog/getting-started-with-civo-cloud) - [Minikube - Kubernetes Demo Environment For Everyone](https://vzilla.co.uk/vzilla-blog/project_pace-kasten-k10-demo-environment-for-everyone) -### What we will cover in the series on Kubernetes +## Recursos -We have started covering some of these mentioned below but we are going to get more hands-on tomorrow with our second cluster deployment then we can start deploying applications into our clusters. - -- Kubernetes Architecture -- Kubectl Commands -- Kubernetes YAML -- Kubernetes Ingress -- Kubernetes Services -- Helm Package Manager -- Persistent Storage -- Stateful Apps - -## Resources - -If you have FREE resources that you have used then please feel free to add them here via a PR to the repository and I will be happy to include them. +Si tienes recursos GRATUITOS que has utilizado, no dudes en añadirlos aquí mediante un PR (Pull Request) al repositorio y estaré encantado de incluirlos. - [Kubernetes Documentation](https://kubernetes.io/docs/home/) - [TechWorld with Nana - Kubernetes Tutorial for Beginners [FULL COURSE in 4 Hours]](https://www.youtube.com/watch?v=X48VuDVv0do) - [TechWorld with Nana - Kubernetes Crash Course for Absolute Beginners](https://www.youtube.com/watch?v=s_o8dwzRlu4) - [Kunal Kushwaha - Kubernetes Tutorial for Beginners | What is Kubernetes? Architecture Simplified!](https://www.youtube.com/watch?v=KVBON1lA9N8) -See you on [Day 53](day53.md) +Nos vemos en el [Día 53](day53.md) From 79d5cca1db829200173ba1a38a8d5d5540394b64 Mon Sep 17 00:00:00 2001 From: Manuel Vergara Date: Wed, 17 May 2023 23:20:49 +0200 Subject: [PATCH 3/9] Translated to Spanish the day53 file Signed-off-by: Manuel Vergara --- 2022/es/Days/day53.md | 79 +++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 45 deletions(-) diff --git a/2022/es/Days/day53.md b/2022/es/Days/day53.md index 94cb811..886f74a 100644 --- a/2022/es/Days/day53.md +++ b/2022/es/Days/day53.md @@ -1,76 +1,78 @@ -## Rancher Overview - Hands On +## Visión general de Rancher - Práctica -In this section we are going to take a look at Rancher, so far everything we have done has been in the cli and using kubectl but we have a few good UIs and multi-cluster management tools to give our operations teams good visibility into our cluster management. +En esta sección vamos a echar un vistazo a Rancher. Hasta ahora, todo lo que hemos hecho ha sido en la línea de comandos (CLI) y usando `kubectl`, pero tenemos algunas buenas interfaces de usuario (UI) y herramientas de gestión de múltiples clústeres para proporcionar a nuestros equipos de operaciones una buena visibilidad de la gestión de nuestros clústeres. -Rancher is according to their [site](https://rancher.com/) +Según su [sitio web](https://rancher.com/): -> Rancher is a complete software stack for teams adopting containers. It addresses the operational and security challenges of managing multiple Kubernetes clusters across any infrastructure while providing DevOps teams with integrated tools for running containerized workloads. +> Rancher es una pila de software completa para equipos que adoptan contenedores. Aborda los desafíos operativos y de seguridad de la gestión de múltiples clústeres de Kubernetes en cualquier infraestructura, al tiempo que proporciona a los equipos de DevOps herramientas integradas para ejecutar cargas de trabajo en contenedores. -Rancher enables us to deploy production-grade Kubernetes clusters from pretty much any location and then provides centralised authentication, access control and observability. I mentioned in a previous section that there is almost an overwhelming choice when it comes to Kubernetes and where you should or could run them, looking at Rancher it doesn't matter where they are. +Rancher nos permite implementar clústeres de Kubernetes de nivel de producción desde casi cualquier ubicación, y luego proporciona autenticación centralizada, control de acceso y observabilidad. Mencioné en una sección anterior que hay casi una abrumadora cantidad de opciones cuando se trata de Kubernetes y dónde se debería o podría ejecutar, pero con Rancher no importa dónde estén. -### Deploy Rancher +### Implementar Rancher + +Lo primero que debemos hacer es implementar Rancher en nuestra estación de trabajo local. Hay algunas formas y ubicaciones que puedes elegir para realizar este paso. En mi caso, quiero usar mi estación de trabajo local y ejecutar Rancher como un contenedor de Docker. Al ejecutar el siguiente comando, descargaremos una imagen de contenedor y luego tendremos acceso a la interfaz de usuario de Rancher. + +También están disponibles otros métodos de implementación de Rancher. Puedes consultar la [Guía de inicio rápido de Rancher](https://rancher.com/docs/rancher/v2.6/en/quick-start-guide/deployment/). -The first thing we need to do is deploy Rancher on our local workstation, there are a few ways and locations you can choose to proceed with this step, for me I want to use my local workstation and run rancher as a docker container. By running the command below we will pull down a container image and then have access to the rancher UI. -Other rancher deployment methods are available [Rancher Quick-Start-Guide](https://rancher.com/docs/rancher/v2.6/en/quick-start-guide/deployment/) `sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 --privileged rancher/rancher` -As you can see in our Docker Desktop we have a running rancher container. +Como puedes ver en nuestro Docker Desktop, tenemos un contenedor de Rancher en ejecución. ![](Images/Day53_Kubernetes1.png) -### Accessing Rancher UI +### Acceder a la interfaz de usuario de Rancher -With the above container running we should be able to navigate to it via a web page. `https://localhost` will bring up a login page as per below. +Con el contenedor anterior en ejecución, deberíamos poder acceder a él a través de una página web. Acceder a `https://localhost` nos mostrará una página de inicio de sesión como se muestra a continuación. ![](Images/Day53_Kubernetes2.png) -Follow the instructions below to get the password required. Because I am using Windows I chose to use bash for Windows because of the grep command required. +Sigue las instrucciones a continuación para obtener la contraseña requerida. Como estoy usando Windows, elegí usar bash para Windows debido al comando `grep` necesario. ![](Images/Day53_Kubernetes3.png) -We can then take the above password and log in, the next page is where we can define a new password. +Luego podemos tomar la contraseña anterior e iniciar sesión. La siguiente página es donde podemos definir una nueva contraseña. ![](Images/Day53_Kubernetes4.png) -Once we have done the above we will then be logged in and we can see our opening screen. As part of the Rancher deployment, we will also see a local K3s cluster provisioned. +Una vez que hayamos hecho lo anterior, iniciaremos sesión y podremos ver nuestra pantalla de inicio. Como parte de la implementación de Rancher, también veremos un clúster local de K3s creado. ![](Images/Day53_Kubernetes5.png) -### A quick tour of rancher +### un recorrido rápido por rancher -The first thing for us to look at is our locally deployed K3S cluster You can see below that we get a good visual of what is happening inside our cluster. This is the default deployment and we have not yet deployed anything to this cluster. You can see it is made up of 1 node and has 5 deployments. Then you can also see that there are some stats on pods, cores and memory. +Lo primero que veremos es nuestro clúster K3S implementado localmente. Como se muestra a continuación, obtendremos una buena visualización de lo que está sucediendo dentro de nuestro clúster. Esta es la implementación predeterminada y aún no hemos implementado nada en este clúster. Podemos ver que está compuesto por 1 nodo y tiene 5 implementaciones. También podemos ver algunas estadísticas sobre pods, núcleos y memoria. ![](Images/Day53_Kubernetes6.png) -On the left-hand menu, we also have an Apps & Marketplace tab, this allows us to choose applications we would like to run on our clusters, as mentioned previously Rancher gives us the capability of running or managing several different clusters. With the marketplace, we can deploy our applications very easily. +En el menú de la izquierda, también tenemos una pestaña "Apps & Marketplace" (Aplicaciones y Mercado). Esto nos permite elegir las aplicaciones que queremos ejecutar en nuestros clústeres. Como se mencionó anteriormente, Rancher nos brinda la capacidad de ejecutar o administrar varios clústeres diferentes. Con el marketplace, podemos implementar nuestras aplicaciones de manera muy sencilla. ![](Images/Day53_Kubernetes7.png) -Another thing to mention is that if you did need to get access to any cluster being managed by Rancher in the top right you can open a kubectl shell to the selected cluster. +Otra cosa importante es que, si necesitamos acceder a cualquier clúster administrado por Rancher, podemos abrir una shell de kubectl en el clúster seleccionado. ![](Images/Day53_Kubernetes8.png) -### Create a new cluster +### Crear un nuevo clúster -Over the past two sessions, we have created a minikube cluster locally and we have used Vagrant with VirtualBox to create a 3 node Kubernetes cluster, with Rancher we can also create clusters. In the [Rancher Folder](Kubernetes/Rancher) you will find additional vagrant files that will build out the same 3 nodes but without the steps for creating our Kubernetes cluster (we want Rancher to do this for us) +En las últimas dos sesiones, hemos creado un clúster de minikube localmente y hemos utilizado Vagrant con VirtualBox para crear un clúster de Kubernetes de 3 nodos. Con Rancher, también podemos crear clústeres. En la [carpeta Rancher](Kubernetes/Rancher) encontrarás archivos adicionales de Vagrant que crearán los mismos 3 nodos, pero sin los pasos para crear nuestro clúster de Kubernetes (queremos que Rancher lo haga por nosotros). -We do however want docker installed and for the OS to be updated so you will still see the `common.sh` script being run on each of our nodes. This will also install Kubeadm, Kubectl etc. But it will not run the Kubeadm commands to create and join our nodes into a cluster. +Sin embargo, es necesario tener Docker instalado y actualizar el sistema operativo. Aún verás que se ejecuta el script common.sh en cada uno de nuestros nodos. Esto también instalará Kubeadm, Kubectl, etc., pero no ejecutará los comandos de Kubeadm para crear y unir nuestros nodos en un clúster. -We can navigate to our vagrant folder location and we can simply run `vagrant up` and this will begin the process of creating our 3 VMs in VirtualBox. +Podemos ir a la ubicación de nuestra carpeta de Vagrant y simplemente ejecutar vagrant up para comenzar el proceso de creación de nuestras 3 máquinas virtuales en VirtualBox. ![](Images/Day53_Kubernetes9.png) -Now that we have our nodes or VMs in place and ready, we can then use Rancher to create our new Kubernetes cluster. The first screen to create your cluster gives you some options as to where your cluster is, i.e are you using the public cloud managed Kubernetes services, vSphere or something else. +Ahora que tenemos nuestros nodos o máquinas virtuales en su lugar y listos, podemos usar Rancher para crear nuestro nuevo clúster de Kubernetes. La primera pantalla para crear tu clúster te ofrece algunas opciones sobre dónde se encuentra tu clúster, es decir, si estás utilizando servicios administrados de Kubernetes en la nube pública, vSphere o cualquier otra opción integrada. ![](Images/Day53_Kubernetes10.png) -We will be choosing "custom" as we are not using one of the integrated platforms. The opening page is where you define your cluster name (it says local below but you cannot use local, our cluster is called vagrant.) you can define Kubernetes versions here, network providers and some other configuration options to get your Kubernetes cluster up and running. +eleccionaremos "custom" ya que no estamos utilizando una de las plataformas integradas. La página de apertura es donde puedes definir el nombre de tu clúster (dice "local" a continuación, pero no puedes usar "local"; nuestro clúster se llama "vagrant"). Aquí puedes definir las versiones de Kubernetes, los proveedores de red y algunas otras opciones de configuración para poner en marcha tu clúster de Kubernetes. ![](Images/Day53_Kubernetes11.png) -The next page is going to give you the registration code that needs to be run on each of your nodes with the appropriate services to be enabled. etcd, control-plane and worker. For our master node, we want etcd and control-plane so the command can be seen below. +La siguiente página te proporcionará el código de registro que debe ejecutarse en cada uno de tus nodos con los servicios apropiados habilitados: etcd, control-plane y worker. Para nuestro nodo maestro, queremos habilitar etcd y control-plane, por lo que el comando se muestra a continuación. ![](Images/Day53_Kubernetes12.png) @@ -78,11 +80,11 @@ The next page is going to give you the registration code that needs to be run on sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.6.3 --server https://10.0.0.1 --token mpq8cbjjwrj88z4xmf7blqxcfmwdsmq92bmwjpphdkklfckk5hfwc2 --ca-checksum a81944423cbfeeb92be0784edebba1af799735ebc30ba8cbe5cc5f996094f30b --etcd --controlplane ``` -If networking is configured correctly then you should pretty quickly see the following in your rancher dashboard, indicating that the first master node is now being registered and the cluster is being created. +Si la configuración de la red está correctamente, deberías ver rápidamente lo siguiente en tu panel de Rancher, lo que indica que el primer nodo maestro se está registrando y se está creando el clúster. ![](Images/Day53_Kubernetes13.png) -We can then repeat the registration process for each of the worker nodes with the following command and after some time you will have your cluster up and running with the ability to leverage the marketplace to deploy your applications. +Luego, podemos repetir el proceso de registro para cada uno de los nodos de trabajo con el siguiente comando, y después de algún tiempo, tendrás tu clúster funcionando y podrás aprovechar el mercado para implementar tus aplicaciones. ``` sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.6.3 --server https://10.0.0.1 --token mpq8cbjjwrj88z4xmf7blqxcfmwdsmq92bmwjpphdkklfckk5hfwc2 --ca-checksum a81944423cbfeeb92be0784edebba1af799735ebc30ba8cbe5cc5f996094f30b --worker @@ -90,30 +92,17 @@ sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kube ![](Images/Day53_Kubernetes14.png) -Over the last 3 sessions, we have used a few different ways to get up and running with a Kubernetes cluster, over the remaining days we are going to look at the application side of the platform arguably the most important. We will look into services and being able to provision and use our service in Kubernetes. +Durante las últimas 3 sesiones, hemos utilizado diferentes formas para poner en marcha un clúster de Kubernetes. En los días restantes, vamos a centrarnos en el lado de la aplicación de la plataforma, que es posiblemente el aspecto más importante. Analizaremos los servicios y la capacidad de aprovisionar y utilizar nuestros servicios en Kubernetes. -I have been told since that the requirements around bootstrapping rancher nodes require those VMs to have 4GB ram or they will crash-loop, I have since updated as our worker nodes had 2GB. +Me han informado que los requisitos para el inicio de los nodos de Rancher requieren que esas VM tengan 4 GB de RAM o entrarán en un bucle de reinicio. Desde entonces, he actualizado los nodos de trabajo, ya que tenían 2 GB. -### What we will cover in the series on Kubernetes +## Recursos -We have started covering some of these mentioned below but we are going to get more hands-on tomorrow with our second cluster deployment then we can start deploying applications into our clusters. - -- Kubernetes Architecture -- Kubectl Commands -- Kubernetes YAML -- Kubernetes Ingress -- Kubernetes Services -- Helm Package Manager -- Persistent Storage -- Stateful Apps - -## Resources - -If you have FREE resources that you have used then please feel free to add them here via a PR to the repository and I will be happy to include them. +Si tienes recursos GRATUITOS que has utilizado, por favor, siéntete libre de agregarlos aquí mediante una solicitud de extracción (PR) al repositorio, y estaré encantado de incluirlos. - [Kubernetes Documentation](https://kubernetes.io/docs/home/) - [TechWorld with Nana - Kubernetes Tutorial for Beginners [FULL COURSE in 4 Hours]](https://www.youtube.com/watch?v=X48VuDVv0do) - [TechWorld with Nana - Kubernetes Crash Course for Absolute Beginners](https://www.youtube.com/watch?v=s_o8dwzRlu4) - [Kunal Kushwaha - Kubernetes Tutorial for Beginners | What is Kubernetes? Architecture Simplified!](https://www.youtube.com/watch?v=KVBON1lA9N8) -See you on [Day 54](day54.md) +Nos vemos en el [Día 54](day54.md) From bb69fbe892f5f47e3b2898a045377c5834510433 Mon Sep 17 00:00:00 2001 From: Manuel Vergara Date: Thu, 18 May 2023 08:30:37 +0200 Subject: [PATCH 4/9] Translated to Spanish the day54 file Signed-off-by: Manuel Vergara --- 2022/es/Days/day54.md | 125 ++++++++++++++++++++---------------------- 1 file changed, 59 insertions(+), 66 deletions(-) diff --git a/2022/es/Days/day54.md b/2022/es/Days/day54.md index b4f18f3..04b1b30 100644 --- a/2022/es/Days/day54.md +++ b/2022/es/Days/day54.md @@ -1,26 +1,28 @@ -## Kubernetes Application Deployment +## Implementación de aplicaciones en Kubernetes -Now we finally get to deploying some applications into our clusters, some would say this is the reason Kubernetes exists, for Application delivery. +Ahora finalmente vamos a implementar algunas aplicaciones en nuestros clústeres, algunos podrían decir que esta es la razón por la cual Kubernetes existe, para la entrega de aplicaciones. -The idea here is that we can take our container images and now deploy these as pods into our Kubernetes cluster to take advantage of Kubernetes as a container orchestrator. +La idea aquí es que podemos tomar nuestras imágenes de contenedor y desplegarlas como pods en nuestro clúster de Kubernetes para aprovechar Kubernetes como un orquestador de contenedores. -### Deploying Apps into Kubernetes +### Implementación de aplicaciones en Kubernetes -There are several ways in which we can deploy our applications into our Kubernetes cluster, we will cover two of the most common approaches which will be YAML files and Helm charts. +Existen varias formas en las que podemos implementar nuestras aplicaciones en nuestro clúster de Kubernetes, cubriremos dos de los enfoques más comunes que son archivos YAML y gráficos Helm. -We will be using our minikube cluster for these application deployments. We will be walking through some of the previously mentioned components or building blocks of Kubernetes. +Utilizaremos nuestro clúster minikube para estas implementaciones de aplicaciones. Repasaremos algunos de los componentes o bloques de construcción de Kubernetes mencionados anteriormente. -All through this section and the Container section we have discussed images and the benefits of Kubernetes and how we can handle scale quite easily on this platform. +En esta sección y la sección de Contenedores, hemos discutido las imágenes y los beneficios de Kubernetes, y cómo podemos manejar fácilmente la escala en esta plataforma. -In this first step, we are simply going to create a stateless application within our minikube cluster. We will be using the defacto standard stateless application in our first demonstration `nginx` we will configure a Deployment, which will provide us with our pods and then we will also create a service which will allow us to navigate to the simple web server hosted by the nginx pod. All of this will be contained in a namespace. +En este primer paso, simplemente vamos a crear una aplicación sin estado dentro de nuestro clúster minikube. Utilizaremos la aplicación sin estado de facto estándar en nuestra primera demostración: `nginx`. Configuraremos una Implementación (Deployment), que nos proporcionará nuestros pods, y luego también crearemos un servicio que nos permitirá acceder al servidor web simple alojado por el pod de nginx. Todo esto estará contenido en un espacio de nombres. ![](Images/Day54_Kubernetes1.png) ### Creating the YAML -In the first demo, we want to define everything we do with YAML, we could have a whole section on YAML but I am going to skim over this and leave some resources at the end that will cover YAML in more detail. +Creación del archivo YAML -We could create the following as one YAML file or we could break this down for each aspect of our application, i.e this could be separate files for namespace, deployment and service creation but in this file, below we separate these by using `---` in one file. You can find this file located [here](Kubernetes) (File name:- nginx-stateless-demo.YAML) +En la primera demostración, queremos definir todo lo que hacemos con YAML. Podríamos tener una sección completa sobre YAML, pero voy a pasar por alto esto y dejar algunos recursos al final que cubrirán YAML en más detalle. + +Podemos crear lo siguiente como un archivo YAML o podemos dividir esto en cada aspecto de nuestra aplicación, es decir, podrían ser archivos separados para el espacio de nombres, la implementación y la creación del servicio, pero en este archivo, a continuación, separamos esto usando `---` en un solo archivo. Puede encontrar este archivo ubicado [aquí](Kubernetes) (File name:- nginx-stateless-demo.YAML) ```Yaml apiVersion: v1 @@ -66,113 +68,113 @@ spec: targetPort: 80 ``` -### Checking our cluster +### Verificando nuestro clúster -Before we deploy anything we should just make sure that we have no existing namespaces called `nginx` we can do this by running the `kubectl get namespace` command and as you can see below we do not have a namespace called `nginx` +Antes de implementar cualquier cosa, debemos asegurarnos de que no tengamos ningún espacio de nombres existente llamado `nginx`. Podemos hacer esto ejecutando el comando kubectl get namespace y como puedes ver a continuación, no tenemos un espacio de nombres llamado `nginx`. ![](Images/Day54_Kubernetes2.png) -### Time to deploy our App +### Hora de implementar nuestra aplicación -Now we are ready to deploy our application to our minikube cluster, this same process will work on any other Kubernetes cluster. +Ahora estamos listos para implementar nuestra aplicación en nuestro clúster de minikube, este mismo proceso funcionará en cualquier otro clúster de Kubernetes. -We need to navigate to our YAML file location and then we can run `kubectl create -f nginx-stateless-demo.yaml` which you then see that 3 objects have been created, and we have a namespace, deployment and service. +Necesitamos navegar hasta la ubicación de nuestro archivo YAML y luego podemos ejecutar kubectl `create -f nginx-stateless-demo.yaml`, lo que te mostrará que se han creado 3 objetos, y tenemos un espacio de nombres, una implementación y un servicio. ![](Images/Day54_Kubernetes3.png) -Let's run the command again to see our available namespaces in our cluster `kubectl get namespace` and you can now see that we have our new namespace. +Ejecutemos el comando nuevamente para ver nuestros espacios de nombres disponibles en nuestro clúster `kubectl get namespace` y ahora puedes ver que tenemos nuestro nuevo espacio de nombres. ![](Images/Day54_Kubernetes5.png) -If we then check our namespace for pods using `kubectl get pods -n nginx` you will see that we have 1 pod in a ready and running state. +Si luego verificamos nuestro espacio de nombres para los pods usando `kubectl get pods -n nginx`, verás que tenemos 1 pod en estado listo y en ejecución. ![](Images/Day54_Kubernetes4.png) -We can also check our service is created by running `kubectl get service -n nginx` +También podemos verificar que nuestro servicio se haya creado ejecutando `kubectl get service -n nginx`. ![](Images/Day54_Kubernetes6.png) -Finally, we can then go and check our deployment, the deployment is where and how we keep our desired configuration. +Finalmente, podemos verificar nuestra implementación, la implementación es donde y cómo mantenemos nuestra configuración deseada. ![](Images/Day54_Kubernetes7.png) -The above takes a few commands that are worth knowing but you can also use `kubectl get all -n nginx` to see everything we deployed with that one YAML file. +Lo anterior requiere algunos comandos que vale la pena conocer, pero también puedes usar `kubectl get all -n nginx` para ver todo lo que implementamos con ese archivo YAML. ![](Images/Day54_Kubernetes8.png) -You will notice in the above that we also have a replicaset, in our deployment we define how many replicas of our image we would like to deploy. This was set to 1 initially, but if we wanted to quickly scale our application then we can do these several ways. +Observarás que también tenemos un replicaset en la implementación. En nuestra implementación, definimos cuántas réplicas de nuestra imagen nos gustaría implementar. Inicialmente se estableció en 1, pero si quisiéramos escalar rápidamente nuestra aplicación, podemos hacerlo de varias formas. -We can edit our file using `kubectl edit deployment nginx-deployment -n nginx` which will open a text editor within your terminal and enable you to modify your deployment. +Podemos editar nuestro archivo usando `kubectl edit deployment nginx-deployment -n nginx`, lo cual abrirá un editor de texto dentro de tu terminal y te permitirá modificar tu implementación. ![](Images/Day54_Kubernetes9.png) -Upon saving the above in your text editor within the terminal if there were no issues and the correct formatting was used then you should see additional deployed in your namespace. +Al guardar lo anterior en tu editor de texto dentro de la terminal, si no hubo problemas y se utilizó el formato correcto, deberías ver que se implementan réplicas adicionales en tu espacio de nombres. ![](Images/Day54_Kubernetes10.png) -We can also make a change to the number of replicas using kubectl and the `kubectl scale deployment nginx-deployment --replicas=10 -n nginx` +También podemos realizar un cambio en el número de réplicas utilizando `kubectl scale deployment nginx-deployment --replicas=10 -n nginx`. ![](Images/Day54_Kubernetes11.png) -We can equally use this method to scale our application down back to 1 again if we wish to use either method. I used the edit option but you can also use the scale command above. +Del mismo modo, podemos utilizar este método para reducir la escala de nuestra aplicación nuevamente a 1 si deseamos utilizar cualquiera de los dos métodos. Yo utilicé la opción de edición, pero también puedes usar el comando de escala mencionado anteriormente. ![](Images/Day54_Kubernetes12.png) -Hopefully, here you can see the use case not only are things super fast to spin up and down but we have the ability to quickly scale up and down our applications. If this was a web server we could scale up during busy times and down when the load is quiet. +Espero que aquí puedas ver el caso de uso. No solo es extremadamente rápido iniciar y detener las cosas, sino que también tenemos la capacidad de escalar rápidamente nuestras aplicaciones hacia arriba y hacia abajo. Si esto fuera un servidor web, podríamos escalar durante los momentos de alta demanda y reducirlo cuando la carga sea baja. -### Exposing our app +### Exponiendo nuestra aplicación -But how do we access our web server? +Pero ¿cómo accedemos a nuestro servidor web? -If you look above at our service you will see there is no External IP available so we cannot just open a web browser and expect this to be there magically. For access, we have a few options. +Si observas arriba nuestro servicio, verás que no hay una IP externa disponible, por lo que no podemos abrir un navegador web y esperar que esté ahí mágicamente. Para acceder, tenemos algunas opciones. -**ClusterIP** - The IP you do see is a ClusterIP this is on an internal network on the cluster. Only things within the cluster can reach this IP. +**ClusterIP** - La IP que ves es un ClusterIP, que se encuentra en una red interna del clúster. Solo los elementos dentro del clúster pueden acceder a esta IP. -**NodePort** - Exposes the service on the same port of each of the selected nodes in the cluster using NAT. +**NodePort** - Expone el servicio en el mismo puerto de cada uno de los nodos seleccionados en el clúster utilizando NAT. -**LoadBalancer** - Creates an external load balancer in the current cloud, we are using minikube but also if you have built your own Kubernetes cluster i.e what we did in VirtualBox you would need to deploy a LoadBalancer such as metallb into your cluster to provide this functionality. +**LoadBalancer** - Crea un balanceador de carga externo en la nube actual. Estamos utilizando minikube, pero si has creado tu propio clúster de Kubernetes, como lo hicimos en VirtualBox, necesitarías implementar un balanceador de carga como metallb en tu clúster para proporcionar esta funcionalidad. -**Port-Forward** - We also have the ability to Port Forward, which allows you to access and interact with internal Kubernetes cluster processes from your localhost. This option is only for testing and fault finding. +**Port-Forward** - También tenemos la capacidad de reenvío de puertos, lo que te permite acceder e interactuar con los procesos internos del clúster de Kubernetes desde tu localhost. Esta opción solo se utiliza para pruebas y solución de problemas. -We now have a few options to choose from, Minikube has some limitations or differences I should say to a full-blown Kubernetes cluster. - -We could simply run the following command to port forward our access using our local workstation. +Ahora tenemos algunas opciones para elegir. Minikube tiene algunas limitaciones o diferencias, podríamos simplemente ejecutar el siguiente comando para redirigir nuestro acceso utilizando nuestra estación de trabajo local. `kubectl port-forward deployment/nginx-deployment -n nginx 8090:80` ![](Images/Day54_Kubernetes13.png) -note that when you run the above command this terminal is now unusable as this is acting as your port forward to your local machine and port. +Ten en cuenta que cuando ejecutas el comando anterior, esta terminal ya no es utilizable, ya que actúa como reenvío de puertos a tu máquina local y puerto. ![](Images/Day54_Kubernetes14.png) -We are now going to run through specifically with Minikube how we can expose our application. We can also use minikube to create a URL to connect to a service [More details](https://minikube.sigs.k8s.io/docs/commands/service/) +Ahora vamos a explicar específicamente con Minikube cómo podemos exponer nuestra aplicación. También podemos usar minikube para crear una URL y conectarnos a un servicio [Más detalles](https://minikube.sigs.k8s.io/docs/commands/service/) -First of all, we will delete our service using `kubectl delete service nginx-service -n nginx` +En primer lugar, eliminaremos nuestro servicio usando `kubectl delete service nginx-service -n nginx` -Next, we are going to create a new service using `kubectl expose deployment nginx-deployment --name nginx-service --namespace nginx --port=80 --type=NodePort` notice here that we are going to use the expose and change the type to NodePort. +A continuación, crearemos un nuevo servicio utilizando `kubectl expose deployment nginx-deployment --name nginx-service --namespace nginx --port=80 --type=NodePort`. Observa que aquí estamos usando "expose" y cambiamos el tipo a NodePort. ![](Images/Day54_Kubernetes15.png) -Finally in a new terminal run `minikube --profile='mc-demo' service nginx-service --URL -n nginx` to create a tunnel for our service. +Finalmente, en una nueva terminal, ejecuta `minikube --profile='mc-demo' service nginx-service --URL -n nginx` para crear un túnel para nuestro servicio. ![](Images/Day54_Kubernetes16.png) -Open a browser or control and click on the link in your terminal. +Abre un navegador o haz clic en el enlace en tu terminal. + ![](Images/Day54_Kubernetes17.png) ### Helm -Helm is another way in which we can deploy our applications. Known as "The package manager for Kubernetes" You can find out more [here](https://helm.sh/) +Helm es otra forma en la que podemos implementar nuestras aplicaciones. Conocido como "el administrador de paquetes para Kubernetes". Puedes obtener más información [aquí](https://helm.sh/). -Helm is a package manager for Kubernetes. Helm could be considered the Kubernetes equivalent of yum or apt. Helm deploys charts, which you can think of like a packaged application., it is a blueprint for your pre-configured application resources which can be deployed as one easy-to-use chart. You can then deploy another version of the chart with a different set of configurations. +Helm es un administrador de paquetes para Kubernetes. Se podría considerar que Helm es el equivalente de Kubernetes a yum o apt. Helm implementa gráficos, que puedes pensar como una aplicación empaquetada. Es un modelo para los recursos de tu aplicación preconfigurada, que se pueden implementar como un gráfico fácil de usar. Luego, puedes implementar otra versión del gráfico con un conjunto diferente de configuraciones. -They have a site where you can browse all the Helm charts available and of course, you can create your own. The documentation is also clear and concise and not as daunting as when I first started hearing the term helm amongst all of the other new words in this space. +Tienen un sitio web donde puedes explorar todos los gráficos de Helm disponibles y, por supuesto, puedes crear los tuyos propios. La documentación también es clara y concisa, no es tan abrumadora como cuando escuché el término "helm" por primera vez junto con todas las demás palabras nuevas en este espacio. -It is super simple to get Helm up and running or installed. Simply. You can find the binaries and download links here for pretty much all distributions including your RaspberryPi arm64 devices. +Es muy sencillo poner en marcha o instalar Helm. Simplemente puedes encontrar los binarios y los enlaces de descarga aquí, para prácticamente todas las distribuciones, incluyendo dispositivos Raspberry Pi arm64. + +O puedes utilizar un script de instalación, la ventaja aquí es que se descargará e instalará la última versión de Helm. -Or you can use an installer script, the benefit here is that the latest version of the helm will be downloaded and installed. ```Shell curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 @@ -182,32 +184,23 @@ chmod 700 get_helm.sh ./get_helm.sh ``` -Finally, there is also the option to use a package manager for the application manager, homebrew for mac, chocolatey for windows, apt with Ubuntu/Debian, snap and pkg also. +Finalmente, también existe la opción de utilizar un administrador de paquetes para el administrador de aplicaciones, como Homebrew para Mac, Chocolatey para Windows, apt para Ubuntu/Debian, snap y pkg también. -Helm so far seems to be the go-to way to get different test applications downloaded and installed in your cluster. +Hasta ahora, Helm parece ser la forma preferida de descargar e instalar diferentes aplicaciones de prueba en tu clúster. -A good resource to link here would be [ArtifactHUB](https://artifacthub.io/) which is a resource to find, install and publish Kubernetes packages. I will also give a shout-out to [KubeApps](https://kubeapps.com/) which is a UI to display helm charts. +Un buen recurso para enlazar aquí sería [ArtifactHUB](https://artifacthub.io/), que es un recurso para encontrar, instalar y publicar paquetes de Kubernetes. También quiero mencionar [KubeApps](https://kubeapps.com/), que es una interfaz de usuario para mostrar gráficos de Helm. -### What we will cover in the series on Kubernetes +## Recursos -We have started covering some of these mentioned below but we are going to get more hands-on tomorrow with our second cluster deployment then we can start deploying applications into our clusters. - -- Kubernetes Architecture -- Kubectl Commands -- Kubernetes YAML -- Kubernetes Ingress -- Kubernetes Services -- Helm Package Manager -- Persistent Storage -- Stateful Apps - -## Resources - -If you have FREE resources that you have used then please feel free to add them here via a PR to the repository and I will be happy to include them. +Si tienes recursos GRATUITOS que has utilizado, siéntete libre de agregarlos aquí mediante un PR al repositorio y estaré encantado de incluirlos. - [Kubernetes Documentation](https://kubernetes.io/docs/home/) - [TechWorld with Nana - Kubernetes Tutorial for Beginners [FULL COURSE in 4 Hours]](https://www.youtube.com/watch?v=X48VuDVv0do) - [TechWorld with Nana - Kubernetes Crash Course for Absolute Beginners](https://www.youtube.com/watch?v=s_o8dwzRlu4) - [Kunal Kushwaha - Kubernetes Tutorial for Beginners | What is Kubernetes? Architecture Simplified!](https://www.youtube.com/watch?v=KVBON1lA9N8) +- [Guía Helm](https://gitea.vergaracarmona.es/man-linux/Guia-Tutorial-kubernetes/src/branch/main/guias/05-helm.md) +- [Ejecutar Charts de Helm con helmfile](https://vergaracarmona.es/ejecutar-charts-de-helm-con-helmfile/) +- [Helm Umbrella Charts](https://vergaracarmona.es/helm-umbrella-charts/) +- [Apuntes de curso Helm](https://vergaracarmona.es/wp-content/uploads/2022/12/Curso_Helm_vergaracarmona.es_.pdf) -See you on [Day 55](day55.md) +Nos vemos en el [Día 55](day55.md) From 54fcf68881acd9a51d764147fcd7441479f06690 Mon Sep 17 00:00:00 2001 From: Manuel Vergara Date: Thu, 18 May 2023 08:53:02 +0200 Subject: [PATCH 5/9] Translated to Spanish the day55 file Signed-off-by: Manuel Vergara --- 2022/es/Days/day55.md | 215 +++++++++++++++++++++--------------------- 1 file changed, 108 insertions(+), 107 deletions(-) diff --git a/2022/es/Days/day55.md b/2022/es/Days/day55.md index 21c01df..0048624 100644 --- a/2022/es/Days/day55.md +++ b/2022/es/Days/day55.md @@ -1,216 +1,216 @@ -## State and Ingress in Kubernetes +## Estado e Ingress en Kubernetes -In this closing section of Kubernetes, we are going to take a look at State and ingress. +En esta sección final de Kubernetes, vamos a echar un vistazo al estado e Ingress. -Everything we have said so far is about stateless, stateless is really where our applications do not care which network it is using and does not need any permanent storage. Whereas stateful apps and databases for example for such an application to function correctly, you’ll need to ensure that pods can reach each other through a unique identity that does not change (hostnames, IPs...etc.). Examples of stateful applications include MySQL clusters, Redis, Kafka, MongoDB and others. Basically, through any application that stores data. +Todo lo que hemos dicho hasta ahora es acerca de stateless, stateless es realmente donde nuestras aplicaciones no se preocupan por qué red están utilizando y no necesitan ningún almacenamiento permanente. Mientras que las aplicaciones y bases de datos stateful, por ejemplo, para que dicha aplicación funcione correctamente, deberás asegurarte de que los pods puedan alcanzarse entre sí a través de una identidad única que no cambie (nombres de host, IP, etc.). Ejemplos de aplicaciones stateful incluyen clústeres MySQL, Redis, Kafka, MongoDB y otros. Básicamente, a través de cualquier aplicación que almacene datos. -### Stateful Application +### Aplicación stateful -StatefulSets represent a set of Pods with unique, persistent identities and stable hostnames that Kubernetes maintains regardless of where they are scheduled. The state information and other resilient data for any given StatefulSet Pod are maintained in persistent disk storage associated with the StatefulSet. +StatefulSets representan un conjunto de Pods con identidades únicas y persistentes y nombres de host estables que Kubernetes mantiene independientemente de dónde se programen. La información de estado y otros datos resilientes para cualquier Pod dado de StatefulSet se mantienen en almacenamiento de disco persistente asociado con StatefulSet. -### Deployment vs StatefulSet +### DImplementación frente a StatefulSet -- Replicating stateful applications is more difficult. -- Replicating our pods in a deployment (Stateless Application) is identical and interchangeable. -- Create pods in random order with random hashes -- One Service that load balances to any Pod. +- Replicar aplicaciones stateful es más difícil. +- Replicar nuestros pods en una implementación (aplicación sin estado) es idéntico e intercambiable. +- Crea pods en orden aleatorio con hashes aleatorios +- Un solo servicio que equilibra la carga a cualquier Pod. -When it comes to StatefulSets or Stateful Applications the above is more difficult. +Cuando se trata de StatefulSets o aplicaciones stateful, lo anterior es más difícil. -- Cannot be created or deleted at the same time. -- Can't be randomly addressed. -- replica Pods are not identical +- No se pueden crear ni eliminar al mismo tiempo. +- No se pueden abordar aleatoriamente. +- Los Pods de réplica no son idénticos. -Something you will see in our demonstration shortly is that each pod has its own identity. With a stateless Application, you will see random names. For example `app-7469bbb6d7-9mhxd` whereas a Stateful Application would be more aligned to `mongo-0` and then when scaled it will create a new pod called `mongo-1`. +Algo que verás en nuestra demostración en breve es que cada pod tiene su propia identidad. Con una aplicación stateless, verás nombres aleatorios. Por ejemplo, `app-7469bbb6d7-9mhxd`, mientras que una aplicación stateful estaría más alineada con `mongo-0` y luego, cuando se escala, creará un nuevo pod llamado `mongo-1`. -These pods are created from the same specification, but they are not interchangeable. Each StatefulSet pod has a persistent identifier across any rescheduling. This is necessary because when we require stateful workloads such as a database where we require writing and reading to a database, we cannot have two pods writing at the same time with no awareness as this will give us data inconsistency. We need to ensure that only one of our pods is writing to the database at any given time however we can have multiple pods reading that data. +Estos pods se crean a partir de la misma especificación, pero no son intercambiables. Cada pod de StatefulSet tiene un identificador persistente en cualquier reprogramación. Esto es necesario porque cuando requerimos cargas de trabajo stateful como una base de datos donde requerimos escribir y leer en una base de datos, no podemos tener dos pods escribiendo al mismo tiempo sin conciencia ya que esto nos dará inconsistencia de datos. Necesitamos asegurarnos de que solo uno de nuestros pods esté escribiendo en la base de datos en cualquier momento dado, sin embargo, podemos tener múltiples pods leyendo esos datos. -Each pod in a StatefulSet would have access to its persistent volume and replica copy of the database to read from, this is continuously updated from the master. It's also interesting to note that each pod will also store its pod state in this persistent volume, if then `mongo-0` dies then when a new one is provisioned it will take over the pod state stored in storage. +Cada pod en un StatefulSet tendría acceso a su volumen persistente y copia de réplica de la base de datos para leer, esto se actualiza continuamente desde el maestro. También es interesante destacar que cada pod almacenará su estado de pod en este volumen persistente, si luego `mongo-0` muere, cuando se provisione uno nuevo, tomará el estado de pod almacenado en el almacenamiento. TLDR; StatefulSets vs Deployments -- Predictable pod name = `mongo-0` -- Fixed individual DNS name -- Pod Identity - Retain State, Retain Role -- Replicating stateful apps is complex - - There are lots of things you must do: - - Configure cloning and data synchronisation. - - Make remote shared storage available. - - Management & backup +- Nombre predecible del pod = mongo-0 +- Nombre de DNS individual fijo +- Identidad del pod: Mantener estado, mantener rol +- Replicar aplicaciones con estado es complejo + - Hay muchas cosas que debes hacer: + - Configurar la clonación y la sincronización de datos. + - Hacer que el almacenamiento compartido remoto esté disponible. + - Gestión y copia de seguridad -### Persistant Volumes | Claims | StorageClass +### Volúmenes Persistentes | Reclamaciones | StorageClass -How to persist data in Kubernetes? +¿Cómo persistir datos en Kubernetes? -We mentioned above when we have a stateful application, we have to store the state somewhere and this is where the need for a volume comes in, out of the box Kubernetes does not provide persistence out of the box. +Mencionamos anteriormente que cuando tenemos una aplicación con estado, debemos almacenar el estado en algún lugar y aquí es donde surge la necesidad de un volumen. Por defecto, Kubernetes no proporciona persistencia. -We require a storage layer that does not depend on the pod lifecycle. This storage should be available and accessible from all of our Kubernetes nodes. The storage should also be outside of the Kubernetes cluster to be able to survive even if the Kubernetes cluster crashes. +Necesitamos una capa de almacenamiento que no dependa del ciclo de vida del pod. Este almacenamiento debe estar disponible y accesible desde todos los nodos de Kubernetes. El almacenamiento también debe estar fuera del clúster de Kubernetes para poder sobrevivir incluso si el clúster de Kubernetes falla. -### Persistent Volume +### Volumen Persistente -- A cluster resource (like CPU and RAM) to store data. -- Created via a YAML file -- Needs actual physical storage (NAS) -- External integration to your Kubernetes cluster -- You can have different types of storage available in your storage. -- PVs are not namespaced -- Local storage is available but it would be specific to one node in the cluster -- Database persistence should use remote storage (NAS) +- Un recurso del clúster (como CPU y RAM) para almacenar datos. +- Se crea mediante un archivo YAML. +- Necesita almacenamiento físico real (NAS). +- Integración externa en tu clúster de Kubernetes. +- Puedes tener diferentes tipos de almacenamiento disponibles en tu almacenamiento. +- Los PV no tienen espacio de nombres. +- El almacenamiento local está disponible, pero estaría específico de un nodo en el clúster. +- La persistencia de la base de datos debe usar almacenamiento remoto (NAS). ### Persistent Volume Claim -A persistent volume alone above can be there and available but unless it is claimed by an application it is not being used. +Un volumen persistente por sí solo puede estar disponible, pero a menos que sea reclamado por una aplicación, no se está utilizando. -- Created via a YAML file -- Persistent Volume Claim is used in pod configuration (volumes attribute) -- PVCs live in the same namespace as the pod -- Volume is mounted into the pod -- Pods can have multiple different volume types (ConfigMap, Secret, PVC) +- Se crea mediante un archivo YAML. +- La reclamación de volumen persistente se utiliza en la configuración del pod (atributo de volúmenes). +- Las PVCs (reclamaciones de volumen persistente) se encuentran en el mismo espacio de nombres que el pod. +- El volumen se monta en el pod. +- Los pods pueden tener múltiples tipos de volumen diferentes (ConfigMap, Secret, PVC). -Another way to think of PVs and PVCs is that +Otra forma de pensar en los PV y PVCs es que: -PVs are created by the Kubernetes Admin -PVCs are created by the user or application developer +Los PV son creados por el administrador de Kubernetes. +Los PVCs son creados por el usuario o el desarrollador de la aplicación. -We also have two other types of volumes that we will not get into detail on but are worth mentioning: +También tenemos otros dos tipos de volúmenes de los que no entraremos en detalle pero que vale la pena mencionar ### ConfigMaps | Secrets -- Configuration file for your pod. -- Certificate file for your pod. +- Archivo de configuración para tu pod. +- Archivo de certificado para tu pod. ### StorageClass -- Created via a YAML file -- Provisions Persistent Volumes Dynamically when a PVC claims it -- Each storage backend has its provisioner -- Storage backend is defined in YAML (via provisioner attribute) -- Abstracts underlying storage provider -- Define parameters for that storage +- Se crea mediante un archivo YAML. +- Provee volúmenes persistentes dinámicamente cuando una PVC lo reclama. +- Cada backend de almacenamiento tiene su proveedor. +- El backend de almacenamiento se define en YAML (mediante el atributo provisioner). +- Abstrae al proveedor de almacenamiento subyacente. +- Define parámetros para ese almacenamiento. ### Walkthrough time -In the session yesterday we walked through creating a stateless application, here we want to do the same but we want to use our minikube cluster to deploy a stateful workload. +En la sesión de ayer recorrimos la creación de una aplicación sin estado, ahora queremos hacer lo mismo pero utilizando nuestro clúster de minikube para implementar una carga de trabajo con estado. -A recap on the minikube command we are using to have the capability and addons to use persistence is `minikube start --addons volumesnapshots,csi-hostpath-driver --apiserver-port=6443 --container-runtime=containerd -p mc-demo --Kubernetes-version=1.21.2` +Un resumen del comando de minikube que estamos utilizando para tener la capacidad y complementos para utilizar la persistencia es `minikube start --addons volumesnapshots,csi-hostpath-driver --apiserver-port=6443 --container-runtime=containerd -p mc-demo --Kubernetes-version=1.21.2` -This command uses the CSI-hostpath-driver which is what gives us our storageclass, something I will show later. +Este comando utiliza el controlador CSI-hostpath-driver, que es lo que nos proporciona nuestra clase de almacenamiento, algo que mostraré más adelante. -The build-out of the application looks like the below: +La construcción de la aplicación se ve así: -![](Images/Day55_Kubernetes1.png) +![Day55_Kubernetes1](Images/Day55_Kubernetes1.png) -You can find the YAML configuration file for this application here [pacman-stateful-demo.yaml](Kubernetes) +Puedes encontrar el archivo de configuración YAML de esta aplicación aquí [pacman-stateful-demo.yaml](Kubernetes) -### StorageClass Configuration +### Configuración de StorageClass -There is one more step though that we should run before we start deploying our application and that is to make sure that our storageclass (CSI-hostpath-sc) is our default one. We can firstly check this by running the `kubectl get storageclass` command but out of the box, the minikube cluster will be showing the standard storageclass as default so we have to change that with the following commands. +Sin embargo, hay un paso más que debemos realizar antes de comenzar a implementar nuestra aplicación y es asegurarnos de que nuestra clase de almacenamiento (CSI-hostpath-sc) sea la predeterminada. Podemos verificar esto ejecutando el comando `kubectl get storageclass`, pero de forma predeterminada, el clúster de minikube mostrará la clase de almacenamiento estándar como predeterminada, por lo que debemos cambiarla con los siguientes comandos. -This first command will make our CSI-hostpath-sc storageclass our default. +Este primer comando hará que nuestra clase de almacenamiento CSI-hostpath-sc sea la predeterminada. `kubectl patch storageclass csi-hostpath-sc -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'` -This command will remove the default annotation from the standard StorageClass. +Este comando eliminará la anotación predeterminada de la clase de almacenamiento estándar. `kubectl patch storageclass standard -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'` ![](Images/Day55_Kubernetes2.png) -We start with no Pacman namespace in our cluster. `kubectl get namespace` +Comenzamos sin un espacio de nombres de Pacman en nuestro clúster. `kubectl get namespace` ![](Images/Day55_Kubernetes3.png) -We will then deploy our YAML file. `kubectl create -f pacman-stateful-demo.yaml` you can see from this command we are creating several objects within our Kubernetes cluster. +Luego implementaremos nuestro archivo YAML. `kubectl create -f pacman-stateful-demo.yaml`. Puedes ver que con este comando estamos creando varios objetos dentro de nuestro clúster de Kubernetes. ![](Images/Day55_Kubernetes4.png) -We now have our newly created namespace. +Ahora tenemos nuestro espacio de nombres recién creado. ![](Images/Day55_Kubernetes5.png) -You can then see from the next image and command `kubectl get all -n pacman` that we have several things happening inside of our namespace. We have our pods running our NodeJS web front end, we have mongo running our backend database. There are services for both Pacman and mongo to access those pods. We have a deployment for Pacman and a statefulset for mongo. +A continuación, puedes ver en la siguiente imagen y en el comando `kubectl get all -n pacman` que hay varias cosas sucediendo dentro de nuestro espacio de nombres. Tenemos nuestros pods ejecutando nuestra interfaz web NodeJS, tenemos mongo ejecutando nuestra base de datos de backend. Hay servicios tanto para Pacman como para mongo para acceder a esos pods. Tenemos una implementación para Pacman y un conjunto de estado para mongo. ![](Images/Day55_Kubernetes6.png) -We also have our persistent volume and persistent volume claim by running `kubectl get pv` will give us our non-namespaced persistent volumes and running `kubectl get pvc -n pacman` will give us our namespaced persistent volume claims. +También tenemos nuestro volumen persistente y la solicitud de volumen persistente mediante el comando `kubectl get pv` nos mostrará nuestros volúmenes persistentes sin espacio de nombres y ejecutando `kubectl get pvc -n pacman` nos mostrará nuestras solicitudes de volumen persistente con espacio de nombres. ![](Images/Day55_Kubernetes7.png) -### Playing the game | I mean accessing our mission-critical application +### Jugando el juego | Quiero decir, accediendo a nuestra aplicación crítica -Because we are using Minikube as mentioned in the stateless application we have a few hurdles to get over when it comes to accessing our application, however, we had access to ingress or a load balancer within our cluster the service is set up to automatically get an IP from that to gain access externally. (you can see this above in the image of all components in the Pacman namespace). +Debido a que estamos utilizando Minikube, como se mencionó en la aplicación sin estado, tenemos algunos obstáculos para acceder a nuestra aplicación. Sin embargo, si tenemos acceso a un Ingress o a un balanceador de carga dentro de nuestro clúster, el servicio está configurado para obtener automáticamente una dirección IP de ellos para acceder externamente (puedes ver esto arriba en la imagen de todos los componentes en el espacio de nombres de Pacman). -For this demo, we are going to use the port forward method to access our application. By opening a new terminal and running the following `kubectl port-forward svc/pacman 9090:80 -n pacman` command, opening a browser we will now have access to our application. If you are running this in AWS or specific locations then this will also report on the cloud and zone as well as the host which equals your pod within Kubernetes, again you can look back and see this pod name in our screenshots above. +Para esta demostración, vamos a utilizar el método de "port forwarding" para acceder a nuestra aplicación. Abriendo una nueva terminal y ejecutando el siguiente comando `kubectl port-forward svc/pacman 9090:80 -n pacman`, al abrir un navegador ahora tendremos acceso a nuestra aplicación. Si estás ejecutando esto en AWS u otras ubicaciones específicas, también se mostrará la nube y la zona, así como el host que corresponde a tu pod dentro de Kubernetes, nuevamente puedes volver atrás y ver este nombre de pod en nuestras capturas de pantalla anteriores. -![](Images/Day55_Kubernetes8.png) +![Day55_Kubernetes8](Images/Day55_Kubernetes8.png) -Now we can go and create a high score which will then be stored in our database. +Ahora podemos ir y crear una puntuación alta que luego se almacenará en nuestra base de datos. -![](Images/Day55_Kubernetes9.png) +![Day55_Kubernetes9](Images/Day55_Kubernetes9.png) -Ok, great we have a high score but what happens if we go and delete our `mongo-0` pod? by running `kubectl delete pod mongo-0 -n pacman` I can delete that and if you are still in the app you will see that high score not available at least for a few seconds. +¡Ok, genial! Tenemos una puntuación alta, pero ¿qué sucede si eliminamos nuestro pod `mongo-0`? ejecutando `kubectl delete pod mongo-0 -n pacman` puedo eliminarlo y si aún estás en la aplicación, verás que la puntuación alta no estará disponible, al menos por unos segundos. -![](Images/Day55_Kubernetes10.png) +![Day55_Kubernetes10](Images/Day55_Kubernetes10.png) -Now if I go back to my game I can create a new game and see my high scores. The only way you can truly believe me on this though is if you give it a try and share on social media your high scores! +Ahora, si vuelvo a mi juego, puedo crear un nuevo juego y ver mis puntuaciones altas. La única forma en que realmente puedas creerme es si lo intentas tú mismo y compartes tus puntuaciones altas en las redes sociales. -![](Images/Day55_Kubernetes11.png) +![Day55_Kubernetes11](Images/Day55_Kubernetes11.png) -With the deployment, we can scale this up using the commands that we covered in the previous session but in particular here, especially if you want to host a huge Pacman party then you can scale this up using `kubectl scale deployment pacman --replicas=10 -n pacman` +Con la implementación, podemos aumentar la escala utilizando los comandos que vimos en la sesión anterior, pero en particular aquí, especialmente si quieres organizar una gran fiesta de Pacman, puedes escalar esto usando `kubectl scale deployment pacman --replicas=10 -n pacman` -![](Images/Day55_Kubernetes12.png) +![Day55_Kubernetes12](Images/Day55_Kubernetes12.png) -### Ingress explained +### Explicación de Ingress -Before we wrap things up with Kubernetes I also wanted to touch on a huge aspect of Kubernetes and that is ingress. +Antes de terminar con Kubernetes, también quería mencionar un aspecto importante de Kubernetes: Ingress. -### What is ingress? +### ¿Qué es Ingress? -So far with our examples, we have used port-forward or we have used specific commands within minikube to gain access to our applications but this in production is not going to work. We are going to want a better way of accessing our applications at scale with multiple users. +Hasta ahora, con nuestros ejemplos, hemos utilizado "port-forward" o hemos utilizado comandos específicos dentro de Minikube para acceder a nuestras aplicaciones, pero esto no funcionará en producción. Queremos una mejor forma de acceder a nuestras aplicaciones a gran escala con múltiples usuarios. -We also spoke about NodePort being an option but again this should be only for test purposes. +También hemos hablado sobre NodePort como una opción, pero nuevamente, esto debería ser solo para fines de prueba. -Ingress gives us a better way of exposing our applications, this allows us to define routing rules within our Kubernetes cluster. +Ingress nos proporciona una mejor forma de exponer nuestras aplicaciones, lo cual nos permite definir reglas de enrutamiento dentro de nuestro clúster de Kubernetes. -For ingress, we would create a forward request to the internal service of our application. +Con Ingress, crearíamos una solicitud de reenvío hacia el servicio interno de nuestra aplicación. -### When do you need ingress? +### ¿Cuándo necesitas Ingress? -If you are using a cloud provider, a managed Kubernetes offering they most likely will have their ingress option for your cluster or they provide you with their load balancer option. You don't have to implement this yourself, one of the benefits of managed Kubernetes. +Si estás utilizando un proveedor de servicios en la nube que ofrece Kubernetes administrado, es muy probable que tengan su opción de Ingress para tu clúster o te proporcionen su opción de balanceador de carga. No necesitas implementar esto tú mismo, es uno de los beneficios de Kubernetes administrado. -If you are running your cluster then you will need to configure an entrypoint. +Si estás ejecutando tu propio clúster, entonces deberás configurar un punto de entrada. -### Configure Ingress on Minikube +### Configurar Ingress en Minikube -On my particular running cluster called mc-demo, I can run the following command to get ingress enabled on my cluster. +En mi clúster en ejecución llamado "mc-demo", puedo ejecutar el siguiente comando para habilitar Ingress en mi clúster. `minikube --profile='mc-demo' addons enable ingress` ![](Images/Day55_Kubernetes13.png) -If we check our namespaces now you will see that we have a new ingress-nginx namespace. `kubectl get ns` +Si verificamos nuestros espacios de nombres ahora, verás que tenemos un nuevo espacio de nombres "ingress-nginx". `kubectl get ns` ![](Images/Day55_Kubernetes14.png) -Now we must create our ingress YAML configuration to hit our Pacman service I have added this file to the repository [pacman-ingress.yaml](Kubernetes) +Ahora debemos crear nuestra configuración YAML de Ingress para acceder a nuestro servicio Pacman. He agregado este archivo al repositorio [pacman-ingress.yaml](Kubernetes) -We can then create this in our ingress namespace with `kubectl create -f Pacman-ingress.yaml` +Luego, podemos crear esto en nuestro espacio de nombres "ingress" con `kubectl create -f Pacman-ingress.yaml` ![](Images/Day55_Kubernetes15.png) -Then if we run `kubectl get ingress -n Pacman +Luego, si ejecutamos `kubectl get ingress -n Pacman ![](Images/Day55_Kubernetes16.png) -I am then told because we are using minikube running on WSL2 in Windows we have to create the minikube tunnel using `minikube tunnel --profile=mc-demo` +Luego se me informa que, debido a que estamos utilizando Minikube en WSL2 en Windows, debemos crear el túnel de Minikube usando `minikube tunnel --profile=mc-demo` -But I am still not able to gain access to 192.168.49.2 and play my Pacman game. +Pero aún no puedo acceder a 192.168.49.2 y jugar a mi juego de Pacman. -If anyone has or can get this working on Windows and WSL I would appreciate the feedback. I will raise an issue on the repository for this and come back to it once I have time and a fix. +Si alguien lo ha logrado o puede hacerlo funcionar en Windows y WSL, agradecería los comentarios. Abriré un problema en el repositorio para esto y volveré a él una vez que tenga tiempo y una solución. -UPDATE: I feel like this blog helps identify maybe the cause of this not working with WSL [Configuring Ingress to run Minikube on WSL2 using Docker runtime](https://hellokube.dev/posts/configure-minikube-ingress-on-wsl2/) +ACTUALIZACIÓN: Siento que este blog ayuda a identificar quizás la causa de que esto no funcione con WSL [Configuring Ingress to run Minikube on WSL2 using Docker runtime](https://hellokube.dev/posts/configure-minikube-ingress-on-wsl2/) -## Resources +## Recursos If you have FREE resources that you have used then please feel free to add them here via a PR to the repository and I will be happy to include them. @@ -221,9 +221,10 @@ If you have FREE resources that you have used then please feel free to add them - [TechWorld with Nana - Kubernetes Tutorial for Beginners [FULL COURSE in 4 Hours]](https://www.youtube.com/watch?v=X48VuDVv0do) - [TechWorld with Nana - Kubernetes Crash Course for Absolute Beginners](https://www.youtube.com/watch?v=s_o8dwzRlu4) - [Kunal Kushwaha - Kubernetes Tutorial for Beginners | What is Kubernetes? Architecture Simplified!](https://www.youtube.com/watch?v=KVBON1lA9N8) +- [WSL2 - Windows corriendo contenedores Linux??](https://youtu.be/_Hne4gm8plo) -This wraps up our Kubernetes section, there is so much additional content we could cover on Kubernetes and 7 days gives us foundational knowledge but people are running through [100DaysOfKubernetes](https://100daysofkubernetes.io/overview.html) where you can get really into the weeds. +Aquí concluye la sección de Kubernetes, hay mucho contenido adicional que podríamos ver sobre Kubernetes y 7 días nos brinda conocimientos fundamentales, pero hay personas que están pasando por [100DaysOfKubernetes](https://100daysofkubernetes.io/overview.html) donde se puede profundizar más. -Next up we are going to be taking a look at Infrastructure as Code and the important role it plays from a DevOps perspective. +A continuación, vamos a echar un vistazo a la Infraestructura como Código y el papel importante que desempeña desde una perspectiva de DevOps. -See you on [Day 56](day56.md) +Nos vemos en el [Día 56](day56.md) From e608ab2d2497b96ce9bf3ddb443d6241c2e88427 Mon Sep 17 00:00:00 2001 From: Manuel Vergara Date: Thu, 18 May 2023 09:05:44 +0200 Subject: [PATCH 6/9] Translated to Spanish the day56 file Signed-off-by: Manuel Vergara --- 2022/es/Days/day56.md | 136 +++++++++++++++++++++--------------------- 1 file changed, 69 insertions(+), 67 deletions(-) diff --git a/2022/es/Days/day56.md b/2022/es/Days/day56.md index ee873ac..0e3dd2d 100644 --- a/2022/es/Days/day56.md +++ b/2022/es/Days/day56.md @@ -1,113 +1,114 @@ -## The Big Picture: IaC +## El panorama: IaC -Humans make mistakes! Automation is the way to go! +¡Los humanos cometen errores! ¡La automatización es el camino a seguir! -How do you build your systems today? +¿Cómo construyes tus sistemas hoy en día? -What would be your plan if you were to lose everything today, Physical machines, Virtual Machines, Cloud VMs, Cloud PaaS etc etc.? +¿Cuál sería tu plan si hoy perdieras todo, máquinas físicas, máquinas virtuales, VMs en la nube, PaaS en la nube, etc.? -How long would it take you to replace everything? +¿Cuánto tiempo te tomaría reemplazar todo? -Infrastructure as code provides a solution to be able to do this whilst also being able to test this, we should not confuse this with backup and recovery but in terms of your infrastructure and environments, your platforms we should be able to spin them up and treat them as cattle vs pets. +La infraestructura como código proporciona una solución para poder hacer esto, al mismo tiempo que también podemos probarlo. No debemos confundir esto con la copia de seguridad y recuperación, pero en términos de tu infraestructura y entornos, tus plataformas deberían poder ser creadas y tratadas como ganado en lugar de mascotas. -The TLDR; is that we can use code to rebuild our entire environment. +En resumen, podemos usar código para reconstruir todo nuestro entorno. -If we also remember from the start we said about DevOps in general is a way in which to break down barriers to deliver systems into production safely and rapidly. +Si también recordamos desde el principio, dijimos que DevOps en general es una forma de eliminar barreras para entregar sistemas de manera segura y rápida. -Infrastructure as code helps us deliver the systems, we have spoken a lot of processes and tools. IaC brings us more tools to be familiar with to enable this part of the process. +La infraestructura como código nos ayuda a entregar los sistemas. Hemos hablado mucho sobre procesos y herramientas. IaC nos brinda más herramientas para familiarizarnos y habilitar esta parte del proceso. -We are going to concentrate on Infrastructure as code in this section. You might also hear this mentioned as Infrastructure from code or configuration as code. I think the most well-known term is likely Infrastructure as code. +Nos vamos a centrar en la infraestructura como código en esta sección. Es posible que también escuches que se menciona como infraestructura desde el código o configuración como código. Creo que el término más conocido es probablemente infraestructura como código. -### Pets vs Cattle +### Mascotas vs Ganado -If we take a look at pre-DevOps, if we had the requirement to build a new Application, we would need to prepare our servers manually for the most part. +Si echamos un vistazo al tiempo anterior a DevOps, si teníamos el requisito de construir una nueva aplicación, tendríamos que preparar nuestros servidores manualmente en su mayor parte. -- Deploy VMs | Physical Servers and install the operating system -- Configure networking -- Create routing tables -- Install software and updates -- Configure software -- Install database +- Implementar VMs | Servidores físicos e instalar el sistema operativo. +- Configurar la red. +- Crear tablas de enrutamiento. +- Instalar software y actualizaciones. +- Configurar el software. +- Instalar la base de datos. -This would be a manual process performed by Systems Administrators. The bigger the application the more resource and servers required the more manual effort it would take to bring up those systems. This would take a huge amount of human effort and time but also as a business you would have to pay for that resource to build out this environment. As I opened the section with "Humans make mistakes! Automation is the way to go!" +Este sería un proceso manual realizado por administradores de sistemas. Cuanto más grande sea la aplicación y más recursos y servidores se requieran, más esfuerzo manual se necesitaría para poner en funcionamiento esos sistemas. Esto requeriría una gran cantidad de esfuerzo y tiempo humano, pero también como negocio tendrías que pagar por esos recursos para construir este entorno. Como comencé la sección con "¡Los humanos cometen errores! ¡La automatización es el camino a seguir!". -Ongoing from the above initial setup phase you then have maintenance of these servers. +Después de la fase inicial de configuración mencionada anteriormente, también tendrías el mantenimiento de estos servidores. -- Update versions -- Deploy new releases -- Data Management -- Recovery of Applications -- Add, Remove and Scale Servers -- Network Configuration +- Actualizar versiones. +- Implementar nuevas versiones. +- Administración de datos. +- Recuperación de aplicaciones. +- Agregar, eliminar y escalar servidores. +- Configuración de red. -Add the complexity of multiple test and dev environments. +Agrega la complejidad de tener múltiples entornos de prueba y desarrollo. -This is where Infrastructure as Code comes in, the above was very much a time where we would look after those servers as if they were pets, people even called them servers pet names or at least named them something because they were going to be around for a while, they were going to hopefully be part of the "family" for a while. +Aquí es donde entra en juego la infraestructura como código. Lo mencionado anteriormente era un tiempo en el que nos preocupábamos por esos servidores como si fueran mascotas, incluso les dábamos nombres cariñosos o al menos los nombrábamos de alguna manera porque iban a estar allí por un tiempo, iban a ser parte de la "familia" durante un tiempo. -With Infrastructure as Code, we can automate all these tasks end to end. Infrastructure as code is a concept and some tools carry out this automated provisioning of infrastructure, at this point if something bad happens to a server you throw it away and you spin up a new one. This process is automated and the server is exactly as defined in the code. At this point we don't care what they are called they are there in the field serving their purpose until they are no longer in the field and we have another to replace it either because of a failure or because we updated part or all of our application. +Con la infraestructura como código, podemos automatizar todas estas tareas de principio a fin. La infraestructura como código es un concepto y algunas herramientas llevan a cabo esta provisión automatizada de infraestructura. En este punto, si algo malo le sucede a un servidor, lo desechas y creas uno nuevo. Este proceso es automatizado y el servidor es exactamente como se define en el código. En este punto, no nos importa cómo se llamen, están allí en el campo cumpliendo su propósito hasta que ya no estén en el campo y tengamos otro para reemplazarlo, ya sea debido a una falla o porque actualizamos parte o la totalidad de nuestra aplicación. -This can be used in almost all platforms, virtualisation, cloud-based workloads and also cloud-native infrastructures such as Kubernetes and containers. +Esto se puede utilizar en casi todas las plataformas, cargas de trabajo basadas en virtualización, en la nube e infraestructuras nativas de la nube como Kubernetes y contenedores. -### Infrastructure Provisioning +### Provisión de Infraestructura -Not all IaC cover all of the below, You will find that the tool we are going to be using during this section only really covers the first 2 areas below; Terraform is that tool we will be covering and this allows us to start from nothing and define in code what our infrastructure should look like and then deploy that, it will also enable us to manage that infrastructure and also initially deploy an application but at that point it is going to lose track of the application which is where the next section comes in and something like Ansible as a configuration management tool might work better on that front. +No todas las herramientas de IaC cubren todo lo siguiente. Encontrarás que la herramienta que vamos a utilizar en esta sección solo cubre realmente las primeras 2 áreas a continuación; Terraform es esa herramienta que vamos a cubrir y nos permite partir de la nada y definir en código cómo debería ser nuestra infraestructura y luego implementarla. También nos permitirá administrar esa infraestructura y también implementar inicialmente una aplicación, pero en ese momento perderá el seguimiento de la aplicación, es ahí donde entra la siguiente sección y algo como Ansible como una herramienta de gestión de configuración podría funcionar mejor en ese sentido. -Without jumping ahead tools like chef, puppet and ansible are best suited to deal with the initial application setup and then manage those applications and their configuration. +Sin adelantarnos, herramientas como Chef, Puppet y Ansible son las más adecuadas para lidiar con la configuración inicial de la aplicación y luego administrar esas aplicaciones y su configuración. -Initial installation & configuration of software +Instalación y configuración inicial del software: -- Spinning up new servers -- Network configuration -- Creating load balancers -- Configuration on the infrastructure level +- Puesta en marcha de nuevos servidores. +- Configuración de red. +- Creación de balanceadores de carga. +- Configuración a nivel de infraestructura. -### Configuration of provisioned infrastructure +### Configuración de la infraestructura provisionada -- Installing applications on servers -- Prepare the servers to deploy your application. +- Instalación de aplicaciones en servidores. +- Preparar los servidores para implementar tu aplicación. -### Deployment of Application +### Despliegue de la aplicación -- Deploy and Manage Application -- Maintain phase -- Software updates -- Reconfiguration +- Implementar y gestionar la aplicación. +- Fase de mantenimiento. +- Actualizaciones de software. +- Reconfiguración. -### Difference between IaC tools +### Diferencia entre herramientas de IaC -Declarative vs procedural +Declarativo vs Procedimental -Procedural +Procedimental: -- Step-by-step instruction -- Create a server > Add a server > Make this change +- Instrucciones paso a paso. +- Crear un servidor > Agregar un servidor > Hacer este cambio. -Declarative +Declarativo: -- declare the result -- 2 Servers +- Declarar el resultado. +- 2 servidores. -Mutable (pets) vs Immutable (cattle) +Mutable (mascotas) vs Inmutable (ganado) -Mutable +Mutable: -- Change instead of replacing -- Generally long lived +- Cambiar en lugar de reemplazar. +- Generalmente tienen una larga vida útil. -Immutable +Inmutable: -- Replace instead of change -- Possibly short-lived +- Reemplazar en lugar de cambiar. +- Posiblemente de corta duración. -This is really why we have lots of different options for Infrastructure as Code because there is no one tool to rule them all. +Esta es la razón por la cual tenemos muchas opciones diferentes para la infraestructura como código, porque no hay una herramienta que las gobierne todas. -We are going to be mostly using terraform and getting hands-on as this is the best way to start seeing the benefits of Infrastructure as Code when it is in action. Getting hands-on is also the best way to pick up the skills you are going to be writing code. +Vamos a utilizar principalmente Terraform y a trabajar prácticamente, ya que esta es la mejor manera de comenzar a ver los beneficios de la infraestructura como código cuando está en acción. Trabajar prácticamente también es la mejor manera de adquirir las habilidades necesarias para escribir código. -Next up we will start looking into Terraform with a 101 before we get some hands-on getting used. +Continuaremos analizando Terraform con una introducción antes de poner manos a la obra y acostumbrarnos a su uso. -## Resources +## Recursos + +A continuación, he enumerado muchos recursos y creo que este tema ha sido cubierto tantas veces, que si tienes recursos adicionales, asegúrate de enviar una solicitud de extracción (PR) con tus recursos y estaré encantado de revisarlos y agregarlos a la lista. -I have listed a lot of resources down below and I think this topic has been covered so many times out there, If you have additional resources be sure to raise a PR with your resources and I will be happy to review and add them to the list. - [What is Infrastructure as Code? Difference of Infrastructure as Code Tools](https://www.youtube.com/watch?v=POPP2WTJ8es) - [Terraform Tutorial | Terraform Course Overview 2021](https://www.youtube.com/watch?v=m3cKkYXl-8o) @@ -119,5 +120,6 @@ I have listed a lot of resources down below and I think this topic has been cove - [Terraform Simple Projects](https://terraform.joshuajebaraj.com/) - [Terraform Tutorial - The Best Project Ideas](https://www.youtube.com/watch?v=oA-pPa0vfks) - [Awesome Terraform](https://github.com/shuaibiyy/awesome-terraform) +- [Herramientas para Terraform](https://vergaracarmona.es/herramientas-para-terraform/) -See you on [Day 57](day57.md) +Nos vemos en el [Día 57](day57.md) From 88c4a785b62af07e985ba3f901f46f147f857c72 Mon Sep 17 00:00:00 2001 From: Manuel Vergara Date: Thu, 18 May 2023 09:32:40 +0200 Subject: [PATCH 7/9] Translated to Spanish the day57 file Signed-off-by: Manuel Vergara --- 2022/es/Days/day57.md | 76 ++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/2022/es/Days/day57.md b/2022/es/Days/day57.md index 2d74e1e..d902189 100644 --- a/2022/es/Days/day57.md +++ b/2022/es/Days/day57.md @@ -1,78 +1,79 @@ -## An intro to Terraform +## Una introducción a Terraform -"Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently" +"Terraform es una herramienta para construir, cambiar y versionar infraestructura de manera segura y eficiente". -The above quote is from HashiCorp, HashiCorp is the company behind Terraform. +La cita anterior es de HashiCorp, la empresa detrás de Terraform. -"Terraform is an open-source infrastructure as a code software tool that provides a consistent CLI workflow to manage hundreds of cloud services. Terraform codifies cloud APIs into declarative configuration files." +"Terraform es una herramienta de código abierto para infraestructura como código que proporciona un flujo de trabajo de CLI consistente para gestionar cientos de servicios en la nube. Terraform codifica las API de la nube en archivos de configuración declarativos". -HashiCorp has a great resource in [HashiCorp Learn](https://learn.hashicorp.com/terraform?utm_source=terraform_io&utm_content=terraform_io_hero) which covers all of their products and gives some great walkthrough demos when you are trying to achieve something with Infrastructure as Code. +HashiCorp tiene un excelente recurso en [HashiCorp Learn](https://learn.hashicorp.com/terraform?utm_source=terraform_io&utm_content=terraform_io_hero) que cubre todos sus productos y ofrece demos paso a paso cuando intentas lograr algo con Infraestructura como Código. -All cloud providers and on-prem platforms generally give us access to management consoles which enables us to create our resources via a UI, generally, these platforms also provide a CLI or API access to create the same resources but with an API we can provision fast. +Todos los proveedores de la nube y las plataformas locales generalmente nos brindan acceso a consolas de administración que nos permiten crear nuestros recursos a través de una interfaz de usuario. En general, estas plataformas también proporcionan acceso a la CLI o API para crear los mismos recursos, pero con una API podemos aprovisionarlos rápidamente. -Infrastructure as Code allows us to hook into those APIs to deploy our resources in the desired state. +Infraestructura como Código nos permite conectarnos a esas APIs para implementar nuestros recursos en el estado deseado. -Other tools but not exclusive or exhaustive below. If you have other tools then please share via a PR. +Otras herramientas, aunque no exclusivas ni exhaustivas, se enumeran a continuación. Si tienes otras herramientas, por favor compártelas mediante una PR. -| Cloud Specific | Cloud Agnostic | -| ------------------------------- | -------------- | -| AWS CloudFormation | Terraform | -| Azure Resource Manager | Pulumi | -| Google Cloud Deployment Manager | | +| Específicas de la nube | Agnósticas de la nube | +| ------------------------------- | --------------------- | +| AWS CloudFormation | Terraform | +| Azure Resource Manager | Pulumi | +| Google Cloud Deployment Manager | | -This is another reason why we are using Terraform, we want to be agnostic to the clouds and platforms that we wish to use for our demos but also in general. +Esta es otra razón por la cual utilizamos Terraform, queremos ser agnósticos a las nubes y plataformas que deseamos utilizar para nuestras demos y en general. -## Terraform Overview +## Descripción general de Terraform -Terraform is a provisioning-focused tool, Terraform is a CLI that gives the capabilities of being able to provision complex infrastructure environments. With Terraform we can define complex infrastructure requirements that exist locally or remote (cloud) Terraform not only enables us to build things initially but also to maintain and update those resources for their lifetime. +Terraform es una herramienta centrada en el aprovisionamiento. Terraform es una CLI que proporciona capacidades para poder aprovisionar entornos de infraestructura complejos. Con Terraform, podemos definir requisitos de infraestructura complejos que existen localmente o de forma remota (en la nube). Terraform no solo nos permite construir cosas inicialmente, sino también mantener y actualizar esos recursos durante su ciclo de vida. -We are going to cover the high level here but for more details and loads of resources, you can head to [terraform. io](https://www.terraform.io/) +Aquí vamos a cubrir los aspectos principales, pero para obtener más detalles y muchos recursos, puedes dirigirte a [terraform.io](https://www.terraform.io/). -### Write +### Escribir -Terraform allows us to create declarative configuration files that will build our environments. The files are written using the HashiCorp Configuration Language (HCL) which allows for concise descriptions of resources using blocks, arguments, and expressions. We will of course be looking into these in detail in deploying VMs, Containers and within Kubernetes. +Terraform nos permite crear archivos de configuración declarativos que construirán nuestros entornos. Los archivos se escriben utilizando el lenguaje de configuración de HashiCorp (HCL), que permite descripciones concisas de recursos utilizando bloques, argumentos y expresiones. Por supuesto, estudiaremos estos en detalle al implementar máquinas virtuales (VMs), contenedores y en Kubernetes. -### Plan +### Planificar -The ability to check that the above configuration files are going to deploy what we want to see using specific functions of the terraform cli to be able to test that plan before deploying anything or changing anything. Remember Terraform is a continued tool for your infrastructure if you would like to change aspects of your infrastructure you should do that via terraform so that it is captured all in code. +La capacidad de verificar que los archivos de configuración mencionados anteriormente desplegarán lo que queremos ver, utilizando funciones específicas de la CLI de Terraform para probar ese plan antes de desplegar o cambiar cualquier cosa. Recuerda que Terraform es una herramienta continua para tu infraestructura. Si deseas cambiar aspectos de tu infraestructura, debes hacerlo a través de Terraform para que quede registrado todo en el código. -### Apply -Once you are happy you can go ahead and apply this configuration to the many providers that are available within Terraform. You can see a large number of providers available [here](https://registry.terraform.io/browse/providers) +### Aplicar -Another thing to mention is that there are also modules available, and this is similar to container images in that these modules have been created and shared in public so you do not have to create them again and again just reuse the best practice of deploying a specific infrastructure resource the same way everywhere. You can find the modules available [here](https://registry.terraform.io/browse/modules) +Una vez que estés satisfecho, puedes continuar y aplicar esta configuración a los numerosos proveedores disponibles en Terraform. Puedes ver una gran cantidad de proveedores disponibles [aquí](https://registry.terraform.io/browse/providers). -The Terraform workflow looks like this: (_taken from the terraform site_) +Otra cosa que mencionar es que también hay módulos disponibles, y esto es similar a las imágenes de contenedores en el sentido de que estos módulos han sido creados y compartidos públicamente, por lo que no tienes que crearlos una y otra vez, solo puedes reutilizar las mejores prácticas para implementar un recurso de infraestructura específico de la misma manera en todas partes. Puedes encontrar los módulos disponibles [aquí](https://registry.terraform.io/browse/modules). + +El flujo de trabajo de Terraform se ve así: (_tomado del sitio de Terraform_) ![](Images/Day57_IAC3.png) ### Terraform vs Vagrant -During this challenge, we have used Vagrant which happens to be another Hashicorp open source tool which concentrates on the development environments. +Durante este desafío, hemos utilizado Vagrant, que resulta ser otra herramienta de código abierto de HashiCorp que se centra en los entornos de desarrollo. -- Vagrant is a tool focused on managing development environments +- Vagrant es una herramienta enfocada en la gestión de entornos de desarrollo. -- Terraform is a tool for building infrastructure. +- Terraform es una herramienta para construir infraestructura. -A great comparison of the two tools can be found here on the official [Hashicorp site](https://www.vagrantup.com/intro/vs/terraform) +Se puede encontrar una excelente comparación de las dos herramientas aquí en el [sitio oficial de HashiCorp](https://www.vagrantup.com/intro/vs/terraform). -## Terraform Installation +## Instalación de Terraform -There is not much to the installation of Terraform. +La instalación de Terraform no tiene mucho misterio. -Terraform is cross-platform and you can see below on my Linux machine we have several options to download and install the CLI +Terraform es multiplataforma y puedes ver a continuación que en mi máquina Linux tenemos varias opciones para descargar e instalar la CLI. ![](Images/Day57_IAC2.png) -Using `arkade` to install Terraform, arkade is a handy little tool for getting your required tools, apps and clis onto your system. A simple `arkade get terraform` will allow for an update of terraform if available or this same command will also install the Terraform CLI +Usando `arkade` para instalar Terraform, arkade es una práctica herramienta que te permite obtener las herramientas, aplicaciones y clis que necesitas en tu sistema. Un simple `arkade get terraform` permitirá actualizar Terraform si está disponible, o este mismo comando también instalará la CLI de Terraform. ![](Images/Day57_IAC1.png) -We are going to get into more around HCL and then also start using Terraform to create some infrastructure resources in various platforms. +Vamos a profundizar más en HCL y luego comenzaremos a utilizar Terraform para crear algunos recursos de infraestructura en diversas plataformas. -## Resources +## Recursos -I have listed a lot of resources down below and I think this topic has been covered so many times out there, If you have additional resources be sure to raise a PR with your resources and I will be happy to review and add them to the list. +He enumerado muchos recursos a continuación y creo que este tema ha sido cubierto tantas veces en otros lugares. Si tienes recursos adicionales, asegúrate de enviar una solicitud de extracción (PR) con tus recursos y estaré encantado de revisarlos y agregarlos a la lista. - [What is Infrastructure as Code? Difference of Infrastructure as Code Tools](https://www.youtube.com/watch?v=POPP2WTJ8es) - [Terraform Tutorial | Terraform Course Overview 2021](https://www.youtube.com/watch?v=m3cKkYXl-8o) @@ -84,5 +85,6 @@ I have listed a lot of resources down below and I think this topic has been cove - [Terraform Simple Projects](https://terraform.joshuajebaraj.com/) - [Terraform Tutorial - The Best Project Ideas](https://www.youtube.com/watch?v=oA-pPa0vfks) - [Awesome Terraform](https://github.com/shuaibiyy/awesome-terraform) +- [Herramientas para Terraform](https://vergaracarmona.es/herramientas-para-terraform/) -See you on [Day 58](day58.md) +Nos vemos en el [Día 58](day58.md) From f52cd5d58d7fcf42af9a177e9de89e78719285d4 Mon Sep 17 00:00:00 2001 From: Manuel Vergara Date: Thu, 18 May 2023 09:45:45 +0200 Subject: [PATCH 8/9] Translated to Spanish the day58 file Signed-off-by: Manuel Vergara --- 2022/es/Days/day58.md | 102 ++++++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 49 deletions(-) diff --git a/2022/es/Days/day58.md b/2022/es/Days/day58.md index dc007f3..978de74 100644 --- a/2022/es/Days/day58.md +++ b/2022/es/Days/day58.md @@ -1,22 +1,23 @@ ## HashiCorp Configuration Language (HCL) -Before we start making stuff with Terraform we have to dive a little into HashiCorp Configuration Language (HCL). So far during our challenge, we have looked at a few different scripting and programming languages and here is another one. We touched on the [Go programming language](day07.md) then [bash scripts](day19.md) we even touched on a little python when it came to [network automation](day27.md) +Antes de empezar a hacer cosas con Terraform, tenemos que adentrarnos un poco en el lenguaje de configuración de HashiCorp (HCL). Hasta ahora, durante nuestro desafío, hemos visto varios lenguajes de scripting y programación, y aquí tenemos otro. Hemos mencionado el [lenguaje de programación Go](day07.md), luego los [scripts bash](day19.md) e incluso un poco de Python cuando se trata de [automatización de redes](day27.md). -Now we must cover HashiCorp Configuration Language (HCL) if this is the first time you are seeing the language it might look a little daunting but it's quite simple and very powerful. +Ahora debemos cubrir el lenguaje de configuración de HashiCorp (HCL). Si esta es la primera vez que ves este lenguaje, puede parecer un poco intimidante, pero es bastante simple y muy potente. -As we move through this section, we are going to be using examples that we can run locally on our system regardless of what OS you are using, we will be using VirtualBox, albeit not the infrastructure platform you would usually be using with Terraform. However running this locally, is free and will allow us to achieve what we are looking for in this post. We could also extend this post's concept to docker or Kubernetes as well. +A medida que avanzamos en esta sección, vamos a utilizar ejemplos que podemos ejecutar localmente en nuestro sistema, independientemente del sistema operativo que estés usando. Vamos a utilizar VirtualBox, aunque no sea la plataforma de infraestructura que normalmente se usa con Terraform. Sin embargo, ejecutar esto localmente es gratuito y nos permitirá lograr lo que buscamos en esta publicación. También podríamos extender este concepto a Docker o Kubernetes. -In general, though, you would or should be using Terraform to deploy your infrastructure in the public cloud (AWS, Google, Microsoft Azure) but then also in your virtualisation environments such as (VMware, Microsoft Hyper-V, Nutanix AHV). In the public cloud Terraform allows for us to do a lot more than just Virtual Machine automated deployment, we can create all the required infrastructure such as PaaS workloads and all of the networking required assets such as VPCs and Security Groups. +En general, sin embargo, deberías usar Terraform para implementar tu infraestructura en la nube pública (AWS, Google, Microsoft Azure), pero también en tus entornos de virtualización, como VMware, Microsoft Hyper-V, Nutanix AHV. En la nube pública, Terraform nos permite hacer mucho más que simplemente implementar máquinas virtuales. Podemos crear toda la infraestructura necesaria, como cargas de trabajo de PaaS y todos los activos de red requeridos, como VPC y grupos de seguridad. -There are two important aspects to Terraform, we have the code which we are going to get into in this post and then we also have the state. Both of these together could be called the Terraform core. We then have the environment we wish to speak to and deploy into, which is executed using Terraform providers, briefly mentioned in the last session, but we have an AWS provider, we have Azure providers etc. There are hundreds. +Hay dos aspectos importantes en Terraform: el código, que vamos a explorar en esta publicación, y el estado. Ambos juntos podrían denominarse el núcleo de Terraform. Luego tenemos el entorno con el que deseamos interactuar e implementar, que se ejecuta mediante proveedores de Terraform, mencionados brevemente en la última sesión. Pero hay muchos proveedores disponibles, como AWS, Azure, etc. Hay cientos. -### Basic Terraform Usage +### Uso básico de Terraform -Let's take a look at a Terraform `.tf` file to see how they are made up. The first example we will walk through will be code to deploy resources to AWS, this would then also require the AWS CLI to be installed on your system and configured for your account. +Echemos un vistazo a un archivo `.tf` de Terraform para ver cómo se componen. El primer ejemplo que veremos será código para implementar recursos en AWS, lo que también requeriría tener la CLI de AWS instalada en tu sistema y configurada para tu cuenta. -### Providers +### Proveedores + +En la parte superior de nuestra estructura de archivo `.tf`, generalmente llamada `main.tf`, al menos hasta que las cosas se vuelvan más complejas, vamos a definir los proveedores que mencionamos anteriormente. Nuestra fuente del proveedor de AWS, como puedes ver, es `hashicorp/aws`, lo que significa que el proveedor es mantenido o ha sido publicado por HashiCorp ellos mismos. Por defecto, haremos referencia a proveedores disponibles en el [Terraform Registry](https://registry.terraform.io/). También puedes escribir tus propios proveedores y utilizarlos localmente, o publicarlos en el Terraform Registry. -At the top of our `.tf` file structure, generally called `main.tf` at least until we make things more complex. Here we will define the providers that we have mentioned before. Our source of the AWS provider as you can see is `hashicorp/aws` this means the provider is maintained or has been published by hashicorp themselves. By default you will reference providers that are available from the [Terraform Registry](https://registry.terraform.io/), you also can write your providers, and use these locally, or self-publish to the Terraform Registry. ``` terraform { @@ -68,9 +69,10 @@ resource "aws_instance" "90daysofdevops" { } ``` -You can see from the above we are also running a `yum` update and installing `httpd` into our ec2 instance. +Puedes ver que también estamos ejecutando una actualización de `yum` e instalando `httpd` en nuestra instancia de EC2. + +Si ahora observamos el archivo main.tf completo, podría lucir algo así. -If we now look at the complete main.tf file it might look something like this. ``` terraform { @@ -113,9 +115,9 @@ resource "aws_instance" "90daysofdevops" { } ``` -The above code will go and deploy a very simple web server as an ec2 instance in AWS, the great thing about this and any other configuration like this is that we can repeat this and we will get the same output every single time. Other than the chance that I have messed up the code there is no human interaction with the above. +El código anterior desplegará un servidor web muy sencillo como una instancia EC2 en AWS. Lo genial de esto y de cualquier otra configuración similar es que podemos repetirlo y obtener la misma salida cada vez. Aparte de la posibilidad de que haya cometido un error en el código, no hay interacción humana con lo anterior. -We can take a look at a super simple example, one that you will likely never use but let's humour it anyway. Like with all good scripting and programming language we should start with a hello-world scenario. +Podemos echar un vistazo a un ejemplo super sencillo, uno que probablemente nunca usarás, pero vamos a hacerle honor de todos modos. Como en todos los buenos lenguajes de scripting y programación, deberíamos comenzar con un escenario de "Hola mundo". ``` terraform { @@ -131,64 +133,65 @@ output "hello_world" { } ``` -You will find this file in the IAC folder under hello-world, but out of the box, this is not going to simply work there are some commands we need to run to use our terraform code. +Encontrarás este archivo en la carpeta IAC dentro de hello-world, pero de entrada, esto no funcionará simplemente, hay algunos comandos que debemos ejecutar para usar nuestro código de Terraform. -In your terminal navigate to your folder where the main.tf has been created, this could be from this repository or you could create a new one using the code above. +En tu terminal, navega hasta la carpeta donde se haya creado el archivo main.tf, esto puede ser desde este repositorio o puedes crear uno nuevo usando el código anterior. -When in that folder we are going to run `terraform init` +Cuando estés en esa carpeta, ejecutaremos `terraform init`. -We need to perform this on any directory where we have or before we run any terraform code. Initialising a configuration directory downloads and installs the providers defined in the configuration, in this case, we have no providers but in the example above this would download the AWS provider for this configuration. +Necesitamos realizar esto en cualquier directorio donde tengamos, o antes de ejecutar cualquier código de Terraform. La inicialización de un directorio de configuración descarga e instala los proveedores definidos en la configuración. En este caso, no tenemos proveedores, pero en el ejemplo anterior, esto descargaría el proveedor de AWS para esta configuración. -![](Images/Day58_IAC1.png) +![Day58_IAC1](Images/Day58_IAC1.png) -The next command will be `terraform plan` +El siguiente comando será `terraform plan`. -The `terraform plan` command creates an execution plan, which lets you preview the changes that Terraform plans to make to your infrastructure. +El comando `terraform plan` crea un plan de ejecución que te permite previsualizar los cambios que Terraform planea realizar en tu infraestructura. -You can simply see below that with our hello-world example we are going to see output if this was an AWS ec2 instance we would see all the steps that we will be creating. +Puedes ver simplemente a continuación que con nuestro ejemplo de hello-world veremos la salida. Si esto fuera una instancia EC2 de AWS, veríamos todos los pasos que se crearán. -![](Images/Day58_IAC2.png) +![Day58_IAC2](Images/Day58_IAC2.png) -At this point, we have initialised our repository and we have our providers downloaded where required, we have run a test walkthrough to make sure this is what we want to see so now we can run and deploy our code. +En este punto, hemos inicializado nuestro repositorio y hemos descargado los proveedores donde sea necesario. Hemos realizado una prueba para asegurarnos de que esto es lo que queremos ver, así que ahora podemos ejecutar y desplegar nuestro código. -`terraform apply` allows us to do this there is a built-in safety measure to this command and this will again give you a plan view on what is going to happen which warrants a response from you to say yes to continue. +`terraform apply` nos permite hacer esto. Hay una medida de seguridad incorporada en este comando, y nuevamente te mostrará un plan de lo que va a suceder, lo cual requiere una respuesta de tu parte para decir que sí, para continuar. -![](Images/Day58_IAC3.png) +![Day58_IAC3](Images/Day58_IAC3.png) -When we type in yes to enter a value, our code is deployed. Not that exciting but you can see we have the output that we defined in our code. +Cuando escribimos "yes" para ingresar un valor, nuestro código se despliega. No es muy emocionante, pero puedes ver que tenemos la salida que definimos en nuestro código. -![](Images/Day58_IAC4.png) +![Day58_IAC4](Images/Day58_IAC4.png) -Now we have not deployed anything, we have not added, changed or destroyed anything but if we did then we would see that indicated also in the above. If however we had deployed something and we wanted to get rid of everything we deployed we can use the `terraform destroy` command. Again this has that safety where you have to type yes although you can use `--auto-approve` on the end of your `apply` and `destroy` commands to bypass that manual intervention. But I would advise only using this shortcut when learning and testing as everything will disappear sometimes faster than it was built. +Ahora, no hemos desplegado nada, no hemos agregado, cambiado o destruido nada, pero si lo hiciéramos, también lo veríamos indicado en lo anterior. Sin embargo, si hubiéramos desplegado algo y quisiéramos eliminar todo lo que hemos creado, podemos usar el comando `terraform destroy`. Nuevamente, este tiene esa medida de seguridad donde tienes que escribir "yes". Aunque puedes usar `--auto-approve` al final de tus comandos `apply` y `destroy` para evitar esa intervención manual. Pero te aconsejaría que solo uses este atajo cuando estés aprendiendo y probando, ya que todo desaparecerá a veces más rápido de lo que se construyó. -From this, there are 4 commands we have covered from the Terraform CLI. +A partir de esto, hemos cubierto 4 comandos de la CLI de Terraform. -- `terraform init` = get your project folder ready with providers -- `terraform plan` = show what is going to be created, and changed during the next command based on our code. -- `terraform apply` = will go and deploy the resources defined in our code. -- `terraform destroy` = will destroy the resources we have created in our project +- `terraform init` = prepara la carpeta del proyecto con los proveedores. +- `terraform plan` = muestra lo que se va a crear y cambiar durante el próximo comando, según nuestro código. +- `terraform apply` = desplegará los recursos definidos en nuestro código. +- `terraform destroy` = destruirá los recursos que hemos creado en nuestro proyecto. -We also covered two important aspects of our code files. +También hemos cubierto dos aspectos importantes de nuestros archivos de código. -- providers = how does terraform speak to the end platform via APIs -- resources = what it is we want to deploy with code +- Proveedores = cómo Terraform se comunica con la plataforma final a través de APIs. +- Recursos = lo que queremos desplegar con código. -Another thing to note when running `terraform init` take a look at the tree on the folder before and after to see what happens and where we store providers and modules. +Otra cosa a tener en cuenta al ejecutar `terraform init` es observar el árbol de la carpeta antes y después para ver qué sucede y dónde almacenamos los proveedores y los módulos. -### Terraform state +### Estado de Terraform -We also need to be aware of the state file that is created also inside our directory and for this hello world example our state file is simple. This is a JSON file which is the representation of the world according to Terraform. The state will happily show off your sensitive data so be careful and as a best practice put your `.tfstate` files in your `.gitignore` folder before uploading to GitHub. +También debemos tener en cuenta el archivo de estado que se crea dentro de nuestro directorio. Para este ejemplo de hello world, nuestro archivo de estado es simple. Se trata de un archivo JSON que representa el estado del mundo según Terraform. El estado mostrará felizmente tus datos confidenciales, así que ten cuidado y, como buena práctica, agrega tus archivos `.tfstate` a tu archivo `.gitignore` antes de subirlos a GitHub. -By default, the state file as you can see lives inside the same directory as your project code, but it can also be stored remotely as an option. In a production environment, this is likely going to be a shared location such as an S3 bucket. +Por defecto, el archivo de estado, como puedes ver, se encuentra dentro del mismo directorio que tu código de proyecto, pero también se puede almacenar de forma remota como opción. En un entorno de producción, es probable que esto se almacene en un lugar compartido, como un bucket de S3. -Another option could be Terraform Cloud, this is a paid-for-managed service. (Free up to 5 users) +Otra opción podría ser Terraform Cloud, que es un servicio gestionado de pago (gratuito hasta 5 usuarios). -The pros for storing state in a remote location are that we get: +Las ventajas de almacenar el estado en un lugar remoto son: -- Sensitive data encrypted -- Collaboration -- Automation -- However, it could bring increase the complexity +- Datos confidenciales encriptados. +- Colaboración. +- Automatización. + +Sin embargo, esto podría aumentar la complejidad. ```JSON { @@ -206,9 +209,9 @@ The pros for storing state in a remote location are that we get: } ``` -## Resources +## Recursos -I have listed a lot of resources down below and I think this topic has been covered so many times out there, If you have additional resources be sure to raise a PR with your resources and I will be happy to review and add them to the list. +A continuación, he enumerado muchos recursos y creo que este tema se ha cubierto muchas veces en otros lugares. Si tienes recursos adicionales, asegúrate de enviar una solicitud de extracción (PR) con tus recursos y estaré encantado de revisarlos y agregarlos a la lista. - [What is Infrastructure as Code? Difference of Infrastructure as Code Tools](https://www.youtube.com/watch?v=POPP2WTJ8es) - [Terraform Tutorial | Terraform Course Overview 2021](https://www.youtube.com/watch?v=m3cKkYXl-8o) @@ -220,5 +223,6 @@ I have listed a lot of resources down below and I think this topic has been cove - [Terraform Simple Projects](https://terraform.joshuajebaraj.com/) - [Terraform Tutorial - The Best Project Ideas](https://www.youtube.com/watch?v=oA-pPa0vfks) - [Awesome Terraform](https://github.com/shuaibiyy/awesome-terraform) +- [Herramientas para Terraform](https://vergaracarmona.es/herramientas-para-terraform/) -See you on [Day 59](day59.md) +Nos vemos en el [Día 59](day59.md) From ba211745261780fddee1abd670d6ae46ecef9c58 Mon Sep 17 00:00:00 2001 From: Manuel Vergara <86802064+manuelver@users.noreply.github.com> Date: Thu, 18 May 2023 18:10:30 +0200 Subject: [PATCH 9/9] Update day53.md --- 2022/es/Days/day53.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/2022/es/Days/day53.md b/2022/es/Days/day53.md index 886f74a..d7f22db 100644 --- a/2022/es/Days/day53.md +++ b/2022/es/Days/day53.md @@ -14,8 +14,6 @@ Lo primero que debemos hacer es implementar Rancher en nuestra estación de trab También están disponibles otros métodos de implementación de Rancher. Puedes consultar la [Guía de inicio rápido de Rancher](https://rancher.com/docs/rancher/v2.6/en/quick-start-guide/deployment/). - - `sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 --privileged rancher/rancher` Como puedes ver en nuestro Docker Desktop, tenemos un contenedor de Rancher en ejecución.