Install and Configure kubectl or Helm

Kubectl and Helm are two tools (among others) that can be used with the Kube configuration file to manage and/or deploy your applications. The Kubernetes command-line tool, kubectl, allows you to run commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs. Helm is a package manager for Kubernetes, meaning that its main purpose is to simplify the deployment of applications in your cluster, but not to manage the cluster itself.

The two tools can be installed and used in the same machine, they co-exist and do not interfere with each other.

Install Kubectl

Follow the official installation page at https://kubernetes.io/docs/tasks/tools/#kubectl

Note that, as stated on the kubectl website: “You must use a kubectl version that is within one minor version difference of your cluster. For example, a v1.26 client can communicate with v1.25, v1.26, and v1.27 control planes.”

Before installing kubectl check the version of your cluster in CloudNativeLab. It is shown during the deployment phase and always available in Details in the Manage existing clusters tile.

  • Install kubectl on Linux
  • Install kubeclt on macOS
  • Install kubectl on Windows

Install Kubectl on Linux

  1. Download the specific release replacing <kubectl-version>with the version you would like to download (i.e. […]/release/v1.26.0/bin/[…])
curl -LO https://dl.k8s.io/release/<kubectl-version>/bin/linux/amd64/kubectl
  1. Install kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
  1. Test kubectl
kubectl version --client

Install Kubectl on macOS

  1. Download the specific release based on your CPU, replacing <kubectl-version>with the version you would like to download (i.e. […]/release/v1.26.0/bin/[…])

Intel

curl -LO "https://dl.k8s.io/release/<kubectl-version>/bin/darwin/amd64/kubectl"

Apple Silicon

curl -LO "https://dl.k8s.io/release/<kubectl-version>/bin/darwin/arm64/kubectl"
  1. Make the binary executable and move it on your system PATH
chmod +x ./kubectl

sudo mv ./kubectl /usr/local/bin/kubectl
sudo chown root: /usr/local/bin/kubectl
  1. Test kubectl
kubectl version --client

Install Kubectl on Windows

  1. Download the specific release, replacing <kubectl-version>with the version you would like to download (i.e. […]/release/v1.26.0/bin/[…])
curl.exe -LO "https://dl.k8s.io/release/<kubectl-version>/bin/windows/amd64/kubectl.exe"
  1. Append or prepend the kubectl binary folder to your PATH environment variable.
  1. Test kubectl
kubectl version --client

Configure Kubectl

After creating your Kubernetes cluster you will receive a kubeconfig file. Copy this file to ~/.kube. For Windows users $HOME is equal to the %userprofile%/.kube directory. Rename the file to config and you are good to go.

You can now run kubectl commands and access the cluster:

kubectl get all

Install Helm

Several official methods are available to install the latest version of Helm based on your OS (no specific version is required based on your Kubernetes version).

We report the two official methods, for a specific OS installation through package manager, check https://helm.sh/docs/intro/install/

Install Helm from Binary Release

  1. Download the desired version at https://github.com/helm/helm/releases
  2. Unpack it
  3. Find the helm binary in the unpacked directory, and move it to its desired destination
  4. Test Helm
helm help

Install Helm from Script

Run the following commands to install Helm from script

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh

Configure Helm

Helm uses the same Kube configuration file and looks for it in the same location as kubectl. We therefore repeat the same procedure, but if you already set up Kubectl, no additional steps are required.

After creating your Kubernetes cluster you will receive a kubeconfig file. Copy this file to ~/.kube. For Windows users $HOME is equal to the %userprofile%/.kube directory. Rename the file to config and you are good to go.

The cluster is ready!

At this stage the cluster is ready, turn on the VPN and start using one of the tools to manage your cluster or deploy your applications.

Install and Configure OpenVPN

Your Kubernetes cluster is not accessible to the internet. To have secure access to deploy and manage applications in your cluster, you need to use a VPN. Each Fed4FIRE user gets an individual VPN configuration. Do not share this config with other users.

After downloading the config file, follow this tutorial to install and connect your computer to the VPN.

  • Connect an Ubuntu Desktop
  • Connect an Ubuntu Server
  • Connect a macOS Desktop
  • Connect a Windows Desktop

Connect an Ubuntu Desktop

First, you need to install OpenVPN support:

sudo apt install network-manager-openvpn-gnome

After adding this, reboot your computer. After rebooting, you can add the VPN using Settings.

  1. Open the “Settings” app.
  2. Go to the “Network” tab and click on the + symbol next to “VPN”.


  3. Choose “Import from file…”

  4. Choose the config file you just downloaded.
  5. Go to the IPv4 tab and enable the check box Use this connection only for resources on its network.


  6. Click “Add” to add the VPN.


