Configuring Rancher and Fleet agent to run behind a HTTP proxy if cluster was previously registered
This article is applicable when there is a cluster showing as “unavailable“ after the user configured a proxy on the server.
If you have a cluster which hasn’t been registered yet (registration command has not been run yet), then refer to Configuring Rancher and Fleet agent to run behind an HTTP proxy.
Run
envon the user’s server to determine what’s the proxy IP. You should check the following line:
http_proxy=http://X.X.X.XOpen the file
/etc/systemd/system/k3s.service.envand append the following lines:
http_proxy="$PROXY_IP"
https_proxy="$PROXY_IP"
no_proxy="$NODE_IP,localhost,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,.svc,.cluster.local"Restart k3s
systemctl restart k3s.serviceGo to the Rancher dashboard Cluster Management > Clusters and click on Edit Config for your cluster:

a. Go to Advanced Options:

b. Configure the following Agent Environment Variables and press Save:
Run the command
kubectl edit deployment -n cattle-system cattle-cluster-agent -o yamlandType letter “i“ to insert text and on the env section, type the following lines:
Example:

Save by pressing ESC and then typing “wq”
Now do the same on the fleet-agent by running the command
kubectl edit deployment -n cattle-fleet-system fleet-agent -o yamlRepeat the step #6.
After applying all the changes, wait for some minutes for the cluster to become Online on Rancher again.
Last updated
Was this helpful?