#1. Configure Multi-node Kubernetes Cluster on VirtualBox
HTML-код
- Опубликовано: 8 сен 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.
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 👌
Thanks a lot for this. Finally what I was trying to find.
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
loved this! thank you so much
That was an informative video 😊
Thanks for explaining each and every step clearly..
Waiting for your forthcoming video. 😍
I researched for a proper guide and you provided it
Very nice and helpful tutorial.. thanks for uploading.☺️
Thank you for making this ,finally I was able to create a cluster with your help : )
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!
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!
It's really helped me lot. Your instructions are very clear. Many thanks
Very Professional. Way to go
you did wonderful. great work and looking forward for more
Waiting for your next videos
This video helped me alot. Is simple but very precise and well explained: all very clear. Thanks.
Nice one and informative . Cheers !!!
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?
Nice explanation
I'm waiting for upcoming tutorial. Just Awesome.
Done. Please check the updated playlist
Awesome Video - Best presentation. you covered very clearly.
Glad you liked it!
perfect, helpful, thanks!
Thanks for the tuto, mate. Bless u
very good video & good knowledge, thank u.
Brilliant. Thank you
Awesome video bro. Keep up the good work.
Awesome Lab.
very helpful! i like 🍻
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.
Very well explained
Keep watching
It would have been best suit if could explore HDP 3 setup along with
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.
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
pls try to add create application eg: DB to access and roll out. what will happpen in realtime enviroment eg; DC cluster,
More videos please...
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?
gpg: no valid OpenPGP data found. this error is coming any suggestions in 4 th step
Thank you so much...
Welcome!
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.
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
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?
Thanks Bhai but I need to use containerd as run time
Please suggest me
How to Install Kubeadm cluster on a Laptop using VirtualBox 7 : ruclips.net/video/W3337KFn5I0/видео.html
Static IP set only for master? why not to worker-node-1? please clarify?
in my machine NAT interface is not picking IP itself how to fix it ?
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
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 -
would you share me NAT hortonworlks download link ?
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
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?
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/
Do I have to use 4 cpus? Can I just use 2
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
Command #4 is different from the video
bro can i get your doc i need the architecure of the cluster
sudo vim /etc/network/interfaces
Thank you Sir ,
Could you share your mail id .
Thanks
watch -n2 'kubectl get pods -A'
Waiting for your next video