...
Expand |
---|
title | Set 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. 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"
export no_proxy=localhost,.svc,.cluster.local,127.0.0.0/8,<local IP> |
Please replace the placehoder “<local IP>“ with the IP address of your server.
If you need to pass username and password to the proxy, usechange the first two lines to 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. 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 and add the following lines to the end of the file: code 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" |
Logout and login with your user again, so that the file .bashrc from step 1 are applied.
|
Execute the installation of k3s with the command
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:
...