osecuba.blogg.se

Setup ubuntu virtualbox
Setup ubuntu virtualbox





# Exit from the root account mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/nf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/configĬNI plugin is required to implement the Kubernetes network model. For this example, we are setting up Kube config with cluster-admin privileges.

setup ubuntu virtualbox

We are required to set up a Kube config to access the Kubernetes cluster. Running kubeadm init will create a control plane node kubeadm init -upload-certs | tee kubeadm-init.out ip addr show -> You will see output with 10.130.0.x that will be the NAT Network IpAddress vim /etc/hosts -> Add the following content 10.130.0.5 k8scp Setup the network so it will be easier to use the hostname rather than the IP address later. vim /etc/apt//kubernetes.list -> Add the following content into kubernetes.list deb kubernetes-xenial main curl -s | apt-key add - apt-get update apt-get install -y kubeadm=1.22.1-00 kubelet=1.22.1-00 kubectl=1.22.1-00 apt-mark hold kubelet kubeadm kubectl kubectl is a command line tool that runs commands against the clusters. kubelet is a primary node agent that runs each node.

setup ubuntu virtualbox

kubeadm is a tool that we will be using to init control plane node and join worker node.

setup ubuntu virtualbox

You will require kubeadm, kubeletand kubectl when installing Kubernetes cluster nodes. modprobe overlay modprobe br_netfilter vim /etc/sysctl.d/k8s.conf -> Add the following content into k8s.conf -nf-call-iptables = 1 _forward = 1 -nf-call-ip6tables = 1 sysctl -system export OS=xUbuntu_20.04 export VER=1.22 export WEBSITE= echo "deb $WEBSITE/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VER/$OS/ /" | tee -a /etc/apt//cri-0.list curl -L $WEBSITE/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VER/$OS/Release.key | apt-key add - echo "deb $WEBSITE/repositories/devel:/kubic:/libcontainers:/stable/$OS/ /" | tee -a /etc/apt//libcontainers.list curl -L $WEBSITE/repositories/devel:/kubic:/libcontainers:/stable/$OS/Release.key | apt-key add - apt-get update apt-get install -y cri-o cri-o-runc systemctl daemon-reload systemctl enable crio systemctl start crio systemctl status crio This example uses CRI-O however we can also install other container runtimes such as Docker that uses containerd.

setup ubuntu virtualbox

So, we will need to install a container runtime before installing Kubernetes. Kubernetes is a platform for container orchestration and CRI is a Kubernetes API that interacts with different container runtimes. sudo -i apt-get update & apt-get upgrade -y apt-get install -y vimĢ.2) Container runtime interface installation We will install tools such as Vim, which we will use later when setting up the Kubernetes. Voila, the Ubuntu installation is complete.







Setup ubuntu virtualbox