Browse Source

Creada shell para instalar kubernetes y shells renombradas

main
creylopez 3 years ago
parent
commit
b28bde5665
8 changed files with 85 additions and 0 deletions
  1. +84
    -0
      CreaCluster/10-prepara.sh
  2. +0
    -0
      CreaCluster/20-borraCluster.sh
  3. +0
    -0
      CreaCluster/30-inicializaCluster.sh
  4. +0
    -0
      CreaCluster/40-creaConfigCluster.sh
  5. +0
    -0
      CreaCluster/50-creaCalico.sh
  6. +0
    -0
      CreaCluster/60-masterEsWorker.sh
  7. +0
    -0
      CreaCluster/70-confirmaRunning.sh
  8. +1
    -0
      CreaCluster/shell.sh

+ 84
- 0
CreaCluster/10-prepara.sh View File

@ -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 <<EOF
overlay
br_netfilter
EOF
sudo modprobe overlay
sudo modprobe br_netfilter
read -p "Parametros del kernel. Pulsa ENTER para seguir:" mainmenuinput
# Set the following Kernel parameters for Kubernetes
sudo tee /etc/sysctl.d/kubernetes.conf <<EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
EOF
# Reload the above changes
sudo sysctl --system
read -p "Instalar dependencias de containerd. Pulsa ENTER para seguir:" mainmenuinput
# Install containerd run time
# dependencies
sudo apt install -y curl gnupg2 software-properties-common apt-transport-https ca-certificates
read -p "Enable docker repository. Pulsa ENTER para seguir:" mainmenuinput
# Enable docker repository
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/docker.gpg
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
read -p "Instalar containerd. Pulsa ENTER para seguir:" mainmenuinput
# install containerd
sudo apt update
sudo apt install -y containerd.io
read -p "Configurar containerd. Pulsa ENTER para seguir:" mainmenuinput
# Configure containerd so that it starts using systemd as cgroup.
containerd config default | sudo tee /etc/containerd/config.toml >/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

CreaCluster/00-borraCluster.sh → CreaCluster/20-borraCluster.sh View File


CreaCluster/01-inicializaCluster.sh → CreaCluster/30-inicializaCluster.sh View File


CreaCluster/02-creaConfigCluster.sh → CreaCluster/40-creaConfigCluster.sh View File


CreaCluster/03-creaCalico.sh → CreaCluster/50-creaCalico.sh View File


CreaCluster/04-masterEsWorker.sh → CreaCluster/60-masterEsWorker.sh View File


CreaCluster/05-confirmaRunning.sh → CreaCluster/70-confirmaRunning.sh View File


+ 1
- 0
CreaCluster/shell.sh View File

@ -0,0 +1 @@
read -p "Pulsa ENTER para seguir:" mainmenuinput

Loading…
Cancel
Save