Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you don’t have a Kubernetes infrastructure you can set up a single node cluster at a vm. The following section will describe how to set zu such a cluster.

Install k3s

Expand
titleSet up Proxy für k3s and helm if neccessary

If your server does reach the internet over a proxy only, you have to setup your environment to use this proxy with k3s and helm. This section describes the necessary steps to configure the proxy permanently.

  1. Edit the file ~/.bashrc for your deployment user and add the following lines:

    Code Block
    export http_proxy="proxy:port"
    export https_proxy="proxy:port"

    If you need to pass username and password to the proxy, use

    Code Block
    export http_proxy="username:password@proxy:port"
    export https_proxy="username:password@proxy:port"

    Now commands issued by the user can access the internet.

  2. In the install script of k3s, some commands are issued as root user (using sudo). So we have to make sure, that the command called with sudo sees the proxy variables too. To make this sure, call the command

    sudo visudo

    and add the following lines to the end of the file:

    Code Block
    Code Block
    Defaults  env_keep += "http_proxy"
    Defaults  env_keep += "https_proxy"
    Defaults  env_keep += "no_proxy"
    Defaults  env_keep += "HTTP_PROXY"
    Defaults  env_keep += "HTTPS_PROXY"
    Defaults  env_keep += "NO_PROXY"


Code Block
curl -sfL https://get.k3s.io | sh -

Wait 30 seconds.

You can test it with the command sudo kubectl get node. It will provide an output similar to this one:

...