K3S (by Rancher) | Setup a lightweight Kubernetes Cluster in Minutes | Hands-on Tutorial
Ғылым және технология
K3S (by Rancher) Setup a lightweight Kubernetes Cluster in Minutes | Hands-on Tutorial
🔥 Today’s topic: A hands-on session off a great Kubernetes distribution K3S 🔥
I’d like to give you a first basic hands-on guide on K3S. A lightweight Kubernetes distribution which you can install on any Linux host in minutes or even in around 30 seconds. We’ll also have a look at how we can extend our Cluster with worker nodes followed by the installation of a Nginx ingress controller.
Finally we’ll deploy a demo application.
#k3s #rancher #containerd #docker #kuberntes #k8s #cloudversity #cloud_versity #linode
Feel free to ask any questions in the comments down below and give me your honest feedback.
🔗 k3s.io/
🔗 k3d.io/
Timestamps ⏰
0:00 Intro
1:14 Some theory
4:50 Preparation in advance
6:15 Install K3S Master node
8:35 Install K3S Worker node
11:34 Install Nginx ingress controller
16:00 Install a demo application
20:30 Summary and outro
🔥 GitLab Repo 🔥
► bit.ly/3xFf9v1
🔥 Social Media 🔥
Twitter ► / cloud_versity
Instagram ► / cloudversity
🔥 Support 🔥
👉🏼 Buy me a coffee: bit.ly/36vJhh4
👉🏼 Become a patreon: bit.ly/36wXquA
🔗 cloud-versity.com
Пікірлер: 58
Awesome video! You explained everything really well thank you! I’m looking forward to checking out more of your content
if you get issues installing try to replace "--no-deploy traefik" with "--disable traefik" it may be the fix for you it did work for me
thanks for the demo and info, have a great day
Great video, thanks. It helped me in my project. i have already installed k3s on my two servers and up and running in less than the time I used to use installing k8s with kubeadm
Thank you! Very useful video!
2/4/2023 it still works! Amazing! Thank you man you saved my life
@jananathbanuka4994
Жыл бұрын
Hi, how do you have the public IP's for EXTERNAL-IP?
Could you make more Rancher videos? it's a popular topic and there isn't much tutorials about making a self hosted Rancher setup with low end hardware specs ( load balancing )
Thank you. This helped me setup the cluster on gcp gce vm. Cheers.
@CloudVersityOfficial
2 жыл бұрын
Great to hear that.
I 'm in the middle of moving to another company where they use Rancher, so this video was really helpful
@FirmanRosdiansyah
2 жыл бұрын
If only Rancher is mentioned I think it is `rke`, not k3s
Good job!
@CloudVersityOfficial
2 жыл бұрын
Thank you =)
Surprisingly, the video was super helpful, despite the views count!
@CloudVersityOfficial
3 жыл бұрын
This is some great feedback! Feel free to subscribe if you interested in topic like this. Growing a new channel isn't that easy. ;)
@redmictian
3 жыл бұрын
@@CloudVersityOfficial Not harder than setting up a cluster for the first time, while learning how to do it, and all this for production environment:)) One of the super useful things you showed was the nip.io service - I didn't know about it. However, it doesn't seem to fit a production environment approach, so it would be awesome if you could explain like what are the most basic ways to expose services like a database to a local network in which the k3s cluster is located, and a service to the internet. In my case, I already exposed those using simple nodeport, but I know it's not ideal.
@CloudVersityOfficial
3 жыл бұрын
@@redmictian Thanks for the input. I'll put that on my todo list. :) Routing and securely exposing stuff always causes headaches and gets complicated pretty fast but I'll see what I can do. nip.io is for playground environments, as soon as you go in the direction of production environments your goal should be to have a valid DNS.
Plz make more video for k3s. Thanks bro
Do you maybe know how do you use external IP on gcp with k3s? I tried this example on GCP and it does not work.
i'm trying to install k3s on a Raspberry Pi 4 Model B 4Gb, but i have some problem. First problem, when i install the master node, the installation give me a this error "Job for k3s.service failed because the control process exited with error code. See "systemctl status k3s.service" and "journalctl -xeu k3s.service" for details." Second problem, when i use " cat /var/lib/rancher/k3s/server/node-token" the console give me the error "permission denied". I don't know where is the problem :(
how to add more masters to the cluster?
Good video. Is there a reason why not keep the default ingress controller (Treafik)? Also, would you give thoughts on how to approach a two-node cluster (e.g. like to Pis) where one is a redundant of the other in case the first fails. No chance to have 3rd or more.
@CloudVersityOfficial
Жыл бұрын
Hej dude, I'm just more familiar with Nginx. If you like Treafik go with it ;) K8s/K3s stands for high availability, so if one node fails it'll always try its best to keep all pods running on another node. Of course you need to make sure, that your "brain" the master node is deployed in a HA setup as well, otherwise your worker nodes would be kind of "brainless". There shouldn't be a redundant server, all of them can work and balance their load in terms of deployed pods and resource management.
Can k3s use for production environment? What will be the reasons if it's not recommended to use on production?
@farhanyousaf5616
2 жыл бұрын
No reason not to use it in prod. It is meant for that. Just has a lighter foot print.
I just recognized, that I linked to the wrong Twitter profile in this video :D 🔥 Social Media 🔥 Twitter ► twitter.com/cloud_versity Instagram ► instagram.com/cloudversity
@enescetinkaya2396
2 жыл бұрын
hi, please make a how to create high availability kubernetes cluster video. for example 2 master 3 worker.
In the manifest.yaml, what IP is set for in the Host Ingress rules? Should this me my public IP , one of the the k3s public or private IP's?
@CloudVersityOfficial
Жыл бұрын
The public IP from your ingress-nginx load balancer. Time stamp around 15:15
Thank you very much for your video. I'm doing a k3s cluster across 3 vm with tailscale and thanks to your tutorial I was able to create the server & node easly. I just got an error deploying the manifest ..... dial tcp cluster-ip:443 io/timeout ..... and if I find the solution I'll reply here.
@ganon4
2 жыл бұрын
Well I couldn't find a solution, I tried again reinstalling my vps and using your cmd but I end up always with the same error msg: Error from server (InternalError): error when creating "manifest.yaml": Internal error occurred: failed calling webhook "validate.nginx.ingress.kubernetes.io": Post "ingress-nginx-controller-admission.ingress-nginx.svc:443/networking/v1beta1/ingresses?timeout=10s": dial tcp 10.43.35.60:443: connect: connection refused
@janrenz7690
2 жыл бұрын
I am facing the same issue. Does anybody have an idea?
@ugurserhattoy
2 жыл бұрын
@@janrenz7690 @ganon4u do you guys got a solution for that? I am facing it too.
@nguyensang8234
Жыл бұрын
@@ugurserhattoy same issue: just delete the ingress-nginx-controller-admission in ingress-nginx namespace or just reinstall ingress-nginx by helm method. That's it.
so this mean that master node also function a load balancer using nginx? correct me if im wrong. im still new to this. :)
@CloudVersityOfficial
2 жыл бұрын
As I set it up in this video, yes. But you can of course change this to your liking ;)
Might be good to update repo README with correct install option to "--disable" traefik". Seems the "no-deploy" flag is now deprated.
@CloudVersityOfficial
Жыл бұрын
Thank you for the heads-up :) Updated the README immediately.
very helpful video, thank you. i have a question please, can we deploy the demo application in the agent node or only in the server node?
@CloudVersityOfficial
3 жыл бұрын
I'm glad that it was helpful to you ;) Actually k3s will deploy workloads per default also on the server nodes. If you want to have you control plane separated from your workloads you can leverage from "taints". Here is a link to the k3s documentation which covers that point: rancher.com/docs/k3s/latest/en/installation/ha/#2-launch-server-nodes You can just add the option to the install command like: curl -sfL get.k3s.io | sh -s - server --node-taint CriticalAddonsOnly=true:NoExecute This should do the trick :)
@soubaneimane1814
3 жыл бұрын
@@CloudVersityOfficial Thank you for the answer, i get it know.
Is the process in the video only meant to work with linode VPS's, or should it work with google cloud VPS's as well? I I'm not sure why, but the process is not working for me with VPS's on google cloud. After installing ingress-nginx, "kubectl -n ingress-nginx get svc" is showing internal IP-addresses on the column "External IP" instead of the external ones. The VPS's have the port 80, 443, 6443 already open though. Did anybody have a similar problem? I checked the yaml file for installing ingress-nginx, and I couldn't find anything obvious.
@CloudVersityOfficial
2 жыл бұрын
Good question :) I ran into similar problems with AWS, Azure and GCP, that's why I like to use simple cloud providers like Linode for these kind of demos because they are easier to handle. The big cloud providers will give you a fake public ip address which seems to not be know by your actual VM. Just check it with "netstat -i" or similar. They just get NATed down the road until it hits your VM in their "private" network. This is just an assumption, I'm not 100% sure if this is a correct explanation so take it with caution. However there is a fix. You need to manually edit the ingress nginx svc "ingress-nginx-controller" and manually add spec.externalIPs: [] your public IP. A "kubectl -n ingress-nginx get svc" should now update and also list your public IP besides the private one. You can now proceed with the demo. I also updated the the ingress by adding the "spec.ingressClassName" which is necessary since v1.22. Cheerio.
@3rdman99
2 жыл бұрын
@@CloudVersityOfficial Thanks. I'll give it try later.
@3rdman99
2 жыл бұрын
@@CloudVersityOfficial Sorry a bit late, but.. I just tried what you suggested, and worked great! Thanks. This "problem" made me learn even more about kubernetes :) FYI, it looks like I needed to edit the services on both "ingress-nginx-controller" and "ingress-nginx-controller-admission", and add the external IPs on both. Cheers.
@CloudVersityOfficial
2 жыл бұрын
@@3rdman99 Awesome!
@jananathbanuka4994
Жыл бұрын
Anyone found a better way of doing this without deleting any admission web hooks and editing service objects?
Does it automatically generate tls for a k3s server?
@CloudVersityOfficial
2 жыл бұрын
Nope, just installing k3s and any sort of ingress controller won't give you ssl certificates out of the box. Feel free to check out a video I made exactly about this topic :) kzread.info/dash/bejne/lpmAuZShYbWtqpM.html
7:19 dockershim will be removed from kubernetes version 1.23 and as a result, docker will not work as a container runtime from then.
@stephandannewitz7747
2 жыл бұрын
K3s is using containerd as a container runtime since a while. So no worries, everything in this video will still work :)
@justinkim7202
2 жыл бұрын
@@stephandannewitz7747 Yes I'm aware. I was just making a comment at 7:19 because he said version 1.20.
@stephandannewitz7747
2 жыл бұрын
@@justinkim7202 Ahh - gotcha!
Where to run these commands can be very confusing
15:37 - Hi, how do you have the public IP's for EXTERNAL-IP? I get the private IPs instead. And also can you update this video with the newest versions? Thank you for your efforts and time
@CloudVersityOfficial
Жыл бұрын
Hi there, I added a note a while back in the README.md Cheers :) gitlab.com/cloud-versity/rancher-k3s-first-steps#important-note-for-aws-azure-gcp