corregido velero
This commit is contained in:
@@ -1,32 +0,0 @@
|
|||||||
# Velero + MinIO (c2et.net)
|
|
||||||
|
|
||||||
Este paquete contiene:
|
|
||||||
- `namespace.yaml`
|
|
||||||
- Secrets de credenciales (`cloud-credentials-site-a`, `cloud-credentials-site-b`)
|
|
||||||
- BackupStorageLocation (BSL) por YAML: `default` (site-a) y `site-b`
|
|
||||||
- Ejemplo de `Schedule` (nightly a las 02:00 y 02:30)
|
|
||||||
- Dos `values.yaml` de Helm:
|
|
||||||
- `helm/values-approach-a.yaml`: crea BSL por defecto y Secret desde Helm
|
|
||||||
- `helm/values-approach-b.yaml`: sin BSL/Secret; los aplicas tú en YAML (GitOps)
|
|
||||||
- `ServiceMonitor` (si usas Prometheus Operator)
|
|
||||||
- Dashboard de Grafana (JSON)
|
|
||||||
|
|
||||||
## Flujo recomendado (GitOps, Approach B)
|
|
||||||
```bash
|
|
||||||
# 1) Instala Velero por Helm sin BSL ni secrets
|
|
||||||
helm repo add vmware-tanzu https://vmware-tanzu.github.io/helm-charts
|
|
||||||
helm upgrade --install velero vmware-tanzu/velero -n velero --create-namespace -f helm/values-approach-b.yaml
|
|
||||||
|
|
||||||
# 2) Aplica Secrets, BSLs y Schedules
|
|
||||||
kubectl apply -f namespace.yaml
|
|
||||||
kubectl apply -f secrets/secret-site-a.yaml -f secrets/secret-site-b.yaml
|
|
||||||
kubectl apply -f bsl/bsl-default-site-a.yaml -f bsl/bsl-site-b.yaml
|
|
||||||
kubectl apply -f schedules/schedules.yaml
|
|
||||||
```
|
|
||||||
|
|
||||||
## Notas
|
|
||||||
- MinIO requiere `s3ForcePathStyle=true`.
|
|
||||||
- Si usas CA propia, añade `spec.config.caCert` en los BSL.
|
|
||||||
- `ServiceMonitor` requiere Prometheus Operator; ajusta `metadata.labels.release` al valor que use tu Prometheus.
|
|
||||||
- Importa el dashboard JSON en Grafana (datasource `prometheus`).
|
|
||||||
|
|
||||||
@@ -1,10 +1,13 @@
|
|||||||
|
# values-combined.yaml
|
||||||
credentials:
|
credentials:
|
||||||
useSecret: false # Secrets y BSLs los aplicas tú por YAML
|
useSecret: false # Secrets y BSLs los aplicas tú por YAML (como ya hiciste)
|
||||||
|
|
||||||
configuration:
|
configuration:
|
||||||
features: EnableCSI
|
features: ""
|
||||||
backupStorageLocation: [] # ninguno desde Helm
|
backupStorageLocation: [] # ninguno desde Helm (los gestionas por YAML)
|
||||||
|
defaultVolumesToFsBackup: true # copia datos de PV vía node-agent/Kopia al BSL
|
||||||
|
|
||||||
|
# Dejamos SOLO el plugin de AWS; el CSI externo se quita (viene integrado en Velero 1.16)
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: velero-plugin-for-aws
|
- name: velero-plugin-for-aws
|
||||||
image: velero/velero-plugin-for-aws:v1.9.0
|
image: velero/velero-plugin-for-aws:v1.9.0
|
||||||
@@ -12,12 +15,16 @@ initContainers:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: plugins
|
- name: plugins
|
||||||
mountPath: /target
|
mountPath: /target
|
||||||
- name: velero-plugin-for-csi
|
|
||||||
image: velero/velero-plugin-for-csi:v0.7.0
|
|
||||||
imagePullPolicy: IfNotPresent
|
|
||||||
volumeMounts:
|
|
||||||
- name: plugins
|
|
||||||
mountPath: /target
|
|
||||||
|
|
||||||
|
# **activar** el node-agent (DaemonSet) y darle tolerations "catch-all"
|
||||||
|
deployNodeAgent: true
|
||||||
nodeAgent:
|
nodeAgent:
|
||||||
enabled: true
|
podConfig:
|
||||||
|
tolerations:
|
||||||
|
- key: "node-role.kubernetes.io/master"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoSchedule"
|
||||||
|
- key: "node-role.kubernetes.io/control-plane"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoSchedule"
|
||||||
|
- operator: "Exists" # tolera cualquier otro taint
|
||||||
|
|||||||
86
velero/readme.md
Normal file
86
velero/readme.md
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
# Velero + MinIO (c2et.net)
|
||||||
|
|
||||||
|
Este paquete contiene:
|
||||||
|
- `namespace.yaml`
|
||||||
|
- Secrets de credenciales (`cloud-credentials-site-a`, `cloud-credentials-site-b`)
|
||||||
|
- BackupStorageLocation (BSL) por YAML: `default` (site-a) y `site-b`
|
||||||
|
- Ejemplo de `Schedule` (nightly a las 02:00 y 02:30)
|
||||||
|
- `helm/values-approach-b.yaml`: despliegue de Velero sin BSL/Secret (GitOps)
|
||||||
|
- `ServiceMonitor` (si usas Prometheus Operator)
|
||||||
|
- Dashboard de Grafana (JSON)
|
||||||
|
|
||||||
|
## Flujo recomendado (GitOps, Approach B)
|
||||||
|
```bash
|
||||||
|
# 1) Instala Velero por Helm sin BSL ni secrets
|
||||||
|
helm repo add vmware-tanzu https://vmware-tanzu.github.io/helm-charts
|
||||||
|
helm upgrade --install velero vmware-tanzu/velero -n velero --create-namespace -f helm/values-approach-b.yaml
|
||||||
|
|
||||||
|
# 2) Aplica Secrets, BSLs y Schedules
|
||||||
|
kubectl apply -f namespace.yaml
|
||||||
|
kubectl apply -f secrets/secret-site-a.yaml -f secrets/secret-site-b.yaml
|
||||||
|
kubectl apply -f bsl/bsl-default-site-a.yaml -f bsl/bsl-site-b.yaml
|
||||||
|
kubectl apply -f schedules/schedules.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
## Cliente Velero
|
||||||
|
Para interactuar con Velero necesitas el binario en tu máquina de administración.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Linux AMD64
|
||||||
|
wget https://github.com/vmware-tanzu/velero/releases/download/v1.16.2/velero-v1.16.2-linux-amd64.tar.gz
|
||||||
|
tar -xvf velero-v1.16.2-linux-amd64.tar.gz
|
||||||
|
sudo mv velero-v1.16.2-linux-amd64/velero /usr/local/bin/
|
||||||
|
|
||||||
|
# MacOS Intel
|
||||||
|
wget https://github.com/vmware-tanzu/velero/releases/download/v1.16.2/velero-v1.16.2-darwin-amd64.tar.gz
|
||||||
|
tar -xvf velero-v1.16.2-darwin-amd64.tar.gz
|
||||||
|
sudo mv velero-v1.16.2-darwin-amd64/velero /usr/local/bin/
|
||||||
|
```
|
||||||
|
|
||||||
|
Verifica la instalación:
|
||||||
|
```bash
|
||||||
|
velero version
|
||||||
|
```
|
||||||
|
|
||||||
|
## Hacer un backup manual
|
||||||
|
Ejemplo: respaldar el namespace `wireguard`.
|
||||||
|
```bash
|
||||||
|
velero backup create wireguard-backup --include-namespaces wireguard --wait
|
||||||
|
velero backup describe wireguard-backup --details
|
||||||
|
```
|
||||||
|
|
||||||
|
Puedes excluir recursos innecesarios (ej. CRDs de KubeVirt):
|
||||||
|
```bash
|
||||||
|
velero backup create smoke --include-namespaces default --exclude-resources uploadtokenrequests.upload.cdi.kubevirt.io --wait
|
||||||
|
```
|
||||||
|
|
||||||
|
## Programar backups (Schedules)
|
||||||
|
Ejemplo de programación diaria a las 03:15, TTL de 30 días:
|
||||||
|
```bash
|
||||||
|
velero schedule create daily-wireguard --schedule "15 3 * * *" --include-namespaces wireguard --ttl 720h --default-volumes-to-fs-backup
|
||||||
|
```
|
||||||
|
|
||||||
|
Los schedules también se pueden definir por YAML en `schedules/schedules.yaml`.
|
||||||
|
|
||||||
|
## Restaurar un backup
|
||||||
|
### Restaurar al mismo namespace (desastre real)
|
||||||
|
```bash
|
||||||
|
# 1) Borrar el namespace roto
|
||||||
|
kubectl delete ns wireguard
|
||||||
|
|
||||||
|
# 2) Restaurar desde el backup
|
||||||
|
velero restore create wireguard-restore --from-backup wireguard-backup --wait
|
||||||
|
velero restore describe wireguard-restore --details
|
||||||
|
```
|
||||||
|
|
||||||
|
### Restaurar a otro namespace (ensayo)
|
||||||
|
```bash
|
||||||
|
kubectl create ns wireguard-restore
|
||||||
|
velero restore create wireguard-restore-test --from-backup wireguard-backup --namespace-mappings wireguard:wireguard-restore --wait
|
||||||
|
```
|
||||||
|
|
||||||
|
## Notas
|
||||||
|
- MinIO requiere `s3ForcePathStyle=true`.
|
||||||
|
- Si usas CA propia, añade `spec.config.caCert` en los BSL.
|
||||||
|
- `ServiceMonitor` requiere Prometheus Operator; ajusta `metadata.labels.release` al valor que use tu Prometheus.
|
||||||
|
- Importa el dashboard JSON en Grafana (datasource `prometheus`).
|
||||||
7
velero/vsl-default.yaml
Normal file
7
velero/vsl-default.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: velero.io/v1
|
||||||
|
kind: VolumeSnapshotLocation
|
||||||
|
metadata:
|
||||||
|
name: default
|
||||||
|
namespace: velero
|
||||||
|
spec:
|
||||||
|
provider: velero.io/csi
|
||||||
Reference in New Issue
Block a user