Part 1: Set up
Installing kubectl
Next, we are going to install kubectl, the official Kubernetes CLI.
Despite the Educates CLI wrapping most of the needed functionality to interact with our
dedicated Educates cluster later-on, kubectl will come in handy whenever we want
to have a closer look at how things work within the platform.
kubectl is available from package managers for almost all common operating systems.
Installing kubectl on Linux
On the Debian, Red Hat, and SUSE families of operating systems, kubectl
can be installed via native package management. On other Linux flavors, the release
binaries can be downloaded instead. On Windows, follow these instructions inside WSL.
Installing kubectl with Native Package Managers
Debian
sudo apt-get updatesudo apt-get install -y apt-transport-https ca-certificates curl gnupgcurl -fsSL https://pkgs.k8s.io/core:/stable:/v1.36/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpgsudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpgecho 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.36/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.listsudo chmod 644 /etc/apt/sources.list.d/kubernetes.listsudo apt-get updatesudo apt-get install -y kubectlRed Hat
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo[kubernetes]name=Kubernetesbaseurl=https://pkgs.k8s.io/core:/stable:/v1.36/rpm/enabled=1gpgcheck=1gpgkey=https://pkgs.k8s.io/core:/stable:/v1.36/rpm/repodata/repomd.xml.keyEOFsudo yum install -y kubectlSUSE
cat <<EOF | sudo tee /etc/zypp/repos.d/kubernetes.repo[kubernetes]name=Kubernetesbaseurl=https://pkgs.k8s.io/core:/stable:/v1.36/rpm/enabled=1gpgcheck=1gpgkey=https://pkgs.k8s.io/core:/stable:/v1.36/rpm/repodata/repomd.xml.keyEOFsudo zypper updatesudo zypper install -y kubectlInstalling kubectl from GitHub
kubectl can be installed from release binaries:
# For AMD64 / x86_64[ $(uname -m) = x86_64 ] && curl -sSLO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"# For ARM64[ $(uname -m) = aarch64 ] && curl -sSLO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"chmod +x kubectlsudo mv kubectl /usr/local/bin/kubectlInstalling kubectl on macOS
On macOS, kubectl can be installed with either of the common package managers:
Homebrew
brew install kubectlMacPorts
sudo port selfupdatesudo port install kubectlTesting kubectl
To test if the installation kubectl has been successful, spin up a terminal and
run the following command:
kubectl version --clientThe output should look like this:
kubectl version --client
Client Version: v1.36.5Kustomize Version: v5.8.1