Instala segun chatgpt
This commit is contained in:
@@ -30,7 +30,7 @@ runcmd:
|
|||||||
- cd /root
|
- cd /root
|
||||||
- git clone https://git.lfgut.duckdns.org/luis/infra_cloudinit.git
|
- git clone https://git.lfgut.duckdns.org/luis/infra_cloudinit.git
|
||||||
- cd infra_cloudinit
|
- cd infra_cloudinit
|
||||||
# - ./k8s.sh
|
- ./k8s.sh
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "Archivo user_data.yaml creado con éxito."
|
echo "Archivo user_data.yaml creado con éxito."
|
||||||
|
|||||||
37
k8s.sh
Executable file
37
k8s.sh
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
# Actualización del sistema
|
||||||
|
apt update && apt upgrade -y
|
||||||
|
|
||||||
|
# Instalación de dependencias necesarias
|
||||||
|
apt install qemu-guest-agent apt-transport-https ca-certificates curl software-properties-common -y
|
||||||
|
systemctl enable --now qemu-guest-agent
|
||||||
|
|
||||||
|
# https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/
|
||||||
|
# version 1.32
|
||||||
|
|
||||||
|
# Agregar la clave de Google Cloud
|
||||||
|
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
|
||||||
|
|
||||||
|
|
||||||
|
# Agregar el repositorio de Kubernetes
|
||||||
|
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
|
||||||
|
|
||||||
|
|
||||||
|
# Actualizar los repositorios e instalar Kubernetes
|
||||||
|
apt update
|
||||||
|
apt install kubelet kubeadm kubectl -y
|
||||||
|
|
||||||
|
# Marcar los paquetes para que no se actualicen
|
||||||
|
apt-mark hold kubelet kubeadm kubectl
|
||||||
|
|
||||||
|
# Habilitar el servicio kubelet
|
||||||
|
sudo systemctl enable kubelet && sudo systemctl start kubelet
|
||||||
|
|
||||||
|
# Instalar herramientas de red para el cluster (Flannel como ejemplo)
|
||||||
|
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
|
||||||
|
|
||||||
|
# Reiniciar para aplicar cambios
|
||||||
|
sudo reboot
|
||||||
|
|
||||||
Reference in New Issue
Block a user