Last active
February 8, 2023 07:47
-
-
Save IvanciniGT/40a26794e9d8fa0983c99fbcee14f505 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update | |
sudo apt -y upgrade | |
# Install basic dependencies | |
sudo apt -y install curl apt-transport-https | |
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - | |
// echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list | |
sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main" | |
# Disable Swap | |
sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab | |
sudo swapoff -a | |
# Enable kernel modules for crio | |
sudo modprobe overlay | |
sudo modprobe br_netfilter | |
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 | |
sudo sysctl --system | |
#Install crio | |
export OS=xUbuntu_18.04 | |
export CRIO_VERSION=1.23 | |
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/ /"|sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list | |
echo "deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$CRIO_VERSION/$OS/ /"|sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$CRIO_VERSION.list | |
curl -L https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$CRIO_VERSION/$OS/Release.key | sudo apt-key add - | |
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/Release.key | sudo apt-key add - | |
sudo apt update | |
sudo apt install cri-o cri-o-runc -y | |
apt-cache policy cri-o | |
sudo systemctl daemon-reload | |
sudo systemctl enable crio --now | |
# Install kubelet, kubeadm and kubectl | |
sudo apt update | |
sudo apt -y install vim git curl wget kubelet kubeadm kubectl | |
sudo apt-mark hold kubelet kubeadm kubectl | |
kubectl version --client && kubeadm version | |
# Initialize cluster | |
# sudo systemctl enable kubelet | |
#sudo kubeadm config images pull | |
# kubeadm init options that are used to bootstrap cluster. | |
sudo kubeadm init --pod-network-cidr=10.10.0.0/16 --cri-socket=unix:///var/run/crio/crio.sock | |
# To start using your cluster, you need to run the following as a regular user: | |
mkdir -p $HOME/.kube | |
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config | |
sudo chown $(id -u):$(id -g) $HOME/.kube/config | |
kubectl cluster-info | |
# Remove the master taint : test environments | |
kubectl taint nodes --all node-role.kubernetes.io/control-plane- | |
# Install network plugin on Master | |
curl https://raw.githubusercontent.com/projectcalico/calico/v3.25.0/manifests/calico.yaml -O | |
kubectl apply -f calico.yaml | |
kubectl get nodes -o wide | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment