Charm configuration options reference

This reference lists the configuration options for the k8s and k8s-worker charms. They are also available on Charmhub for k8s and Charmhub for k8s-worker.

These options can be set at various points during the charm’s lifecycle. Some options are limited to the bootstrap process, while others can be modified at any time. Options restricted to bootstrap are explicitly noted in their descriptions and prefixed with bootstrap-.

See the How to configure your cluster how-to guide to see how to apply these configurations.

Configuration options for k8s charm

bootstrap-datastore

string · default ""

The datastore to use in Canonical Kubernetes. This can only be set at deployment and cannot be changed afterward.

Allowed values are “”, managed-etcd, dqlite and etcd.

  • “”: The charm will automatically bootstrap with the default datastore managed by the k8s snap.

  • managed-etcd: The charm will bootstrap with a managed-etcd datastore.

  • etcd: The charm will bootstrap with an external etcd datastore. The charm will block until the etcd charm is integrated.

bootstrap-node-taints

string · default ""

Space-separated list of taints to apply to this node at registration time.

This config is only used at bootstrap time when Kubelet first registers the node with Kubernetes. To change node taints after deploy time, use kubectl instead.

For more information, see the upstream Kubernetes documentation about taints: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/

bootstrap-pod-cidr

string · default ""

Comma-separated CIDR blocks for IP addresses that can be assigned to pods within the cluster. Can contain at most 2 blocks, one for IPv4 and one for IPv6. If the value is “”, the snap will automatically assign a CIDR block for the pods.

After deployment it is not possible to change the size of the IP range.

  • “192.0.2.0/24”

  • “2001:db8::/32”

  • “192.0.2.0/24,2001:db8::/32”

  • “2001:db8::/32,192.0.2.0/24”

bootstrap-service-cidr

string · default ""

Comma-separated CIDR blocks for IP addresses that can be assigned to services within the cluster. Can contain at most 2 blocks, one for IPv4 and one for IPv6. If the value is “”, the snap will automatically assign a CIDR block for the services.

After deployment it is not possible to change the size of the IP range.

  • “” - The charm will bootstrap with the defaults from the k8s snap

  • “192.0.2.0/24”

  • “2001:db8::/32”

  • “192.0.2.0/24,2001:db8::/32”

  • “2001:db8::/32,192.0.2.0/24”

cluster-annotations

string · default ""

Space-separated list of (key/value) pairs) that can be used to add arbitrary metadata configuration to the Canonical Kubernetes cluster. For more information, see the upstream Canonical Kubernetes documentation about annotations:

https://documentation.ubuntu.com/canonical-kubernetes/latest/src/snap/reference/annotations/

Annotations are merged with the existing cluster annotations: setting a key adds or updates its value, while annotations set out-of-band (e.g. via the k8s CLI) are left untouched. To remove an annotation from the cluster, set its value to “-“.

Example: e.g.: key1=value1 key2=value2 Remove an annotation: e.g.: key1=-

containerd-custom-registries

string · default "[]"

Registry endpoints and credentials. Setting this config allows containerd to pull images from registries where auth is required.

https://documentation.ubuntu.com/canonical-kubernetes/latest/charm/howto/custom-registry/

