How to take your deployment offline¶
To take your deployment offline (to be more precise, in a proxy-restricted environment):
Use a private cloud.
See more: List of supported clouds
Figure out the list of external services required for your deployment and set up proxies / local mirrors for them. Depending on whether your deployment is on machines or Kubernetes, and on a localhost cloud or not, and which one, these services may include:
https://streams.canonical.com for agent binaries and LXD container and VM images;
https://charmhub.io/ for charms, including the Juju controller charm;
https://snapcraft.io/store for Juju’s internal database;
http://cloud-images.ubuntu.com for base Ubuntu cloud machine images, and http://archive.ubuntu.com and http://security.ubuntu.com for machine image upgrades;
a container image registry:
Configure Juju to make use of the proxies / local mirrors you’ve set up by means of the following model configuration keys:
model-config-agent-metadata-url
model-config-apt-ftp-proxy
model-config-apt-http-proxy
model-config-apt-https-proxy
model-config-apt-mirror
model-config-apt-no-proxy
model-config-container-image-metadata-url
model-config-ftp-proxy
model-config-http-proxy
model-config-https-proxy
model-config-image-metadata-url
model-config-juju-ftp-proxy
model-config-juju-http-proxy
model-config-juju-https-proxy
model-config-juju-no-proxy
model-config-no-proxy
model-config-snap-http-proxy
model-config-snap-https-proxy
model-config-snap-store-assertions
model-config-snap-store-proxy
model-config-snap-store-proxy-url
Examples:
Configure the client to use an HTTP proxy
Set up an HTTP proxy, export it to an environment variable, then use the http-proxy
model configuration key to point the client to that value.
Configure all models to use an APT mirror
Set up an APT mirror, export it to the environment variable $MIRROR_APT, then set the apt-mirror
model config key to point to that environment variable. For example, for a controller on AWS:
juju bootstrap --model-default apt-mirror=$MIRROR_APT aws
Have all models use local resources for both Juju agent binaries and cloud images
Get the resources for Juju agent binaries and cloud images locally; define and export export environment variables pointing to them; then set the agent-metadata-url
and image-metadata-url
model configuration keys to point to those environment variables. For example:
juju bootstrap \
--model-default agent-metadata-url=$LOCAL_AGENTS \
--model-default image-metadata-url=$LOCAL_IMAGES \
localhost
Set up HTTP and HTTPS proxies but exclude the localhost cloud
Set up HTTP and HTTPS proxies and define and export environment variables pointing to them (below, PROXY_HTTP
and PROXY_HTTPS
); define and export a variable pointing to the IP addresses for your localhost
cloud to the environment variable (below,PROXY_NO
); then bootstrap setting the http_proxy
, https_proxy
, and no-proxy
model configuration keys to the corresponding environment variable. For example:
$ export PROXY_HTTP=http://squid.internal:3128
$ export PROXY_HTTPS=http://squid.internal:3128
$ export PROXY_NO=$(echo localhost 127.0.0.1 10.245.67.130 10.44.139.{1..255} | sed 's/ /,/g')
$ export http_proxy=$PROXY_HTTP
$ export https_proxy=$PROXY_HTTP
$ export no_proxy=$PROXY_NO
$ juju bootstrap \
--model-default http-proxy=$PROXY_HTTP \
--model-default https-proxy=$PROXY_HTTPS \
--model-default no-proxy=$PROXY_NO \
localhost lxd