Skip to content

Manualy install

fandilladp edited this page Jul 4, 2024 · 1 revision

Started K8S Kubeadm
  3 VM Kubernetes

  • 1 VM | Control-Plane
  • Ubuntu 20.04.6 LTS
  • Codename: focal
  • 8 CPUs and 16 GB of RAM
  • Min Disk 100 | Recommended 200 GB

  • 2 VM | Worker
  • Ubuntu 20.04.6 LTS
  • Codename: focal
  • 4 CPUs and 4 GB of RAM
  • Min Disk 50 | Recommended 100 GB

1 VM Gitlab

  • Ubuntu 20.04.6 LTS
  • Codename: focal
  • 4 CPU Minimum 8GB of RAM
  • Min Disk 50 GB | Recommended 100 GB

Step 1 Building a node Kubernetes cluster using kubeadm

“Minimum require deploying Kubernetes cluster at least 2 CPUs and 2 GB of RAM on each VM

If you have error connection refused disable swap $ sudo swapoff -a $ sudo sed -i '/ swap/d' /etc/fstab 1.# configure DNS $ sudo vim /etc/hosts

199.0.0.120 vm01
199.0.0.120 vm02
199.0.0.120 vm03
+more replace your ip worker

First, enable IPv4 forwarding and let iptables see bridged traffic. sudo cat <<EOF | tee /etc/sysctl.d/k8s.conf net.bridge.bridge-nf-call-iptables = 1 net.bridge.bridge-nf-call-ip6tables = 1 net.ipv4.ip_forward = 1 EOF

  • Dengan konfigurasi ini, Anda memastikan bahwa paket jaringan yang melewati interface bridge akan diproses oleh aturan iptables dan ip6tables, dan Anda mengaktifkan forwarding paket IPv4, yang esensial untuk operasional Kubernetes. Setelah menambahkan konfigurasi ini

apply sysctl params without reboot

sudo apt-get install ca-certificates curl

2.# install container runtime

Install docker engine following the installation https://docs.docker.com/engine/install/ubuntu/

If you have error docker permissions Try sudo groupadd docker sudo usermod -aG docker $USER newgrp docker

sudo sed -i 's/disabled_plugins = ["cri"]/#disabled_plugins = ["cri"]/g' /etc/containerd/config.toml

  • Perintah ini biasanya digunakan dalam konteks konfigurasi Kubernetes, di mana containerd digunakan sebagai runtime container. Plugin "CRI" harus diaktifkan agar Kubernetes dapat mengelola container menggunakan containerd. Dengan menonaktifkan baris yang menonaktifkan plugin "CRI", Anda memastikan bahwa CRI diaktifkan, memungkinkan Kubernetes untuk bekerja dengan containerd. sudo systemctl restart containerd
  1. install kubeadm, kubelet and kubectl


Installation following https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#installing-kubeadm-kubelet-and-kubectl

Set Control plane

kubeadm init
--pod-network-cidr=10.244.0.0/16
--apiserver-advertise-address=34.50.64.48

mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config

Create network add on kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/v0.20.2/Documentation/kube-flannel.yml

Create token add new node kubeadm token create --print-join-command

Set Worker Node

sudo kubeadm join xxxxxxxx

Set Roles your nodes kubectl label node vm02 node-role.kubernetes.io/worker1=worker1
kubectl label node vm03 node-role.kubernetes.io/worker2=worker2 kubectl label node wk3 node-role.kubernetes.io/worker3=worker3 kubectl label node wk4 node-role.kubernetes.io/worker4=worker4

kubectl label node vmi1435657.contaboserver.net node-role.kubernetes.io/worker1=worker1

Started Helm

$ curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 $ chmod 700 get_helm.sh $ ./get_helm.sh