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.30
vi /etc/hosts
10.0.0.5 infra-server.example.com infra-server
10.0.0.10 workstation.example.com workstation
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
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 -
--------------------------------------------------------------------------------
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
cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
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.3/manifests/tigera-
operator.yaml
wget https://raw.githubusercontent.com/projectcalico/calico/v3.27.3/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