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).
|
>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)
|
>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)
|
### En Tartaro (o donde tengamos los manifiestos locales clonados de Gitea)
|
||||||
|
|
||||||
@@ -390,7 +439,7 @@ En la interfaz web:
|
|||||||
7. Sync policy: automática
|
7. Sync policy: automática
|
||||||
8. Marca las casillas: `AUTO-CREATE NAMESPACE` `PRUNE` `SELF HEAL` `DIRECTORY RECURSE`
|
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)
|
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
|
kubectl create namespace kubevirt
|
||||||
@@ -414,23 +463,23 @@ En la interfaz web:
|
|||||||
chmod +x virtctl
|
chmod +x virtctl
|
||||||
sudo mv virtctl /usr/local/bin/
|
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:
|
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/
|
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)
|
y en tartaro (o cualquier nodo)
|
||||||
|
|
||||||
kubectl -n kube-system delete pod -l app=multus
|
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/
|
cd ~/k3s/k8s-kubevirt-isoserver/
|
||||||
kubectl apply -k .
|
kubectl apply -k .
|
||||||
|
|
||||||
## 11. Desplegar Apache Guacamole
|
## 12. Desplegar Apache Guacamole
|
||||||
|
|
||||||
cd ~/k3s/k8s-guacamole/
|
cd ~/k3s/k8s-guacamole/
|
||||||
kubectl apply -k .
|
kubectl apply -k .
|
||||||
|
|||||||
@@ -3,21 +3,7 @@
|
|||||||
Git-childremove es una herramienta para eliminar los git de las carpetas hijas
|
Git-childremove es una herramienta para eliminar los git de las carpetas hijas
|
||||||
|
|
||||||
## 1. Crea el script
|
## 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
|
|
||||||
|
|
||||||
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):
|
|
||||||
|
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|||||||
42
k8s-espocrm/deployments/espocrm.yaml
Normal file
42
k8s-espocrm/deployments/espocrm.yaml
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: espocrm
|
||||||
|
namespace: espocrm
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: espocrm
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: espocrm
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: espocrm
|
||||||
|
image: espocrm/espocrm
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
env:
|
||||||
|
- name: ESPOCRM_DATABASE_PLATFORM
|
||||||
|
value: Mysql
|
||||||
|
- name: ESPOCRM_DATABASE_HOST
|
||||||
|
value: mysql
|
||||||
|
- name: ESPOCRM_DATABASE_USER
|
||||||
|
value: espocrm
|
||||||
|
- name: ESPOCRM_DATABASE_PASSWORD
|
||||||
|
value: database_password
|
||||||
|
- name: ESPOCRM_ADMIN_USERNAME
|
||||||
|
value: admin
|
||||||
|
- name: ESPOCRM_ADMIN_PASSWORD
|
||||||
|
value: password
|
||||||
|
- name: ESPOCRM_SITE_URL
|
||||||
|
value: "https://espocrm.avgx.org"
|
||||||
|
volumeMounts:
|
||||||
|
- name: espocrm-data
|
||||||
|
mountPath: /var/www/html
|
||||||
|
volumes:
|
||||||
|
- name: espocrm-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: espocrm-pvc
|
||||||
34
k8s-espocrm/deployments/mysql.yaml
Normal file
34
k8s-espocrm/deployments/mysql.yaml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: mysql
|
||||||
|
namespace: espocrm
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: mysql
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: mysql
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: mysql
|
||||||
|
image: mysql:8
|
||||||
|
env:
|
||||||
|
- name: MYSQL_ROOT_PASSWORD
|
||||||
|
value: root_password
|
||||||
|
- name: MYSQL_DATABASE
|
||||||
|
value: espocrm
|
||||||
|
- name: MYSQL_USER
|
||||||
|
value: espocrm
|
||||||
|
- name: MYSQL_PASSWORD
|
||||||
|
value: database_password
|
||||||
|
volumeMounts:
|
||||||
|
- name: mysql-data
|
||||||
|
mountPath: /var/lib/mysql
|
||||||
|
volumes:
|
||||||
|
- name: mysql-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: mysql-pvc
|
||||||
27
k8s-espocrm/ingress/ingress.yaml
Normal file
27
k8s-espocrm/ingress/ingress.yaml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: espocrm-ingress
|
||||||
|
namespace: espocrm
|
||||||
|
annotations:
|
||||||
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||||
|
# nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
||||||
|
nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
|
||||||
|
nginx.ingress.kubernetes.io/enable-websockets: "true"
|
||||||
|
spec:
|
||||||
|
ingressClassName: nginx
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- espocrm.avgc.org
|
||||||
|
secretName: espocrm-tls
|
||||||
|
rules:
|
||||||
|
- host: espocrm.avgx.org
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: espocrm
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
14
k8s-espocrm/kustomization.yaml
Normal file
14
k8s-espocrm/kustomization.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
namespace: espocrm
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- namespace.yaml
|
||||||
|
- deployments/espocrm.yaml
|
||||||
|
- deployments/mysql.yaml
|
||||||
|
- services/espocrm.yaml
|
||||||
|
- services/mysql.yaml
|
||||||
|
- pvc/espocrm-pvc.yaml
|
||||||
|
- pvc/mysql-pvc.yaml
|
||||||
|
- ingress/ingress.yaml
|
||||||
4
k8s-espocrm/namespace.yaml
Normal file
4
k8s-espocrm/namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: espocrm
|
||||||
12
k8s-espocrm/pvc/espocrm-pvc.yaml
Normal file
12
k8s-espocrm/pvc/espocrm-pvc.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: espocrm-pvc
|
||||||
|
namespace: espocrm
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
storageClassName: nfs-manabo
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
12
k8s-espocrm/pvc/mysql-pvc.yaml
Normal file
12
k8s-espocrm/pvc/mysql-pvc.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: mysql-pvc
|
||||||
|
namespace: espocrm
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
storageClassName: nfs-manabo
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
13
k8s-espocrm/services/espocrm.yaml
Normal file
13
k8s-espocrm/services/espocrm.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: espocrm
|
||||||
|
namespace: espocrm
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: espocrm
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 80
|
||||||
|
targetPort: 80
|
||||||
|
type: ClusterIP
|
||||||
13
k8s-espocrm/services/mysql.yaml
Normal file
13
k8s-espocrm/services/mysql.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: mysql
|
||||||
|
namespace: espocrm
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: mysql
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 3306
|
||||||
|
targetPort: 3306
|
||||||
|
clusterIP: None
|
||||||
50
k8s-harbor/values.yaml
Normal file
50
k8s-harbor/values.yaml
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
expose:
|
||||||
|
type: ingress
|
||||||
|
tls:
|
||||||
|
enabled: true
|
||||||
|
certSource: auto
|
||||||
|
ingress:
|
||||||
|
ingressClassName: nginx
|
||||||
|
annotations:
|
||||||
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||||
|
hosts:
|
||||||
|
core: harbor.manabo.org
|
||||||
|
notary: notary.harbor.manabo.org
|
||||||
|
|
||||||
|
externalURL: https://harbor.manabo.org
|
||||||
|
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
resourcePolicy: "keep"
|
||||||
|
persistentVolumeClaim:
|
||||||
|
registry:
|
||||||
|
storageClass: "nfs-manabo"
|
||||||
|
chartmuseum:
|
||||||
|
storageClass: "nfs-manabo"
|
||||||
|
jobservice:
|
||||||
|
storageClass: "nfs-manabo"
|
||||||
|
database:
|
||||||
|
storageClass: "nfs-manabo"
|
||||||
|
redis:
|
||||||
|
storageClass: "nfs-manabo"
|
||||||
|
trivy:
|
||||||
|
storageClass: "nfs-manabo"
|
||||||
|
|
||||||
|
harborAdminPassword: Harbor12345
|
||||||
|
|
||||||
|
portal:
|
||||||
|
replicaCount: 1
|
||||||
|
|
||||||
|
core:
|
||||||
|
replicaCount: 1
|
||||||
|
|
||||||
|
registry:
|
||||||
|
replicaCount: 1
|
||||||
|
|
||||||
|
database:
|
||||||
|
type: internal
|
||||||
|
internal:
|
||||||
|
password: "root123"
|
||||||
|
|
||||||
|
redis:
|
||||||
|
type: internal
|
||||||
@@ -6,7 +6,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
source:
|
source:
|
||||||
repoURL: 'http://192.168.1.9:30300/xavor/k8s-gitea.git'
|
repoURL: 'http://192.168.1.10:30300/xavor/k8s-gitea.git'
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
path: .
|
path: .
|
||||||
destination:
|
destination:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
source:
|
source:
|
||||||
repoURL: 'http://192.168.1.9:30300/xavor/k8s-guacamole.git'
|
repoURL: 'http://192.168.1.10:30300/xavor/k8s-guacamole.git'
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
path: .
|
path: .
|
||||||
destination:
|
destination:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
source:
|
source:
|
||||||
repoURL: 'http://192.168.1.9:30300/xavor/k8s-ingress-controller.git'
|
repoURL: 'http://192.168.1.10:30300/xavor/k8s-ingress-controller.git'
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
path: .
|
path: .
|
||||||
destination:
|
destination:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
source:
|
source:
|
||||||
repoURL: 'http://192.168.1.9:30300/xavor/k8s-kubevirt-isoserver.git'
|
repoURL: 'http://192.168.1.10:30300/xavor/k8s-kubevirt-isoserver.git'
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
path: .
|
path: .
|
||||||
destination:
|
destination:
|
||||||
|
|||||||
20
k8s-master/apps/kubevirt-manager.yaml
Normal file
20
k8s-master/apps/kubevirt-manager.yaml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: kubevirt-manager
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
project: default
|
||||||
|
source:
|
||||||
|
repoURL: 'http://192.168.1.10:30300/xavor/k8s-kubevirt-manager.git'
|
||||||
|
targetRevision: HEAD
|
||||||
|
path: .
|
||||||
|
destination:
|
||||||
|
server: 'https://kubernetes.default.svc'
|
||||||
|
namespace: kubevirt
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- CreateNamespace=true
|
||||||
@@ -6,7 +6,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
source:
|
source:
|
||||||
repoURL: 'http://192.168.1.9:30300/xavor/k8s-storage.git'
|
repoURL: 'http://192.168.1.10:30300/xavor/k8s-storage.git'
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
path: .
|
path: .
|
||||||
destination:
|
destination:
|
||||||
|
|||||||
20
k8s-master/apps/vm-windows-demo.yaml.pause
Normal file
20
k8s-master/apps/vm-windows-demo.yaml.pause
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: k8s-vm-windows-demo
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
project: default
|
||||||
|
source:
|
||||||
|
repoURL: 'http://192.168.1.10:30300/xavor/k8s-vm-windows-demo.git'
|
||||||
|
targetRevision: HEAD
|
||||||
|
path: .
|
||||||
|
destination:
|
||||||
|
server: 'https://kubernetes.default.svc'
|
||||||
|
namespace: k8s-vm-windows-demo
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- CreateNamespace=true
|
||||||
@@ -6,7 +6,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
source:
|
source:
|
||||||
repoURL: 'http://192.168.1.9:30300/xavor/k8s-vscode.git'
|
repoURL: 'http://192.168.1.10:30300/xavor/k8s-vscode.git'
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
path: .
|
path: .
|
||||||
destination:
|
destination:
|
||||||
|
|||||||
@@ -1,16 +1,29 @@
|
|||||||
apiVersion: cdi.kubevirt.io/v1beta1
|
apiVersion: cdi.kubevirt.io/v1beta1
|
||||||
kind: DataVolume
|
kind: DataVolume
|
||||||
metadata:
|
metadata:
|
||||||
name: windows-disk
|
name: windows-iso
|
||||||
namespace: k8s-vm-windows-demo
|
namespace: k8s-vm-windows-demo
|
||||||
spec:
|
spec:
|
||||||
source:
|
source:
|
||||||
http:
|
http:
|
||||||
url: "https://isoserver.manabo.org/Windows.iso"
|
url: "http://192.168.1.10:30088/Windows.iso"
|
||||||
pvc:
|
pvc:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 60Gi
|
storage: 6Gi
|
||||||
storageClassName: nfs-manabo
|
storageClassName: nfs-manabo
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: winhd
|
||||||
|
namespace: k8s-vm-windows-demo
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 60Gi
|
||||||
|
storageClassName: nfs-manabo
|
||||||
|
|||||||
@@ -4,3 +4,4 @@ resources:
|
|||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
- virtual-machine.yaml
|
- virtual-machine.yaml
|
||||||
- data-volume.yaml
|
- data-volume.yaml
|
||||||
|
- nad-administracion.yaml
|
||||||
|
|||||||
15
k8s-vm-windows-demo/nad-administracion.yaml
Normal file
15
k8s-vm-windows-demo/nad-administracion.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: k8s.cni.cncf.io/v1
|
||||||
|
kind: NetworkAttachmentDefinition
|
||||||
|
metadata:
|
||||||
|
name: administracion-net
|
||||||
|
namespace: k8s-vm-windows-demo
|
||||||
|
spec:
|
||||||
|
config: '{
|
||||||
|
"cniVersion": "0.3.1",
|
||||||
|
"type": "macvlan",
|
||||||
|
"master": "br0",
|
||||||
|
"mode": "bridge",
|
||||||
|
"ipam": {
|
||||||
|
"type": "dhcp"
|
||||||
|
}
|
||||||
|
}'
|
||||||
@@ -4,7 +4,7 @@ metadata:
|
|||||||
name: windows-demo
|
name: windows-demo
|
||||||
namespace: k8s-vm-windows-demo
|
namespace: k8s-vm-windows-demo
|
||||||
spec:
|
spec:
|
||||||
running: true
|
runStrategy: Always
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -13,38 +13,41 @@ spec:
|
|||||||
domain:
|
domain:
|
||||||
cpu:
|
cpu:
|
||||||
cores: 2
|
cores: 2
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: 4Gi
|
||||||
devices:
|
devices:
|
||||||
disks:
|
disks:
|
||||||
- name: cdromiso
|
- name: cdromiso
|
||||||
cdrom:
|
cdrom:
|
||||||
bus: sata
|
bus: sata
|
||||||
|
readonly: true
|
||||||
|
bootOrder: 1
|
||||||
|
- name: virtiocontainerdisk
|
||||||
|
cdrom:
|
||||||
|
bus: sata
|
||||||
|
readonly: true
|
||||||
- name: harddrive
|
- name: harddrive
|
||||||
disk:
|
disk:
|
||||||
bus: virtio
|
bus: virtio
|
||||||
- disk:
|
bootOrder: 2
|
||||||
bus: virtio
|
|
||||||
name: cloudinitdisk
|
|
||||||
interfaces:
|
interfaces:
|
||||||
- name: default
|
- name: administracion
|
||||||
masquerade: {}
|
bridge: {}
|
||||||
|
model: virtio
|
||||||
machine:
|
machine:
|
||||||
type: q35
|
type: q35
|
||||||
resources:
|
networks:
|
||||||
requests:
|
- name: administracion
|
||||||
memory: 4Gi
|
multus:
|
||||||
|
networkName: k8s-vm-windows-demo/administracion-net
|
||||||
volumes:
|
volumes:
|
||||||
- name: cdromiso
|
- name: cdromiso
|
||||||
containerDisk:
|
|
||||||
image: kubevirt/cirros-container-disk-demo # se reemplazará en DataVolume
|
|
||||||
- name: harddrive
|
|
||||||
dataVolume:
|
dataVolume:
|
||||||
name: windows-disk
|
name: windows-iso
|
||||||
- name: cloudinitdisk
|
- name: harddrive
|
||||||
cloudInitNoCloud:
|
persistentVolumeClaim:
|
||||||
userData: |
|
claimName: winhd
|
||||||
#cloud-config
|
- name: virtiocontainerdisk
|
||||||
password: "Windows1234"
|
containerDisk:
|
||||||
chpasswd: { expire: False }
|
image: kubevirt/virtio-container-disk
|
||||||
networks:
|
|
||||||
- name: default
|
|
||||||
pod: {}
|
|
||||||
|
|||||||
@@ -12,13 +12,16 @@ Este repositorio está orientado tanto a **homelabs avanzados** como a entornos
|
|||||||
|--------|-------------|
|
|--------|-------------|
|
||||||
| [📘 Guía de instalación](docs/guia-instalacion.md) | Paso a paso para desplegar el clúster completo. |
|
| [📘 Guía de instalación](docs/guia-instalacion.md) | Paso a paso para desplegar el clúster completo. |
|
||||||
| [🏗️ Arquitectura del clúster](docs/arquitectura.md) | Estructura lógica, roles de nodos y servicios desplegados. |
|
| [🏗️ Arquitectura del clúster](docs/arquitectura.md) | Estructura lógica, roles de nodos y servicios desplegados. |
|
||||||
|
| [🌐 Direccionamiento y Redes](docs/direccionamiento.md) | Asignación de IPs, segmentación de redes y VLANs. |
|
||||||
| [🛠️ Herramientas auxiliares](docs/herramientas-auxiliares.md) | Scripts para automatizar tareas como publicar, clonar o subir repos. |
|
| [🛠️ Herramientas auxiliares](docs/herramientas-auxiliares.md) | Scripts para automatizar tareas como publicar, clonar o subir repos. |
|
||||||
| [📚 Procedimientos adicionales](docs/procedimientos-adicionales.md) | Tareas puntuales como eliminar namespaces atascados o cargas manuales. |
|
| [📚 Procedimientos adicionales](docs/procedimientos-adicionales.md) | Tareas puntuales como eliminar namespaces atascados o cargas manuales. |
|
||||||
|
| [📋 Comandos Kubernetes básicos](docs/chuletario.md) | Referencia rápida de comandos `kubectl` y `virtctl` más usados. |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## ⚙️ Componentes clave del clúster
|
## ⚙️ Componentes clave del clúster
|
||||||
|
|
||||||
|
- **Separación de redes**: tráfico de gestión, almacenamiento e internodo aislados por VLANs.
|
||||||
- **Alta disponibilidad** con IP flotante (`keepalived`) y bonding de red (`bond0`)
|
- **Alta disponibilidad** con IP flotante (`keepalived`) y bonding de red (`bond0`)
|
||||||
- **K3s cluster** en `tartaro`, `styx` y `niflheim` (dedicado a almacenamiento)
|
- **K3s cluster** en `tartaro`, `styx` y `niflheim` (dedicado a almacenamiento)
|
||||||
- **ZFS + NFS** como backend de almacenamiento
|
- **ZFS + NFS** como backend de almacenamiento
|
||||||
@@ -28,6 +31,7 @@ Este repositorio está orientado tanto a **homelabs avanzados** como a entornos
|
|||||||
- **KubeVirt** para gestionar VMs dentro de Kubernetes
|
- **KubeVirt** para gestionar VMs dentro de Kubernetes
|
||||||
- **Apache Guacamole** para acceso remoto a escritorios vía navegador
|
- **Apache Guacamole** para acceso remoto a escritorios vía navegador
|
||||||
- **VS Code Server** desplegado como pod accesible por Ingress
|
- **VS Code Server** desplegado como pod accesible por Ingress
|
||||||
|
- **Harbor** como registro de contenedores privado desplegado en Kubernetes
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -36,6 +40,8 @@ Este repositorio está orientado tanto a **homelabs avanzados** como a entornos
|
|||||||
Estructura del repositorio:
|
Estructura del repositorio:
|
||||||
- docs/: Carpeta de documentación con guías y herramientas auxiliares.
|
- docs/: Carpeta de documentación con guías y herramientas auxiliares.
|
||||||
- guia-instalacion.md: Manual paso a paso para desplegar todo el clúster.
|
- guia-instalacion.md: Manual paso a paso para desplegar todo el clúster.
|
||||||
|
- direccionamiento-redes.md: Detalle de la segmentación IP y VLANes.
|
||||||
|
- comandos-kubectl.md: Comandos frecuentes de gestión Kubernetes y KubeVirt.
|
||||||
- herramienta git-publish.md: Explica el script para publicar repositorios individuales en Gitea.
|
- herramienta git-publish.md: Explica el script para publicar repositorios individuales en Gitea.
|
||||||
- herramienta publicar-todos.md: Script para publicar todos los manifiestos del clúster de forma masiva.
|
- herramienta publicar-todos.md: Script para publicar todos los manifiestos del clúster de forma masiva.
|
||||||
- herramienta git-subirtodos.md: Sube todos los cambios a los repositorios remotos.
|
- herramienta git-subirtodos.md: Sube todos los cambios a los repositorios remotos.
|
||||||
@@ -45,6 +51,7 @@ Estructura del repositorio:
|
|||||||
- k8s-cert-manager/: Manifiestos para instalar cert-manager, incluyendo ClusterIssuer de staging y producción.
|
- k8s-cert-manager/: Manifiestos para instalar cert-manager, incluyendo ClusterIssuer de staging y producción.
|
||||||
- k8s-gitea/: Manifiestos para desplegar Gitea y su base de datos con almacenamiento persistente y acceso externo.
|
- k8s-gitea/: Manifiestos para desplegar Gitea y su base de datos con almacenamiento persistente y acceso externo.
|
||||||
- k8s-guacamole/: Manifiestos para desplegar Apache Guacamole con autenticación MySQL y acceso vía Ingress.
|
- k8s-guacamole/: Manifiestos para desplegar Apache Guacamole con autenticación MySQL y acceso vía Ingress.
|
||||||
|
- k8s-harbor/: Manifiestos para desplegar Harbor como registro de contenedores privado.
|
||||||
- k8s-ingress-controller/: Despliegue de ingress-nginx como DaemonSet con configuración personalizada, RBAC, y service.
|
- k8s-ingress-controller/: Despliegue de ingress-nginx como DaemonSet con configuración personalizada, RBAC, y service.
|
||||||
- k8s-kubevirt-isoserver/: Servidor HTTP que expone imágenes ISO para KubeVirt, con su PVC y despliegue.
|
- k8s-kubevirt-isoserver/: Servidor HTTP que expone imágenes ISO para KubeVirt, con su PVC y despliegue.
|
||||||
- k8s-kubevirt-manager/: Despliegue opcional del panel web de KubeVirt con su acceso Ingress y RBAC.
|
- k8s-kubevirt-manager/: Despliegue opcional del panel web de KubeVirt con su acceso Ingress y RBAC.
|
||||||
@@ -94,5 +101,6 @@ Repositorio privado/documentado en [https://git.manabo.org](https://git.manabo.o
|
|||||||
✅ Almacenamiento replicado
|
✅ Almacenamiento replicado
|
||||||
✅ App of Apps en Argo CD
|
✅ App of Apps en Argo CD
|
||||||
✅ Acceso remoto vía Guacamole
|
✅ Acceso remoto vía Guacamole
|
||||||
|
✅ Registro de contenedores privado con Harbor
|
||||||
☑️ Próximos pasos: integración con FreeIPA, backups, y monitorización
|
☑️ Próximos pasos: integración con FreeIPA, backups, y monitorización
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user