Using proxies with Charmed Kubernetes
There are many occasions, particularly in production environments, when your Kubernetes cluster does not have direct, unfettered access to the internet. This can cause complications when installing, updating or modifying your cluster.
This is usually worked around by setting a proxy to point at a resource which handles requests to the desired internet resource - a proxy. Charmed Kubernetes relies entirely on Juju for its proxy settings - there are no special configurations required for individual services or charms.
A Juju model can define proxies for the resources Charmed Kubernetes will need:
- A snap proxy, for installing software from snap packages
- An apt proxy, for software installed via apt packages.
- A Juju proxy, which exposes proxy settings to Juju itself, and to deployed charms.
Note that Juju can also set other proxy types, but these are not relevant to Charmed Kubernetes.
Setting proxies for the Juju model
Proxy settings are made by configuring the Juju model they are to apply to. For example, to set the snap-http(s)-proxy for the model:
juju model-config snap-http-proxy=http://squid.local:3128 juju model-config snap-https-proxy=http://squid.local:3128
For some services, e.g.
apt, you may wish to also configure the
setting - for example where you have set up and configured a local or
otherwise accessible source for packages:
juju model-config apt-no-proxy=localhost,127.0.0.1,ppa.local,10.24.2.0/24
As demonstrated here, it is possible to indicate several resources by supplying a comma-delimited list. It is also possible to select a range of network addresses using a CIDR.
You can see the configuration settings for the current model by running:
The relevant options for setting proxies for Charmed Kubernetes are:
For more extensive documentation on configuring proxies with Juju, please refer to the Juju proxy documentation