Welcome to the Linux Foundation Forum!

3.1 Install Kubernetes

Posts: 2
edited January 2024 in LFS258 Class Forum

Good afternoon.

I have a quick question regarding the instructions for installing Kubernetes.

I downloaded and unzipped the course tarball and I think I confused myself when looking at some of the files.

For example, the file ../SOLUTIONS/s_03/containerd-setup.txt

It has similar, yet differing commands to be run to install containerd.
Such as downloading the Keys and installing containerd, but using different filenames.
( /etc/sysctl.d/kubernetes.conf vs. /etc/sysctl.d/99-kubernetes-cri.conf)

Should I just ignore this, and follow the instructions from the 3.1 Lab?
I'm pretty sure they're doing the same thing but I don't want to assume that out of ignorance.

  • NOTE: I'm just using minikube but I was going to install on an AWS EC2 for practice

Section from ../SOLUTIONS/s_03/containerd-setup.txt:

  1. cat <<EOF | sudo tee /etc/modules-load.d/containerd.conf
  2. overlay
  3. br_netfilter
  4. EOF
  5.  
  6.  
  7. # Disable swap if not on a cloud instance - done anyway
  8.  
  9. sudo swapoff -a
  10.  
  11.  
  12. # Load the modules now
  13.  
  14. sudo modprobe overlay
  15.  
  16. sudo modprobe br_netfilter
  17.  
  18.  
  19. # Update sysctl to load iptables and ipforwarding
  20.  
  21. cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
  22. net.bridge.bridge-nf-call-iptables = 1
  23. net.ipv4.ip_forward = 1
  24. net.bridge.bridge-nf-call-ip6tables = 1
  25. EOF
  26.  
  27. sudo sysctl --system
  28.  
  29.  
  30. # Install some necessary software
  31.  
  32. sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
  33.  
  34. # Install the Docker keyring
  35. # In Ubuntu 20.04, containerd part of local repos.
  36.  
  37. sudo apt install containerd -y
  38.  
  39. #Older OS steps
  40. #curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key --keyring /etc/apt/trusted.gpg.d/docker.gpg add -
  41.  
  42. # Create a Docker repository
  43. #sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  44.  
  45. # Install and configure the containerd package
  46. #sudo apt-get update && sudo apt-get install -y containerd.io
  47. #sudo mkdir -p /etc/containerd
  48. #sudo containerd config default | sudo tee /etc/containerd/config.toml
  49.  
  50. # Verify the file has the appropriate contents
  51. #cat /etc/containerd/config.toml

Section from 3.1 Lab:

  1. # 10. Update kernel networking
  2. cat << EOF | tee /etc/sysctl.d/kubernetes.conf
  3. net.bridge.bridge-nf-call-ip6tables = 1
  4. net.bridge.bridge-nf-call-iptables = 1
  5. net.ipv4.ip_forward = 1
  6. EOF
  7.  
  8. # 11. Changes to be used by current kernel
  9. sysctl --system
  10.  
  11. # 12. Install the necessary key for the software to install
  12. sudo mkdir -p /etc/apt/keyrings
  13. curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
  14. | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
  15.  
  16. echo \
  17. "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
  18. https://download.docker.com/linux/ubuntu \
  19. $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  20.  
  21. # 13. Install the containerd software
  22. apt-get update && apt-get install containerd.io -y
  23. containerd config default | tee /etc/containerd/config.toml
  24. sed -e's/SystemdCgroup = false/SystemdCgroup = true/g'-i /etc/containerd/config.toml
  25. systemctl restart containerd

Answers

  • Posts: 2,434
    edited January 2024

    Hi @mleager,

    My recommendation is to follow the video demos from the introductory chapter to provision your lab environment and then follow the instructions provided in the pdf lab guide to complete the hands-on exercises.

    Familiarize yourself with the scripts, definition and configuration files from the SOLUTIONS tarball, however, they will be invoked at various stages as you progress through the lab exercises. Some files will be used by the provided hands-on exercises, while others are made available for your review as additional learning material.

    EDIT: Minikube is not a recommended lab environment for this class.

    Regards,
    -Chris

  • Thank you @chrispokorni.
    I'll move over to AWS then and just focus on that.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training