Kubernetest Installation Steps 1 29 Ubuntu 22 04
Kubernetest Installation Steps 1 29 Ubuntu 22 04
io/docs/setup/production-environment/tools/kubeadm/install-
kubeadm/
vi .vimrc
set tabstop=4
set shiftwidth=4
set expandtab
Ubuntu - 22.04
Kubernetes - 1.29
swapoff -a
vi /etc/hosts
10.0.0.10 infra-server.example.com infra-server
10.0.0.11 k8s-master.example.com k8s-master
10.0.0.12 k8s-worker1.example.com k8s-worker1
10.0.0.13 k8s-worker2.example.com k8s-worker2
10.0.0.14 k8s-worker3.example.com k8s-worker3
vi /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
sysctl -p
apt-get update
apt-get install -y apt-transport-https ca-certificates curl gpg
modprobe overlay
modprobe br_netfilter
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
sysctl --system
export OS=xUbuntu_22.04
export CRIO_VERSION=1.28
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 -
apt update -y
apt install cri-o cri-o-runc -y
systemctl enable crio.service
systemctl start crio.service
apt install cri-tools -y
--------------------------------------------------------------------------------
Your Kubernetes control-plane has initialized successfully!
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
export KUBECONFIG=/etc/kubernetes/admin.conf
Then you can join any number of worker nodes by running the following on each as
root:
root@k8s-master:~#
--------------------------------------------------------------------------------
kubectl create -f
https://raw.githubusercontent.com/projectcalico/calico/v3.27.2/manifests/tigera-
operator.yaml
wget https://raw.githubusercontent.com/projectcalico/calico/v3.27.2/manifests/
custom-resources.yaml
cp -p custom-resources.yaml custom-resources.yaml_bkp
sed -i 's/cidr: 192\.168\.0\.0\/16/cidr: 10.244.0.0\/16/g' custom-resources.yaml
diff custom-resources.yaml custom-resources.yaml_bkp
kubectl create -f custom-resources.yaml
###################################################################################
##############################################
kubectl label node k8s-worker1 node-role.kubernetes.io/worker=worker
kubectl label node k8s-worker2 node-role.kubernetes.io/worker=worker
kubectl label node k8s-worker3 node-role.kubernetes.io/worker=worker
############################################ METALLB
###################################################################################
##
# see what changes would be made, returns nonzero returncode if different
kubectl get configmap kube-proxy -n kube-system -o yaml | sed -e "s/strictARP:
false/strictARP: true/" | kubectl diff -f - -n kube-system
kubectl apply -f
https://raw.githubusercontent.com/metallb/metallb/v0.14.3/config/manifests/metallb-
native.yaml