Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions kubernetes/pipeline/02configure
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,15 @@ if ! is_hyperconverged; then
fi

# Automatically use proxy if in prodstack only
if $(timeout 1s getent hosts squid.internal &> /dev/null) && [ -z "${MOD_PARAMS[__CONTAINERD_PROXY__]}" ]; then
MOD_MSGS[1_proxy.0]='PROXY: Hostname squid.internal resolves, setting containerd proxy to http://squid.internal:3128'
MOD_PARAMS[__CONTAINERD_PROXY__]=http://squid.internal:3128
if $(timeout 1s getent hosts squid.internal &> /dev/null); then
if has_opt --cdk && [ -z "${MOD_PARAMS[__CONTAINERD_PROXY__]}" ]; then
MOD_MSGS[1_proxy.0]='PROXY: Hostname squid.internal resolves, setting containerd proxy to http://squid.internal:3128'
MOD_PARAMS[__CONTAINERD_PROXY__]=http://squid.internal:3128
else
MOD_MSGS[1_proxy.0]='PROXY: Hostname squid.internal resolves, setting juju proxy to http://squid.internal:3128'
# from https://documentation.ubuntu.com/canonical-kubernetes/latest/charm/howto/proxy
juju model-config juju-http-proxy=http://squid.internal:3128 juju-https-proxy=http://squid.internal:3128 juju-no-proxy=10.0.0.0/8,192.168.0.0/16,127.0.0.1,10.152.183.0/24
Copy link
Contributor

@lathiat lathiat Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would re-use the config option for --containerd-no-proxy that I already had, and have a different set of defaults for: --containerd-no-proxy #__OPT__type: (default=127.0.0.1,localhost,::1,10.149.0.0/16,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16)

So would just use ${MOD_PARAMS[CONTAINERD_NO_PROXY]}

Seems 10.152.183.0/24 is the default subnet for Kubernetes in some cases? It should in theory be taken care of by 10.0.0.0/8 however CIDR exclusions in no-proxy are non-standard and juju tries to expand them out a bit and sometimes runs out of space to do so. You may also need to add 10.152.183.0/24 in front of 10.0.0.0/8 in the current no-proxy default.

Please also verify that Canonical K8s works and that you can actually deploy something obvious like COS on top of it. We had issues in the past where the proxy config didn't work for some other things or services in the model.. since this setting is for the entire juju model, we may need to tweak the default no-proxy config a bit more.

fi
fi

# Skip processing input if it includes exclusive passthrough options
Expand Down