#1. Configure Multi-node Kubernetes Cluster on VirtualBox
ฝัง
- เผยแพร่เมื่อ 25 ส.ค. 2024
- Chapters
0.00 Introduction
3:36 Use Case
6:48 VirtualBox Configuration
10:32 Install Ubuntu 20.04 VirtualBox
16:40 K8S Installation and Configuration
27:28 Joining Worker nodes
30:05 Testing the setup
Downloadables:
VirtualBox - www.virtualbox...
Ubuntu Server 20.04 LTS - ubuntu.com/dow... (Choose Option 3)
SSH Client - mobaxterm.moba...
=========================
Commands used in the Video:
=========================
1.Update the package repository (All hosts)
sudo apt-get update
2. Install Docker (All hosts)
sudo apt-get install docker.io -y
3. Access Repos via HTTPS (All hosts)
sudo apt-get install apt-transport-https curl -y
4. Add K8S key and Repo (All hosts)
curl -s packages.cloud... | sudo apt-key add -
cat (ADD 2 "LESS THAN" SIGNS HERE WITHOUT BRACKETS)EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb apt.kubernetes... kubernetes-xenial main
EOF
5. Update the package repository and Install K8S components (All hosts):
sudo apt-get update
sudo apt-get install -y kubelet=1.18.1-00
sudo apt-get install -y kubeadm=1.18.1-00
sudo apt-get install -y kubectl=1.18.1-00
sudo apt-mark hold kubelet kubeadm kubectl
6. Add the hosts entry (All hosts)
edit the file "/etc/hosts"
7. Disable SWAP (All hosts)
sudo swapoff -a
edit /etc/fstab to remove the swap entry
8. Initiate the Cluster(Only on Master node)
sudo kubeadm init --control-plane-endpoint kube-master:6443 --pod-network-cidr 10.10.0.0/16
9. Set the kubectl context auth to connect to the cluster(Only on Master node)
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
10. Pod Network Addon(Calico) (Only on Master node)
Ref: docs.projectca...
curl docs.projectca... -O
vi calico.yaml
11. Generate Token to add worker Node(Only on Master node)
#Create a new Token
sudo kubeadm token create
#List Tokens created
sudo kubeadm token list
#Find Certificate Hash on Master
openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt |
openssl rsa -pubin -outform der 2(GREATER THAN SYMBOL)/dev/null |
openssl dgst -sha256 -hex | sed 's/^.* //'
12. Join Nodes (Only on Worker nodes)
sudo kubeadm join --token TOKEN_ID CONTROL_PLANE_HOSTNAME:CONTROL_PLANE_PORT --discovery-token-ca-cert-hash sha256:HASH
(Formed using outputs from step 10, treat CAPS as variables to be replaced)
13. Want to run workloads on Master?(Only on Master Node)
kubectl taint nodes -all node-role.kubernetes.io/master
14. Sample Deployment file:
=========================
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
=========================
15. Apply the deployment:
kubectl apply -f FILE_NAME
this video is great! I cant wait for including external ip and loadbalancer and ingress controller.
Keep the great work.
Thanks.. This video is very help full for me. struggling lot while setting cluster.
Thanks a lot for this. Finally what I was trying to find.
This is a very detailed video. The theory would be a very good way to start before going to installations.
Thanks for the suggestion. Will try to maintain that in the next video
Very informative video to start with Kubernetes 👌
loved this! thank you so much
That was really dense, but right to the point. This is the real reliable hands on k8s video I was looking for. Thank you so much!
After a long term of search i could find best one. very informative
Thank you for making this ,finally I was able to create a cluster with your help : )
I researched for a proper guide and you provided it
I asbolutely aprreciate your video. Explained precisely step by step, it helps me a lot to set kubernetes cluster on my PC. You have a flair for teaching.
Glad it helped!
That was an informative video 😊
Thanks for explaining each and every step clearly..
Waiting for your forthcoming video. 😍
you did wonderful. great work and looking forward for more
Very Professional. Way to go
Thanks I have been able to get all of pieces working separately. This helps me tie it all together.... 👍 the notes are great!!!! pgp key is a hyperlink make sure you give it the full qualified name not what your notes have which is not the complete line. It turns it into a link in your notes
Glad it helped!
Nice explanation
It's really helped me lot. Your instructions are very clear. Many thanks
Very nice and helpful tutorial.. thanks for uploading.☺️
I have created cluster with kubeadm and calico as CNI plugin. Cluster works fine with two nodes(1 master and 1 child ). When i try to attach a new node with cluster it fails to run workload as pods can not communicate with pods running on other worker node.
This video helped me alot. Is simple but very precise and well explained: all very clear. Thanks.
Nice one and informative . Cheers !!!
Waiting for your next videos
Awesome video bro. Keep up the good work.
Awesome Video - Best presentation. you covered very clearly.
Glad you liked it!
Thanks for the tuto, mate. Bless u
Awesome Lab.
The video is too good. It is very informative. Please make more videos of this kind...I am eager to watch them. Waiting for you upcoming videos..
Thank you, I have plans to post more!!
@@2dpointtechie411 All the best. Can you create video on multi service hosting in AKS using app gateway?
I'm waiting for upcoming tutorial. Just Awesome.
Done. Please check the updated playlist
perfect, helpful, thanks!
hello i am triyng to do the same here but i an on mac silicon so i can't use virtual box and i have to use UTM instead.. can u make a similar video or give me suggestion on how to it with this software?
Hi Sir,
Im getting error while applying calico.yaml file
error: resource mapping not found for name: "calico-kube-controllers" namespace: "kube-system" from "calico.yaml": no matches for kind "PodDisruptionBudget" in version "policy/v1"
ensure CRDs are installed first
Please help me on this error.
very helpful! i like 🍻
gpg: no valid OpenPGP data found. this error is coming any suggestions in 4 th step
Brilliant. Thank you
pls try to add create application eg: DB to access and roll out. what will happpen in realtime enviroment eg; DC cluster,
It would have been best suit if could explore HDP 3 setup along with
very good video & good knowledge, thank u.
thanks for your nice video ...I tried the same way to create a multi-node in Oracle VB.. but I am unable to see NAT ip in the node I used Centos 8.5...I can see only one IP ..Oracle VB version: 7
Good Article, But as of now every thing is changed if you can share the calico.yaml file will be better for us to check if every this works as in this video.
in my machine NAT interface is not picking IP itself how to fix it ?
Waiting for your next video
Good tutorial! when the router got rebooted I was not able to putty the static IP defined in /etc/network/interface, and ifconfig did not show ip address but the link was up
The NAT IP works fine and install packages on Ubuntu 20.
any advice?
you can login to the VM console to see what's wrong or assign a new IP if it's conflicting
Very well explained
Keep watching
thanks for the material , really helpful. i got this error though , any workaround ? ------ The connection to the server master:6443 was refused - did you specify the right host or port?
Static IP set only for master? why not to worker-node-1? please clarify?
2DPointTechie
while running kubectl get nodes facing this below issue, some time it runs fine
The connection to the server master:6443 was refused - did you specify the right host or port?
Hi, It is very helpful to configure our own cluster setup. While I configure, I have got below error. will you check and reply?
The connection to the server localhost:8080 was refused -
Do I have to use 4 cpus? Can I just use 2
would you share me NAT hortonworlks download link ?
Thanks Bhai but I need to use containerd as run time
Please suggest me
More videos please...
I started all 3 (1 master and 2 workers) VM, but don't know why all of them got same IP address.
Is ther any way to change it?
Thank you so much...
Welcome!
unable to install kubelet:
sudo apt-get install -y kubelet=1.18.1-00
Reading package lists... Done
Building dependency tree
Reading state information... Done
No apt package "kubelet", but there is a snap with that name.
Try "snap install kubelet"
E: Unable to locate package kubelet
Did you try this before installation? Also try apt-get update after that and then try installing
curl -s packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
cat
bro can i get your doc i need the architecure of the cluster
Command #4 is different from the video
Is there any way we can get an public IP of the master node?
Actually, when we talk about public IP, we depend on any cloud platform. Once you expose the service, it's exported as load balancer having public ip
@@2dpointtechie411 yes that we can do. We can Create a LB service and expose its external IP. But I need it because I have installed Harbor using helm on aks cluster. But not able find the public IP.
How about this
docs.microsoft.com/en-us/azure/aks/load-balancer-standard
Hi, Very interesting tutorial. I setup my cluster using this video. Now how to integrate load testing tool, locust with this Kubernetes cluster?
May be this might help:
medium.com/locust-io-experiments/locust-io-experiments-running-in-kubernetes-95447571a550
@@2dpointtechie411 how we can change locust master& slave deployment to our pervious multinode kubernetes cluster? Can you please guide. Thnaks in advance
awesome. Does anyone know any detailed guide to create locally a cluster in kubernetes with microservices?
For example, a cluster oriented to e-commerce. I would pay for such a guide.
There's no specific guide because it depends on the use case of the e-commerce application. What's your use case?
@@2dpointtechie411 thanks for answering!
it's actually a free project that I have to do. my idea was to install a LAMP with wordpress in kubernetes, and then have a copy control, monitoring, high availability, scaling. I am not very clear about it, but I do not care much about the services, it is rather to learn from scratch to the end, in an orderly way, to see the whole process. What services or applications is the least of it.
I think this is your first agenda:
kubernetes.io/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/
sudo vim /etc/network/interfaces
How to Install Kubeadm cluster on a Laptop using VirtualBox 7 : th-cam.com/video/W3337KFn5I0/w-d-xo.html
Thank you Sir ,
Could you share your mail id .
Thanks
watch -n2 'kubectl get pods -A'