Container runtimes

From 1.15 onwards, Charmed Kubernetes uses containerd as part of a pluggable architecture for container runtimes, instead of directly using Docker only. This change has been demonstrated to increase performance, and also provides scope for using different runtimes on a case-by case basis.

However, it is also possible to use Docker for running containers as in previous versions of Charmed Kubernetes.

Configuring containerd

Settings which require additional explanation are described below.

name type Default Description
custom_registries string [] See notes
disable-juju-proxy boolean False Ignore juju-http(s) proxy settings on this charm. If set to true, all juju https proxy settings will be ignored
enable-cgroups boolean False Enable GRUB cgroup overrides cgroup_enable=memory swapaccount=1. WARNING changing this option will reboot the host - use with caution on production services.
gpu_driver string auto Override GPU driver installation. Options are “auto”, “nvidia”, “none”.
http_proxy string   URL to use for HTTP_PROXY to be used by Containerd. Useful in egress-filtered environments where a proxy is the only option for accessing the registry to pull images.
https_proxy string   URL to use for HTTPS_PROXY to be used by Containerd. Useful in egress-filtered environments where a proxy is the only option for accessing the registry to pull images.
no_proxy string   See notes
runtime string auto Set a custom containerd runtime. Set “auto” to select based on hardware.
shim string containerd-shim Set a custom containerd shim.

custom_registries

Description:

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

The value for this config must be a JSON array of credential objects, like this: [{"url": "https://my.registry:port", "username": "user", "password": "pass"}]

Back to table

no_proxy

Description:

Comma-separated list of destinations (either domain names or IP addresses) which should be accessed directly, rather than through the proxy defined in http_proxy or https_proxy. Must be less than 2023 characters long.

Back to table

Checking the current configuration

To check the current configuration settings for containerd, run the command:

juju config containerd

Setting a config option

To set an option, simply run the config command with and additional <key>=<value> argument. For example, to explicitly turn off the nvidia driver:

juju config containerd gpu_driver=none

Migrating to containerd

If you have upgraded to Charmed Kubernetes version 1.15, you can transition to using containerd by following the steps outlined in this section of the upgrade notes.

Using Docker

Although the default set up for Charmed Kubernetes from version 1.15 is to use containerd to provide the container runtime, it is also possible to run workers specifically using Docker. This is done by adding the Docker charm to your cluster and deploying Docker-based workers:

juju deploy cs:~containers/kubernetes-worker kubernetes-worker-docker
juju deploy cs:~containers/docker
juju relate docker kubernetes-worker-docker

We appreciate your feedback on the documentation. You can edit this page or file a bug here.