Añadidas redes y harbor
This commit is contained in:
59
docs/chuletario.md
Normal file
59
docs/chuletario.md
Normal file
@ -0,0 +1,59 @@
|
||||
# 🚀 Referencia rápida de `kubectl` - Valhalla Cluster
|
||||
|
||||
## 📦 Gestión de Pods
|
||||
|
||||
```bash
|
||||
kubectl get pods -A # Ver todos los pods en todos los namespaces
|
||||
kubectl get pods -n <namespace> # Ver los pods de un namespace
|
||||
kubectl describe pod <nombre> -n <namespace> # Detallar un pod
|
||||
kubectl delete pod <nombre> -n <namespace> # Borrar un pod manualmente
|
||||
```
|
||||
|
||||
## 📜 Gestión de Deployments
|
||||
|
||||
```bash
|
||||
kubectl get deployments -A
|
||||
kubectl describe deployment <nombre> -n <namespace>
|
||||
kubectl rollout restart deployment <nombre> -n <namespace> # Reiniciar un deployment
|
||||
```
|
||||
|
||||
## 📋 Gestión de Servicios (Services)
|
||||
|
||||
```bash
|
||||
kubectl get svc -A
|
||||
kubectl describe svc <nombre> -n <namespace>
|
||||
```
|
||||
|
||||
## 📌 Gestión de Ingress
|
||||
|
||||
```bash
|
||||
kubectl get ingress -A
|
||||
kubectl describe ingress <nombre> -n <namespace>
|
||||
```
|
||||
|
||||
## 🔥 Diagnóstico Rápido
|
||||
|
||||
```bash
|
||||
kubectl get events -A --sort-by='.metadata.creationTimestamp' # Ver eventos recientes
|
||||
kubectl logs <nombre_pod> -n <namespace> # Ver logs de un pod
|
||||
kubectl exec -it <nombre_pod> -n <namespace> -- /bin/sh # Acceder dentro de un pod
|
||||
```
|
||||
|
||||
## 🎯 Gestión de Nodos
|
||||
|
||||
```bash
|
||||
kubectl get nodes
|
||||
kubectl describe node <nombre_nodo>
|
||||
kubectl drain <nombre_nodo> --ignore-daemonsets --delete-emptydir-data # Sacar un nodo para mantenimiento
|
||||
kubectl delete node <nombre_nodo> # Borrar un nodo manualmente del cluster
|
||||
```
|
||||
|
||||
## 🏗️ Aplicar y Borrar Manifiestos
|
||||
|
||||
```bash
|
||||
kubectl apply -f <archivo>.yaml
|
||||
kubectl delete -f <archivo>.yaml
|
||||
```
|
||||
|
||||
|
||||
|
@ -361,7 +361,56 @@ Comprobar:
|
||||
>Con acceso ya a gitea, seria el momento de crear todos los repositorios remotos. Es una buena idea apoyarnos en [git-publish](herramienta%20git-publish.md).
|
||||
>Si tambien te has hartado de teclear git-publish, tambien tenemos un script para ti: [publicar-todos](herramienta%20publicar-todos.md)
|
||||
|
||||
## 8. Instalar ArgoCD
|
||||
## 8. Instalar Harbor
|
||||
|
||||
### 8.1 Instalar `helm`
|
||||
|
||||
```bash
|
||||
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
||||
```
|
||||
|
||||
Verifica que `helm` está instalado:
|
||||
|
||||
```bash
|
||||
helm version
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 8.2 Añadir el repositorio de charts de Harbor
|
||||
|
||||
```bash
|
||||
helm repo add harbor https://helm.goharbor.io
|
||||
helm repo update
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 8.3 Instalar Harbor
|
||||
|
||||
```bash
|
||||
helm install harbor harbor/harbor --namespace harbor --create-namespace -f values.yaml
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
> Si todo es correcto, podrás acceder a **https://harbor.manabo.org** con usuario `admin` y contraseña `Harbor12345`.
|
||||
|
||||
---
|
||||
|
||||
>Puedes loguearte desde tu equipo con:
|
||||
|
||||
```bash
|
||||
docker login harbor.manabo.org
|
||||
```
|
||||
|
||||
Y usar Harbor igual que Docker Hub.
|
||||
|
||||
---
|
||||
|
||||
> **En esta fase:** dejamos desplegado nuestro servidor de imágenes privado (`harbor.manabo.org`) para reemplazar Docker Hub en nuestros proyectos.
|
||||
|
||||
## 9. Instalar ArgoCD
|
||||
|
||||
### En Tartaro (o donde tengamos los manifiestos locales clonados de Gitea)
|
||||
|
||||
@ -390,7 +439,7 @@ En la interfaz web:
|
||||
7. Sync policy: automática
|
||||
8. Marca las casillas: `AUTO-CREATE NAMESPACE` `PRUNE` `SELF HEAL` `DIRECTORY RECURSE`
|
||||
|
||||
## 9. Instalar KubeVirt
|
||||
## 10. Instalar KubeVirt
|
||||
|
||||
export KUBEVIRT_VERSION=$(curl -s https://api.github.com/repos/kubevirt/kubevirt/releases/latest | grep tag_name | cut -d '"' -f 4)
|
||||
kubectl create namespace kubevirt
|
||||
@ -414,23 +463,23 @@ En la interfaz web:
|
||||
chmod +x virtctl
|
||||
sudo mv virtctl /usr/local/bin/
|
||||
|
||||
### 9.1 Configurar Multus y las redes virtuales
|
||||
### 10.1 Configurar Multus y las redes virtuales
|
||||
En cada nodo:
|
||||
|
||||
sudo rm -f /etc/cni/net.d/*
|
||||
sudo find /etc/cni/net.d/ -type f -exec rm {} \;
|
||||
sudo cp /var/lib/rancher/k3s/agent/etc/cni/net.d/10-flannel.conflist /etc/cni/net.d/
|
||||
echo 'KERNEL=="kvm", MODE="0666"' | sudo tee /etc/udev/rules.d/99-kvm.rules
|
||||
sudo udevadm control --reload-rules && sudo udevadm trigger
|
||||
|
||||
y en tartaro (o cualquier nodo)
|
||||
|
||||
kubectl -n kube-system delete pod -l app=multus
|
||||
|
||||
## 10. Desplegar servidor HTTP para ISOs (KubeVirt ISO Server)
|
||||
## 11. Desplegar servidor HTTP para ISOs (KubeVirt ISO Server)
|
||||
|
||||
cd ~/k3s/k8s-kubevirt-isoserver/
|
||||
kubectl apply -k .
|
||||
|
||||
## 11. Desplegar Apache Guacamole
|
||||
## 12. Desplegar Apache Guacamole
|
||||
|
||||
cd ~/k3s/k8s-guacamole/
|
||||
kubectl apply -k .
|
||||
|
@ -3,21 +3,7 @@
|
||||
Git-childremove es una herramienta para eliminar los git de las carpetas hijas
|
||||
|
||||
## 1. Crea el script
|
||||
Copia este contenido en ~/bin/git-publish (crea la carpeta ~/bin si no existe):
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
ENV_FILE="${HOME}/.gitpublish.env"
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo "Falta archivo .env en $ENV_FILE"
|
||||
exit 1# 🛠️Creacion de herramienta git-publish
|
||||
|
||||
Git-publish es una herramienta para automatizar la creacion y publicacion de repositorios
|
||||
|
||||
## 1. Crea el script
|
||||
Copia este contenido en ~/bin/git-publish (crea la carpeta ~/bin si no existe):
|
||||
Copia este contenido en ~/bin/git-childremove (crea la carpeta ~/bin si no existe):
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
|
Reference in New Issue
Block a user