The value for this config must be a JSON array of credential objects, like this: e.g.: [{“url”: “https://registry.example.com”, “host”: “my.registry:port”, “username”: “user”, “password”: “pass”}]

Credential Object Parameters: url: REQUIRED str the URL to the registry, include the port if not it isn’t implied from the schema. e.g: “url”: “https://my.registry:8443” e.g: “url”: “http://my.registry”

host: OPTIONAL str - defaults to auto-generated from the url could be registry host address or a name e.g.: myregistry.io:9000, 10.10.10.10:5432 e.g.: myregistry.io, myregistry Note: It will be derived from url if not provided. e.g.: “url”: “http://10.10.10.10:8000” –> “host”: “10.10.10.10:8000”

username: OPTIONAL str - default ‘’ password: OPTIONAL str - default ‘’ identitytoken: OPTIONAL str - default ‘’ Used by containerd for basic authentication to the registry.

ca_file: OPTIONAL str - default ‘’ cert_file: OPTIONAL str - default ‘’ key_file: OPTIONAL str - default ‘’ For ssl/tls communication these should be a base64 encoded file e.g.: “ca_file”: “’”$(base64 -w 0 < my.custom.registry.pem)”’”

override_path: OPTIONAL boolean - default false used to indicate the host’s API root endpoint is defined in the URL path rather than by the API specification.

This is useful when trying to set a nested path of a mirror registry.

skip_verify: OPTIONAL bool - default false For situations where the registry has self-signed or expired certs and a quick work-around is necessary. e.g.: “skip_verify”: true

Example config: juju config k8s containerd-custom-registries=’[{ “url”: “https://registry.example.com”, “host”: “ghcr.io”, “ca_file”: “’”$(base64 -w 0 < ~/my.custom.ca.pem)”’”, “cert_file”: “’”$(base64 -w 0 < ~/my.custom.cert.pem)”’”, “key_file”: “’”$(base64 -w 0 < ~/my.custom.key.pem)”’” }]’

datastore-extra-args

string · default ""

Space separated list of flags and key=value pairs that will be passed as arguments to datastore if managed-etcd or dqlite is set as datastore.

Notes: Options may only be set on charm deployment

For example a value like this: –heartbeat-interval=100 listen-peer-urls=http://10.0.0.1:2380 will result in the datastore being run with the following options: –heartbeat-interval=100 –listen-peer-urls=http://10.0.0.1:2380

dns-cluster-domain

string · default "cluster.local"

Sets the local domain of the cluster

dns-enabled

boolean · default true

Enable/Disable the DNS feature on the cluster.

dns-service-ip

string · default ""

Sets the IP address of the dns service. If omitted defaults to the IP address of the Kubernetes service created by the feature.

Can be used to point to an external dns server when feature is disabled.

dns-upstream-nameservers

string · default ""

Space-separated list of upstream nameservers used to forward queries for out-of-cluster endpoints.

If omitted defaults to /etc/resolv.conf and uses the nameservers on each node.

gateway-enabled

boolean · default false

Enable/Disable the gateway feature on the cluster.

ingress-enable-proxy-protocol

boolean · default false

Determines if the proxy protocol should be enabled for ingresses.

ingress-enabled

boolean · default false

Determines if the ingress feature should be enabled.

kube-apiserver-extra-args

string · default ""

Space separated list of flags and key=value pairs that will be passed as arguments to kube-apiserver.

Notes: Options may only be set on charm deployment

For example a value like this: runtime-config=batch/v2alpha1=true profiling=true will result in kube-apiserver being run with the following options: –runtime-config=batch/v2alpha1=true –profiling=true

kube-apiserver-extra-sans

string · default ""

Space separated list of extra Subject Alternative Names for the kube-apiserver self-signed certificates.

Examples:

  • “kubernetes”

  • “kubernetes.default.svc”

  • “kubernetes.default.svc.cluster.local”

kube-controller-manager-extra-args

string · default ""

Space separated list of flags and key=value pairs that will be passed as arguments to kube-controller-manager.

Notes: Options may only be set on charm deployment cluster-name: cannot be overridden

For example a value like this: runtime-config=batch/v2alpha1=true profiling=true will result in kube-controller-manager being run with the following options: –runtime-config=batch/v2alpha1=true –profiling=true

kube-proxy-enabled

string · default "auto"

Determines if kube-proxy is going to be running on the nodes. The admins can disable kube-proxy in case of a replacement like Cilium.

Allowed values are “auto”, “false”, and “true”.

  • auto: The cluster automatically decides whether or not kube-proxy should be enabled.

  • false: Disable kube-proxy in the cluster nodes.

  • true: Enable kube-proxy in the cluster nodes.

kube-proxy-extra-args

string · default ""

Space separated list of flags and key=value pairs that will be passed as arguments to kube-proxy.

For example a value like this: runtime-config=batch/v2alpha1=true profiling=true will result in kube-proxy being run with the following options: –runtime-config=batch/v2alpha1=true –profiling=true

kube-scheduler-extra-args

string · default ""

Space separated list of flags and key=value pairs that will be passed as arguments to kube-scheduler.

Notes: Options may only be set on charm deployment

For example a value like this: runtime-config=batch/v2alpha1=true profiling=true will result in kube-scheduler being run with the following options: –runtime-config=batch/v2alpha1=true –profiling=true

kubelet-extra-args

string · default ""

Space separated list of flags and key=value pairs that will be passed as arguments to kubelet.

For example a value like this: runtime-config=batch/v2alpha1=true profiling=true will result in kubelet being run with the following options: –runtime-config=batch/v2alpha1=true –profiling=true

load-balancer-bgp-local-asn

int · default 64512

Local ASN for the load balancer. This is only used if load-balancer-bgp-mode is set to true.

load-balancer-bgp-mode

boolean · default false

Enable/Disable BGP mode for the load balancer. This is only used if load-balancer-enabled is set to true.

load-balancer-bgp-peer-address

string · default ""

Address of the BGP peer for the load balancer. This is only used if load-balancer-bgp-mode is set to true.

load-balancer-bgp-peer-asn

int · default 64513

ASN of the BGP peer for the load balancer. This is required if load-balancer-bgp-mode is set to true.

load-balancer-bgp-peer-port

int · default 179

Port of the BGP peer for the load balancer. This is only used if load-balancer-bgp-mode is set to true.

load-balancer-cidrs

string · default ""

Space-separated list of CIDRs to use for the load balancer. This is only used if load-balancer-enabled is set to true.

load-balancer-enabled

boolean · default false

Enable/Disable the load balancer feature on the cluster.

load-balancer-l2-interfaces

string · default ""

Space-separated list of interfaces to use for the load balancer. This is only used if load-balancer-l2-mode is set to true. if unset, all interfaces will be used.

load-balancer-l2-mode

boolean · default false

Enable/Disable L2 mode for the load balancer. This is only used if load-balancer-enabled is set to true.

local-storage-enabled

boolean · default true

Enable local storage provisioning. This will create a storage class named “local-storage” that uses the rawfile-localpv provisioner. Local storage will not survive node removal, so it may not be suitable for certain setups, such as production multi-node clusters.

local-storage-local-path

string · default "/var/snap/k8s/common/rawfile-storage"

The path on the host where local storage will be provisioned. This path must be writable by the kubelet. This is only used if local-storage.enabled is set to true.

local-storage-reclaim-policy

string · default "Delete"

The reclaim policy for local storage. This can be either “Delete” or “Retain”. If set to “Delete”, the storage will be deleted when the PersistentVolumeClaim is deleted. If set to “Retain”, the storage will be retained when the PersistentVolumeClaim is deleted.

metrics-server-enabled

boolean · default true

Enable/Disable the metrics-server feature on the cluster.

network-enabled

boolean · default true

Enables or disables the network feature.

node-labels

string · default ""

Labels can be used to organize and to select subsets of nodes in the cluster. Declare node labels in key=value format, separated by spaces.

unready-pod-namespaces

string · default "kube-system metallb-system"

Space-separated list of namespaces to check for unready pods. This is used to determine the status of the cluster and its components. If not set, no namespaces will be checked.

Configuration options for k8s-worker charm

bootstrap-node-taints

string · default ""

Space-separated list of taints to apply to this node at registration time.

This config is only used at bootstrap time when Kubelet first registers the node with Kubernetes. To change node taints after deploy time, use kubectl instead.

For more information, see the upstream Kubernetes documentation about taints: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/

kube-proxy-extra-args

string · default ""

Space separated list of flags and key=value pairs that will be passed as arguments to kube-proxy.

For example a value like this: runtime-config=batch/v2alpha1=true profiling=true will result in kube-proxy being run with the following options: –runtime-config=batch/v2alpha1=true –profiling=true

kubelet-extra-args

string · default ""

Space separated list of flags and key=value pairs that will be passed as arguments to kubelet.

For example a value like this: runtime-config=batch/v2alpha1=true profiling=true will result in kubelet being run with the following options: –runtime-config=batch/v2alpha1=true –profiling=true

node-labels

string · default ""

Labels can be used to organize and to select subsets of nodes in the cluster. Declare node labels in key=value format, separated by spaces.

Note: Due to NodeRestriction, workers are limited to how they can label themselves https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#noderestriction