Welcome to the Linux Foundation Forum!

How Did You Practice the Chapter 2 Labs in LFX259?

ijcent
ijcent Posts: 7

Hi everyone,

I need some assistance, please. Is there a faster way to complete the lab exercises in Chapter 2 of LFX259 without setting up a cloud environment?

I'd appreciate any advice from anyone who has tried this. Thank you!

Comments

  • chrispokorni
    chrispokorni Posts: 2,624

    Hi @ijcent,

    For the LFD259 - Kubernetes for Developers e-Learning course you can also stand up a local lab environment, instead of using a cloud services provider.

    Based on the cloud VM details supplied in the demo videos from the introductory chapter of the course, you can provision two local Virtual Machines with the hypervisor of choice (that is supported by the OS of your host computer). Peer learners have successfully completed the lab exercises on popular local hypervisors such as VirtualBox/Vagrant, QEMU/KVM/KVM2, VirtManager, Hyper-V, Parallels, VMware Fusion, VMware Workstation.

    On the hypervisor ensure the bridge network firewall is open to allow all inbound traffic from all sources, all protocols, to all port destinations.
    With the hypervisor you need to provision two VMs, each of the following specs:
    - 2 CPU
    - 8 GB Memory
    - 20+ GB disk
    - 1 bridged network interface
    - OS - Ubuntu 24.04 LTS (server recommended)

    Once your VMs are provisioned, you can then log into each VM and proceed with the lab exercise 2.1 and download the necessary shell scripts and YAML manifests in the tarball (the .tar.xz file) onto each VM, and complete the steps of lab exercise 2.2 to install and bootstrap the two node Kubernetes cluster on the two VMs.

    Regards,
    -Chris

  • ijcent
    ijcent Posts: 7

    Thank you for the detailed explanation. This is very helpful guidance. 🤔

  • jlouceiro
    jlouceiro Posts: 5

    Hey, all

    I need some help regarding this.
    I was previously able to setup a decent enough cluster using something similar to the above config.

    I eventually ran into an issue, though: the IP of the control plane eventually changed when I moved to a different router, and the whole cluster came falling down.

    Now, the general consensus out there for setting up a VM based cluster is that we should have a NAT adapter to access the internet, and a Host-Only for connecting VM's with one another, but the provided script does not seem to work with said configuration.

    I did manage to hack away some solution to it, but every time I restart, something breaks.

    Can someone please help me configure this? I have been loosing about 2h of studying each time I try to get back at the course, because I simply cannot get the homelab to behave predictably. This setup should be common enough for it to have details on how to setup somewhere in the course resources, instead of pushing the student to a vendor lock with AWS or GCP.

  • chrispokorni
    chrispokorni Posts: 2,624

    Hi @jlouceiro,

    For a local disposable lab environment setup, I recommend one single bridged network interface per VM (instead of the two interfaces - NAT and host-only), that way the hypervisor managed bridge preserves the private VM IPs for the life of the VMs. I am aware of the "general consensus" but that introduces additional configuration options for the cluster which are not in scope for the LFD259 training course.

    Regards,
    -Chris

  • jlouceiro
    jlouceiro Posts: 5

    Hi, @chrispokorni

    I really appreciate the time for getting back at me.

    I agree, that is the simplest solution, and I had that working for quite some time.

    But because the Bridged adapter simulates a physical connection to the local router and the IP of the VM's is dependent on what device you are connected to, if you connect elsewhere the whole lab comes falling down:

    1) You can no longer connect to the cluster, because the cluster is dependent on the IP (kubeadm init uses the de default device IP unless told otherwise). The cluster, effectively, disappears
    2) The CNI plugin has no idea what to do.
    3) Running the k8scp.sh or the k8sWorker.sh a second time is not possible, unless we manually remove the file that has been created by said scripts, which tells us that they are not to be ran again.
    4) We end up having to run kubeadm reset, but because we created the cluster via a script, we end up trying to shoehorn it somehow.
    5) By the end, the solution ends up being deleting the VM and recreating the whole thing from the begging, which is quite frustrating.

    I will give this a better look. I think I am able to write whatever extra steps are needed in a VBox setting, and leave them here for future eyes to gaze upon.

    Best regards

  • chrispokorni
    chrispokorni Posts: 2,624

    Hi @jlouceiro,

    Running the shell scripts several times is an overkill. The reset method is cleaner and efficien to reinitialize the cluster.

    The vbox hypervisor builds a virtual bridge that is independent of the host network, but it only supports a limted IP range.

    I remember vbox working smoothly on Windows and on a native Linux desktop, preserving all cluster setting between VM restarts and host reboots.

    Regards,
    -Chris

Categories

Upcoming Training