Deploy Kubernetes in your Homelab: How to use Kubespray

Поділитися
Вставка
  • Опубліковано 25 чер 2024
  • #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

  • @liyangau
    @liyangau 7 місяців тому +3

    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  6 місяців тому +1

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

  • @RajaseelanGaneswaran
    @RajaseelanGaneswaran 6 місяців тому +2

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

  • @amac1211
    @amac1211 8 місяців тому +1

    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
    @aproperhooligan5950 7 місяців тому

    Excellent. Thank you!

    • @JamesRhoat
      @JamesRhoat  7 місяців тому

      Glad you enjoyed, appreciate you watching.

  • @fabianoslack4269
    @fabianoslack4269 7 місяців тому

    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  6 місяців тому

      Glad it was helpful!

  • @lukasdado5766
    @lukasdado5766 8 місяців тому

    Really helpfull, thanks mate

    • @JamesRhoat
      @JamesRhoat  8 місяців тому

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

  • @cjchico
    @cjchico 7 місяців тому

    Fantastic video!

    • @JamesRhoat
      @JamesRhoat  6 місяців тому

      Thank you very much!

  • @changxiangsi4947
    @changxiangsi4947 7 місяців тому

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

  • @cleitonpena4578
    @cleitonpena4578 Місяць тому

    Your video is very good, James. Congratulations.

  • @fernandomendieta5463
    @fernandomendieta5463 7 місяців тому

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

    • @JamesRhoat
      @JamesRhoat  6 місяців тому +1

      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 3 місяці тому

      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

  • @bobjapan7690
    @bobjapan7690 8 місяців тому

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

  • @pm_2go464
    @pm_2go464 5 місяців тому

    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
    @menruletheworld 2 місяці тому

    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  2 місяці тому +1

      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 2 місяці тому

      @@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.

  • @truehybridx1
    @truehybridx1 4 місяці тому

    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.nolasco 7 місяців тому

    k8s! 🏓

  • @HunteronX
    @HunteronX 7 місяців тому

    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  6 місяців тому +1

      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
    @hamedsoleimani81 5 місяців тому

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

  • @jaffo73
    @jaffo73 5 місяців тому

    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
    @cleitonpena4578 Місяць тому

    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  Місяць тому +1

      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-ld5lx Місяць тому

    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  Місяць тому

      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