You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 2022/es/Days/day88.md
+66-60Lines changed: 66 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,62 +1,63 @@
1
-
## Application-Focused Backups
1
+
## Copias de seguridad enfocadas en aplicaciones
2
2
3
-
We have already spent some time talking about data services or data-intensive applications such as databases on [Day 85](day85.md). For these data services, we have to consider how we manage consistency, especially when it comes to application consistency.
3
+
Ya hemos dedicado tiempo a hablar sobre servicios de datos o aplicaciones intensivas en datos, como las bases de datos en [Día 85](day85.md). Para estos servicios de datos, debemos considerar cómo gestionamos la consistencia, especialmente cuando se trata de la consistencia de la aplicación.
4
4
5
-
In this post, we are going to dive into that requirement around consistently protecting the application data.
5
+
En esta publicación, profundizaremos en ese requisito de proteger de manera consistente los datos de la aplicación.
6
6
7
-
To do this our tool of choice will be [Kanister](https://kanister.io/)
7
+
Para hacer esto, nuestra herramienta elegida será [Kanister](https://kanister.io/).
8
8
9
9

10
10
11
-
### Introducing Kanister
11
+
### Introducción a Kanister
12
12
13
-
Kanister is an open-source project by Kasten, that enables us to manage (backup and restore) application data on Kubernetes. You can deploy Kanister as a helm application into your Kubernetes cluster.
13
+
Kanister es un proyecto de código abierto de Kasten que nos permite gestionar (hacer copias de seguridad y restaurar) los datos de la aplicación en Kubernetes. Puedes implementar Kanister como una aplicación Helm en tu clúster de Kubernetes.
14
14
15
-
Kanister uses Kubernetes custom resources, the main custom resources that are installed when Kanister is deployed are
15
+
Kanister utiliza recursos personalizados de Kubernetes. Los recursos personalizados principales que se instalan al implementar Kanister son:
16
16
17
-
-`Profile`- is a target location to store your backups and recover from. Most commonly this will be object storage.
18
-
-`Blueprint`- steps that are to be taken to backup and restore the database should be maintained in the Blueprint
19
-
-`ActionSet`- is the motion to move our target backup to our profile as well as restore actions.
17
+
-`Profile`(perfil): es un lugar de destino para almacenar tus copias de seguridad y recuperarlas. Por lo general, esto será un almacenamiento de objetos.
18
+
-`Blueprint`(diseño): los pasos que se deben seguir para hacer una copia de seguridad y restaurar la base de datos se deben mantener en el blueprint.
19
+
-`ActionSet`(conjunto de acciones): es el movimiento para mover nuestra copia de seguridad objetivo a nuestro perfil, así como las acciones de restauración.
20
20
21
-
### Execution Walkthrough
21
+
### Ejecución paso a paso
22
22
23
-
Before we get hands-on we should take a look at the workflow that Kanister takes in protecting application data. Firstly our controller is deployed using helm into our Kubernetes cluster, Kanister lives within its namespace. We take our Blueprint of which there are many community-supported blueprints available, we will cover this in more detail shortly. We then have our database workload.
23
+
Antes de comenzar, debemos echar un vistazo al flujo de trabajo que Kanister sigue para proteger los datos de la aplicación. En primer lugar, implementamos nuestro controlador mediante Helm en nuestro clúster de Kubernetes. Kanister se ejecuta en su propio espacio de nombres (namespace). A continuación, tomamos nuestro Blueprint, del cual hay muchos blueprints respaldados por la comunidad disponibles. Cubriremos esto en más detalle en breve. Luego, tenemos nuestra carga de trabajo de la base de datos.
24
24
25
25

26
26
27
-
We then create our ActionSet.
27
+
A continuación, creamos nuestro ActionSet.
28
28
29
29

30
30
31
-
The ActionSet allows us to run the actions defined in the blueprint against the specific data service.
31
+
El ActionSet nos permite ejecutar las acciones definidas en el blueprint contra el servicio de datos específico.
32
32
33
33

34
34
35
-
The ActionSet in turn uses the Kanister functions (KubeExec, KubeTask, Resource Lifecycle) and pushes our backup to our target repository (Profile).
35
+
A su vez, el ActionSet utiliza las funciones de Kanister (KubeExec, KubeTask, Resource Lifecycle) y envía nuestra copia de seguridad a nuestro repositorio de destino (Profile).
36
36
37
37

38
38
39
-
If that action is completed/failed the respective status is updated in the Actionset.
39
+
Si la acción se completa o falla, el estado respectivo se actualiza en el ActionSet.
40
40
41
41

42
42
43
-
### Deploying Kanister
43
+
### Implementación de Kanister
44
44
45
-
Once again we will be using the minikube cluster to achieve this application backup. If you have it still running from the previous session then we can continue to use this.
45
+
Una vez más, utilizaremos el clúster minikube para lograr esta copia de seguridad de la aplicación. Si todavía lo tienes en ejecución desde la sesión anterior, podemos seguir usándolo.
46
46
47
-
At the time of writing, we are up to image version `0.75.0` with the following helm command we will install kanister into our Kubernetes cluster.
En el momento de escribir esto, estamos en la versión de imagen 0.75.0. Con el siguiente comando de Helm, instalaremos Kanister en nuestro clúster de Kubernetes:
We can use `kubectl get pods -n kanister` to ensure the pod is up and running and then we can also check our custom resource definitions are now available (If you have only installed Kanister then you will see the highlighted 3)
54
+
Podemos usar kubectl get pods -n kanister para asegurarnos de que el pod esté en funcionamiento y también podemos verificar que las definiciones de recursos personal.
54
55
55
56

56
57
57
-
### Deploy a Database
58
+
### Despliegue de una base de datos
58
59
59
-
Deploying MySQL via helm:
60
+
Desplegar MySQL mediante Helm:
60
61
61
62
```Shell
62
63
APP_NAME=my-production-app
@@ -68,7 +69,7 @@ kubectl get pods -n ${APP_NAME} -w
68
69
69
70

70
71
71
-
Populate the MySQL database with initial data, and run the following:
72
+
Rellenar la base de datos de MySQL con datos iniciales y ejecutar lo siguiente:
72
73
73
74
```Shell
74
75
MYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace ${APP_NAME} mysql-store -o jsonpath="{.data.mysql-root-password}"| base64 --decode)
Deberías poder ver algunos datos como se muestra a continuación.
115
116
116
117

117
118
118
-
### Create Kanister Profile
119
+
### Crear perfil Kanister
119
120
120
-
Kanister provides a CLI, `kanctl` and another utility`kando` that is used to interact with your object storage provider from the blueprint and both of these utilities.
121
+
Kanister proporciona una CLI, `kanctl`, y otra utilidad,`kando`, que se utiliza para interactuar con tu proveedor de almacenamiento de objetos desde el blueprint y ambas utilidades.
[Descarga de la CLI](https://docs.kanister.io/tooling.html#tooling)
123
124
124
-
I have gone and I have created an AWS S3 Bucket that we will use as our profile target and restore location. I am going to be using environment variables so that I can still show you the commands I am running with `kanctl` to create our kanister profile.
He creado un bucket de AWS S3 que utilizaremos como destino de nuestro perfil y ubicación de restauración. Voy a utilizar variables de entorno para mostrar los comandos que ejecuto con kanctl para crear nuestro perfil Kanister.
Don't worry you don't need to create your one from scratch unless your data service is not listed here in the [Kanister Examples](https://github.com/kanisterio/kanister/tree/master/examples) but by all means, community contributions are how this project gains awareness.
134
+
No te preocupes, no necesitas crear uno desde cero a menos que tu servicio de datos no esté listado aquí en los [Ejemplos de Kanister](https://github.com/kanisterio/kanister/tree/master/examples), pero, por supuesto, las contribuciones de la comunidad son la forma en que este proyecto gana visibilidad.
To add this we will use the `kubectl create -f mysql-blueprint.yml -n kanister`command
218
+
Para agregar esto, utilizaremos el comando `kubectl create -f mysql-blueprint.yml -n kanister`.
217
219
218
220

219
221
220
-
### Create our ActionSet and Protect our application
222
+
### Crear nuestro ActionSet y proteger nuestra aplicación
221
223
222
-
We will now take a backup of the MySQL data using an ActionSet defining backup forthis application. Create an ActionSetin the same namespace as the controller.
223
-
224
-
`kubectl get profiles.cr.kanister.io -n my-production-app` This command will show us the profile we previously created, we can have multiple profiles configured here so we might want to use specific ones for different ActionSets
224
+
Ahora realizaremos una copia de seguridad de los datos de MySQL utilizando un ActionSet que define la copia de seguridad para esta aplicación. Crea un ActionSet en el mismo namespace que el controlador.
225
+
```sh
226
+
kubectl get profiles.cr.kanister.io -n my-production-app
227
+
```
225
228
226
-
We are then going to create our ActionSet with the following command using `kanctl`
229
+
Este comando nos mostrará el perfil que creamos anteriormente. Podemos tener múltiples perfiles configurados aquí, por lo que podemos usar perfiles específicos para diferentes ActionSets.
You can see from the command above we are defining the blueprint we added to the namespace, the statefulset in our `my-production-app`namespace and also the secrets to get into the MySQL application.
236
+
En el comando anterior, estamos definiendo el blueprint que agregamos al namespace, el statefulset en nuestro namespace `my-production-app`y también los secretos para acceder a la aplicación MySQL.
231
237
232
238

233
239
234
-
Check the status of the ActionSet by taking the ActionSet name and using this command`kubectl --namespace kanister describe actionset backup-qpnqv`
240
+
Verifica el estado del ActionSet utilizando el nombre del ActionSet con el siguiente comando: kubectl --namespace kanister describe actionset backup-qpnqv.
235
241
236
-
Finally, we can go and confirm that we now have data in our AWS S3 bucket.
242
+
Finalmente, podemos confirmar que ahora tenemos datos en nuestro bucket de AWS S3.
237
243
238
244

239
245
240
-
### Restore
246
+
### Restauración
241
247
242
-
We need to cause some damage before we can restore anything, we can do this by dropping our table, maybe it was an accident, maybe it wasn't.
248
+
Necesitamos causar algún daño antes de poder restaurar algo, podemos hacer esto eliminando nuestra tabla, tal vez fue un accidente, tal vez no lo fue.
You can see that our importantdata DB is there with `echo "SHOW DATABASES;" | ${MYSQL_EXEC}`
257
+
Puedes ver que nuestra base de datos importantdata está ahí con `echo "SHOW DATABASES;"|${MYSQL_EXEC}`.
252
258
253
-
Then to drop we ran `echo "DROP DATABASE myImportantData;" | ${MYSQL_EXEC}`
259
+
Luego, para eliminarla, ejecutamos `echo "DROP DATABASE myImportantData;"|${MYSQL_EXEC}`.
254
260
255
-
And confirmed that this was gone with a few attempts to show our database.
261
+
Y confirmamos que se haya eliminado con algunos intentos de mostrar nuestra base de datos.
256
262
257
263

258
264
259
-
We can now use Kanister to get our important data back in business using the `kubectl get actionset -n kanister` to find out the ActionSet name that we took earlier. Then we will create a restore ActionSet to restore our data using `kanctl create actionset -n kanister --action restore --from "backup-qpnqv"`
265
+
Ahora podemos usar Kanister para restaurar nuestros datos importantes utilizando el comando `kubectl get actionset -n kanister`para encontrar el nombre del ActionSet que tomamos anteriormente. Luego, crearemos un ActionSet de restauración para restaurar nuestros datos usando `kanctl create actionset -n kanister --action restore --from "backup-qpnqv`".
260
266
261
267

262
268
263
-
We can confirm our data is back by using the below command to connect to our database.
269
+
Podemos confirmar que nuestros datos están de vuelta en nuestro pod de MySQL.
Now we are inside the MySQL Client, we can issue the `echo "SHOW DATABASES;" | ${MYSQL_EXEC}` and we can see the database is back. We can also issue the `echo "select * from Accounts;" | ${MYSQL_EXEC}` to check the contents of the database and our important data is restored.
276
+
Ahora estamos dentro del Cliente de MySQL, podemos ejecutar `echo "SHOW DATABASES;"|${MYSQL_EXEC}`y podemos ver que la base de datos está de vuelta. También podemos ejecutar `echo "select * from Accounts;"|${MYSQL_EXEC}`para verificar el contenido de la base de datos y nuestros datos importantes están restaurados.
271
277
272
278

273
279
274
-
In the next post, we take a look at Disaster Recovery within Kubernetes.
280
+
En la próxima publicación, veremos la Recuperación de Desastres dentro de Kubernetes.
275
281
276
-
## Resources
282
+
## Recursos
277
283
278
284
- [Kanister Overview - An extensible open-source framework for app-lvl data management on Kubernetes](https://www.youtube.com/watch?v=wFD42Zpbfts)
279
285
- [Application Level Data Operations on Kubernetes](https://community.cncf.io/events/details/cncf-cncf-online-programs-presents-cncf-live-webinar-kanister-application-level-data-operations-on-kubernetes/)
@@ -283,4 +289,4 @@ In the next post, we take a look at Disaster Recovery within Kubernetes.
283
289
- [Disaster Recovery vs. Backup: What's the difference?](https://www.youtube.com/watch?v=07EHsPuKXc0)
0 commit comments