After adding the VPN, you can start it either from this Settings panel or by clicking on the applet in the top-right corner of your screen and enabling the VPN from the slide-down menu.

Connect an Ubuntu Server

Use the following instructions to connect an Ubuntu server to the VPN. Replace <client-name>.openvpn with the name of the config file you downloaded.

sudo apt install openvpn

sudo openvpn --config <client-name>.ovpn

Use instead the following instructions if you want to use the DNS settings that the OpenVPN server pushes. Always replace <client-name>.openvpn with the name of the config file you downloaded.

sudo apt install openvpn
sudo openvpn --config <client-name>.ovpn --script-security 2 --up /etc/openvpn/update-resolv-conf --down /etc/openvpn/update-resolv-conf

Connect a Windows Desktop

  1. Install OpenVPN Connect Client for Windows: https://openvpn.net/client-connect-vpn-for-windows/
  2. Start the program.
  3. Choose to import a profile from a file.
  4. Choose the file you just downloaded.
  5. Start the VPN

Connect a macOS Desktop

  1. Install OpenVPN Connect Client for macOS: https://openvpn.net/client-connect-vpn-for-mac-os/
  2. Start the program.
  3. Choose to import a profile from a file.
  4. Choose the file you just downloaded.
  5. Start the VPN

Retrieve Configurations

Kube and VPN configurations can be downloaded during the deployment of your cluster. Note that a Kube config file is created for each cluster deployed, while the VPN config file is created once per user.

Retrieve your VPN config file

  1. In the dashboard click on the Access button inside the Get VPN Access tile
  1. Click on the Download VPN Config button to download your VPN config file

You can now use your VPN config file.

Retrieve your Kube config file

To retrieve a Kube config file from a cluster already deployed:

  1. In the dashboard click on the Show status button inside the Manage existing clusters tile
  1. Find the cluster in the list of available deployed clusters
  2. Click on the Details button inside the cluster you want to download the config file
  3. In the General  tab, click on the Download button to download the config file

You can now use your Kube config file.

Cluster Deployment

Login at https://practicum.cloudnativelab.ilabt.imec.be/ with your Fed4FIRE+ credentials.

  1. In the dashboard click on the Create button inside the Deploy Kubernetes clustertile.
  1. Fill in the form in order to start the cluster provisioning. The project has to be a Fed4Fire project. You can share this project with other people so they get access to the same cluster.
  1. Provisioning a cluster involves three major steps. This process can take up to 10 minutes. When all steps are done you click through to the last step.
  1. The cluster is now ready for use. Here you can download the kube config file and the OpenVPN configuration. The kube config file can always be downloaded from the Kubernetes cluster details page. The VPN configuration is created per user (not per cluster!). You can also find the VPN configuration by navigating to the dashboard and selecting the Networking tile.

Quick Start

CloudNativeLab is federated through Fed4FIRE+. To receive credentials and get started, few steps are required:

  1. Sign up
    Join the CloudNativeLab Slack and contact @Sander Borny to see if this testbed suits your needs and how many resources you need. He will send you an invite link to set up your Fed4FIRE+ credentials.
  2. Login
    Login at https://practicum.cloudnativelab.ilabt.imec.be/ using the Fed4FIRE+ credentials.
  3. Create a Kubernetes cluster
    Once logged in, create a new cluster from the dashboard.
  4. Get Access
    Download your personal VPN and Kubernetes configuration files and access the cluster.
  5. Deploy application
    Create a custom deployment using kubectl, Helm or any other tool.


If you need extra guidance, follow our step-by-step guide.

Sandbox Environment

IDLab – imec developed a testbed environment called “CloudNativeLab” that allows users to experiment with Kubernetes and cloud-native technologies without manually setting up any infrastructure. With a very simple process and only a few clicks, you can spin up your own Kubernetes cluster in the IDLab data center.

Key features:

  • Fully managed Kubernetes clusters for experimenting, learning how to operate Kubernetes, and deploying applications in a test environment.
  • Customizable number of nodes and machine size, to adapt to different use cases or match your resources.
  • Full admin access, to have full control of your cluster.
  • Personal VPN, for secure remote access to manage your cluster.

Not sure where to start? Follow our quick start or our step-by-step guide.

As intended for a sandbox environment, we use CloudNativeLab to provide a place where anyone can test and experiment. The same applies to us while maintaining and updating the system. Occasionally, some downtimes can be expected. We will try to bring the environment back online as soon as possible.

OpenCloudification Asks

Which Open Cloud Technologies are you using or considering to use?