From b28bde5665bdb24661017c223489c0145516d503 Mon Sep 17 00:00:00 2001 From: creylopez Date: Fri, 18 Nov 2022 09:04:41 +0100 Subject: [PATCH] Creada shell para instalar kubernetes y shells renombradas --- CreaCluster/10-prepara.sh | 84 +++++++++++++++++++ ...{00-borraCluster.sh => 20-borraCluster.sh} | 0 ...lizaCluster.sh => 30-inicializaCluster.sh} | 0 ...nfigCluster.sh => 40-creaConfigCluster.sh} | 0 .../{03-creaCalico.sh => 50-creaCalico.sh} | 0 ...masterEsWorker.sh => 60-masterEsWorker.sh} | 0 ...nfirmaRunning.sh => 70-confirmaRunning.sh} | 0 CreaCluster/shell.sh | 1 + 8 files changed, 85 insertions(+) create mode 100644 CreaCluster/10-prepara.sh rename CreaCluster/{00-borraCluster.sh => 20-borraCluster.sh} (100%) rename CreaCluster/{01-inicializaCluster.sh => 30-inicializaCluster.sh} (100%) rename CreaCluster/{02-creaConfigCluster.sh => 40-creaConfigCluster.sh} (100%) rename CreaCluster/{03-creaCalico.sh => 50-creaCalico.sh} (100%) rename CreaCluster/{04-masterEsWorker.sh => 60-masterEsWorker.sh} (100%) rename CreaCluster/{05-confirmaRunning.sh => 70-confirmaRunning.sh} (100%) create mode 100644 CreaCluster/shell.sh diff --git a/CreaCluster/10-prepara.sh b/CreaCluster/10-prepara.sh new file mode 100644 index 00000000..03910748 --- /dev/null +++ b/CreaCluster/10-prepara.sh @@ -0,0 +1,84 @@ +read -p "Voy a quitar swap. Pulsa ENTER para seguir:" mainmenuinput + +# disable swap + +sudo swapoff -a +sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab + +read -p "Cargar kernel modules. Pulsa ENTER para seguir:" mainmenuinput + +# Load the following kernel modules on all the nodes + +sudo tee /etc/modules-load.d/containerd.conf </dev/null 2>&1 +sudo sed -i 's/SystemdCgroup \= false/SystemdCgroup \= true/g' /etc/containerd/config.toml + +read -p "Enable containerd. Pulsa ENTER para seguir:" mainmenuinput + +# Restart and enable containerd service + +sudo systemctl restart containerd +sudo systemctl enable containerd + +read -p "AƱade repository de Kubernetes. Pulsa ENTER para seguir:" mainmenuinput + +# Add apt repository for Kubernetes + +curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - +sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main" + +# Install Kubernetes components Kubectl, kubeadm & kubelet +read -p "Instalar componentes de kubernetes. Pulsa ENTER para seguir:" mainmenuinput + + +sudo apt update +sudo apt install -y kubelet kubeadm kubectl +sudo apt-mark hold kubelet kubeadm kubectl diff --git a/CreaCluster/00-borraCluster.sh b/CreaCluster/20-borraCluster.sh similarity index 100% rename from CreaCluster/00-borraCluster.sh rename to CreaCluster/20-borraCluster.sh diff --git a/CreaCluster/01-inicializaCluster.sh b/CreaCluster/30-inicializaCluster.sh similarity index 100% rename from CreaCluster/01-inicializaCluster.sh rename to CreaCluster/30-inicializaCluster.sh diff --git a/CreaCluster/02-creaConfigCluster.sh b/CreaCluster/40-creaConfigCluster.sh similarity index 100% rename from CreaCluster/02-creaConfigCluster.sh rename to CreaCluster/40-creaConfigCluster.sh diff --git a/CreaCluster/03-creaCalico.sh b/CreaCluster/50-creaCalico.sh similarity index 100% rename from CreaCluster/03-creaCalico.sh rename to CreaCluster/50-creaCalico.sh diff --git a/CreaCluster/04-masterEsWorker.sh b/CreaCluster/60-masterEsWorker.sh similarity index 100% rename from CreaCluster/04-masterEsWorker.sh rename to CreaCluster/60-masterEsWorker.sh diff --git a/CreaCluster/05-confirmaRunning.sh b/CreaCluster/70-confirmaRunning.sh similarity index 100% rename from CreaCluster/05-confirmaRunning.sh rename to CreaCluster/70-confirmaRunning.sh diff --git a/CreaCluster/shell.sh b/CreaCluster/shell.sh new file mode 100644 index 00000000..44ded62a --- /dev/null +++ b/CreaCluster/shell.sh @@ -0,0 +1 @@ +read -p "Pulsa ENTER para seguir:" mainmenuinput