Deploy Kubernetes in your Homelab: How to use Kubespray

Ғылым және технология

#devops #Kubernetes #Kubespray #Ansible #homelab
Facts:
✔️78% of small and medium-sized organizations have adopted Kubernetes for managing their containerized applications.
✔️Over 100,000 stars on github github.com/kubernetes/kubernetes
✔️Kubernetes has a commanding 92% market share among container orchestration tools used by businesses throughout the world.
👀 What You'll Learn
✅Why learn kubernetes and what is it
✅How to deploy bare metal kubernetes
✅Configuring ansible inventory for kubespray
✅Reviewing and installing MetalLB
🎬 Timestamps
00:00 Intro
01:17 How Kubernetes Helps
02:01 K8s VS k3s
03:20 Why Kubespray
04:31 Requirements
05:24 Cluster Layout and Diagram
06:09 Exploring Github and Releases
06:57 Virtual Environment Configuration
08:04 Inventory Creation
08:58 Deployment Variables
11:08 Running Playbook
11:57 Validation
13:13 Helm Deployment and Testing
14:50 MetalLB Explained
18:04 Metallb Install
20:00 Bonus Docker Configuration
23:11 Outro and thanks!
👇 Resources & Links
github.com/kubernetes/kubernetes
humalect.com/blog/kubernetes-...
kubernetes.io/docs/setup/prod...
github.com/kubernetes-sigs/ku...
kubespray.io/#/docs/vars
github.com/kubernetes-sigs/ku...
www.tigera.io/blog/comparing-...
stackoverflow.com/questions/7...
www.tkng.io/services/clusteri...
metallb.universe.tf/installat...
github.com/Rhoat/kubespray-do...

Пікірлер: 39

  • @RajaseelanGaneswaran
    @RajaseelanGaneswaran7 ай бұрын

    Thanks! Managed to get 2 kvm machines into a mini cluster. Now I can create disposable "real clusters" for somewhere testing I'm doing ❤

  • @JamesRhoat

    @JamesRhoat

    7 ай бұрын

    Glad it helped :)

  • @liyangau
    @liyangau8 ай бұрын

    This is so helpful and it makes deploying a 6 node cluster like a breeze. Thank you so much for the great work!

  • @JamesRhoat

    @JamesRhoat

    7 ай бұрын

    Great to hear! I used this for 3 years and had very few issues.

  • @amac1211
    @amac12118 ай бұрын

    Man the content just keeps getting better and better. No joke the amount of outdated videos out there is insane and its great getting updated information and a fresh perspective. Thank you again and keep up the good work.

  • @JamesRhoat

    @JamesRhoat

    8 ай бұрын

    Appreciate it, hope you got your kubernetes cluster up and running!

  • @aproperhooligan5950
    @aproperhooligan59508 ай бұрын

    Excellent. Thank you!

  • @JamesRhoat

    @JamesRhoat

    8 ай бұрын

    Glad you enjoyed, appreciate you watching.

  • @cjchico
    @cjchico8 ай бұрын

    Fantastic video!

  • @JamesRhoat

    @JamesRhoat

    7 ай бұрын

    Thank you very much!

  • @changxiangsi4947
    @changxiangsi49478 ай бұрын

    This is very helpful and informative, thank you for sharing it

  • @JamesRhoat

    @JamesRhoat

    8 ай бұрын

    You are so welcome!

  • @lukasdado5766
    @lukasdado57668 ай бұрын

    Really helpfull, thanks mate

  • @JamesRhoat

    @JamesRhoat

    8 ай бұрын

    No problem, I am glad to see you enjoyed it :)

  • @cleitonpena4578
    @cleitonpena45782 ай бұрын

    Your video is very good, James. Congratulations.

  • @JamesRhoat

    @JamesRhoat

    2 ай бұрын

    Thank you very much!

  • @fabianoslack4269
    @fabianoslack42698 ай бұрын

    This is a great step by step for those who already have some experience. I'm one of these guys who can benefit from this. Thank you so much for sharing!

  • @JamesRhoat

    @JamesRhoat

    7 ай бұрын

    Glad it was helpful!

  • @fernandomendieta5463
    @fernandomendieta54637 ай бұрын

    soooo goooooood soooo good work!!! thanks a lot!! Keep trying this interesting thing to do with Ansible!

  • @JamesRhoat

    @JamesRhoat

    7 ай бұрын

    Appreciate the support! Is there anything specifically you’d like to see with ansible? I was planning on doing istio for the kubernetes cluster after my reverse proxy video but I’d love to get your feedback

  • @fernandomendieta5463

    @fernandomendieta5463

    4 ай бұрын

    Heey thanks for the answer! In Ansible I really enjoy and i thnks there are quite few goood videos of deploying a AWX in an alredy cluster using helm. You can make like a second part with this one about deploying AWX in kubernetes clluster deployed with kubespray@@JamesRhoat

  • @pm_2go464
    @pm_2go4645 ай бұрын

    awesome content, would be great if you make a video of how to setup from 0 a proxmox cluster on remote bare metal server

  • @menruletheworld
    @menruletheworld3 ай бұрын

    Very good and clear outline of the steps required to get a kubernetes cluster up and running on bare metal. But….. And here comes the critique: you did not make your backplane HA, yes you have multiple control-plane nodes but no way to control your cluster when the server where you point to in your .kube/config file goes offline. To achieve true HA, you need to install a loadbalancer and a failover mechanism like VRRP in the form of keepalived on your control-plane nodes to be able to access your kube-api. I always like to use HAProxy and keepaliveD for that. Don’t forget to configure a different name for the kube-api in your kubespray configuration

  • @JamesRhoat

    @JamesRhoat

    3 ай бұрын

    This is true, I didn’t opt to cover an external load balancer as it is just the configuration file would just need to be updated to point to a node that is still online. But the cluster is still deployed in a stacked ha configuration. When you talk about using HAproxy to load balancing the api server configuration are you hosting that inside the cluster?

  • @menruletheworld

    @menruletheworld

    3 ай бұрын

    @@JamesRhoat fair enough, there's only so much you can cover in a single video. I always like to install HAProxy and keepaliveD directly on the OS, if you deploy it like a regular cluster application you could run into a chicken egg problem, in which you can't access your cluster because there's a problem with the container runtime or in cluster dns, you then would have no way to fixit remotely. Or you can deploy HAProxy and keepaliveD on a separate pair of servers so you can utilize it for other clusters and applications as well.

  • @bobjapan7690
    @bobjapan76908 ай бұрын

    Wow not just a great tutorial A real world up to date reference. I will be coming back to this many times I think

  • @truehybridx1
    @truehybridx15 ай бұрын

    Maybe it was a Docker in Windows thing, but using their kubespray image had its problem with timeouts with the SSH key until i remove my passphrase from it. Another nuance was hostnames needed to be all lowercase and not camel case. Im assuming the goal is to just spin up an instance and get kube running on it with everything on the OS drive, so other cases of using a second bigger drive will need some adapting

  • @alex.nolasco
    @alex.nolasco8 ай бұрын

    k8s! 🏓

  • @HunteronX
    @HunteronX8 ай бұрын

    Thank you. Using these instructions the latest kubernetes version I could install is: v1.27.7 v1.28.x seems to have a missing download somewhere.

  • @JamesRhoat

    @JamesRhoat

    7 ай бұрын

    Hey sorry for the delay I had Covid the last few weeks! They seemed to have finished working on a PR to support this 1.28 release a few months back though the default is still 1.27.7 I haven’t tested this but based on the PR you might just be able to bump the version and attempt to deploy 1.28.3 per the testing here github.com/kubernetes-sigs/kubespray/pull/10390

  • @hamedsoleimani81
    @hamedsoleimani815 ай бұрын

    Thanks what if I need to setup proxy to access internet on all nodes ?

  • @jaffo73
    @jaffo735 ай бұрын

    I followed this proceedure to deploy a 6 node cluster. want to add a 4th worker node. what is the correct way to do this ?

  • @JamesRhoat

    @JamesRhoat

    5 ай бұрын

    Hey I’m glad the video helped there is another playbook in their repo called scale, it allows you to add or remove a node from your cluster. I plan on making a video soon to discuss this.

  • @cleitonpena4578
    @cleitonpena45782 ай бұрын

    My cluster is just like your video, Jamas. However, I'm trying a problem with ingress-nginx. It is returning error 404. Could you please clarify why this 404 error occurs, and how to solve it? Thank you.

  • @JamesRhoat

    @JamesRhoat

    2 ай бұрын

    When you look at your ingress, are you pointing to the appropriate service name? also does your service have endpoints? Also, are you able to get to the default service with an external ip or if you run a kubectl port-forward command?

  • @FrancescoPrisco-ld5lx
    @FrancescoPrisco-ld5lx2 ай бұрын

    thx for all! i've a problem. my virtual machine have ip in this subnet 192.168.6.0/24. i can't reach 172.16.43.1 ip. i follow you in each steps. please help me

  • @JamesRhoat

    @JamesRhoat

    2 ай бұрын

    If i understand correctly your home network is 192.168.6.0/24, unless you have a route configured in your network to route to 172.16.43.0/24 you will likely not be able to reach it. Your DHCP server which configures your home network usually only has a range of 192.168.6.1-192.168.6.200 try setting your metallb range to give you a 192.168.6.201-192.168.6.210 range. This will allow you to advertise on the same subnet as your home network and you should be able to access it. However, you should confirm in your router that the dhcp ip range is restricted to a subset of ips, I assume you wouldn't be able to ping something at 192.168.6.201 prior to making this change. The reason this setup works in my homelab is due to me using the 172.16.0.0/12 IP address space: 172.16.0.0 - 172.31.255.255

Келесі