---
wrapper_template: "templates/docs/markdown.html"
markdown_includes:
  nav: "kubernetes/docs/shared/_side-navigation.md"
context:
  title: "Container runtimes"
  description: Configure and use containerd as the container runtime
keywords: containerd, docker, runtime, image
tags: [architecture]
sidebar: k8smain-sidebar
permalink: container-runtime.html
layout: [base, ubuntu-com]
toc: False
---

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

Upstream support for the Docker container runtime was removed in the 1.24 release. Thus, the
`docker` subordinate charm will no longer function from **Charmed Kubernetes** 1.24 onwards.


## Configuring containerd

Settings which require additional explanation are described below.

| name | type   | Default      | Description                               |
|------|--------|--------------|-------------------------------------------|
| <a id="table-custom_registries"> </a> custom_registries | string | [] | [See notes](#custom_registries-description)  |
| <a id="table-disable-juju-proxy"> </a> 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  |
| <a id="table-enable-cgroups"> </a> 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.  |
| <a id="table-gpu_driver"> </a> gpu_driver | string | auto | Override GPU driver installation.  Options are "auto", "nvidia", "none".  |
| <a id="table-http_proxy"> </a> 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.  |
| <a id="table-https_proxy"> </a> 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.  |
| <a id="table-no_proxy"> </a> no_proxy | string |  | [See notes](#no_proxy-description)  |
| <a id="table-runtime"> </a> runtime | string | auto | Set a custom containerd runtime.  Set "auto" to select based on hardware.  |
| <a id="table-shim"> </a> shim | string | containerd-shim | Set a custom containerd shim.  |

---

### custom_registries


<a id="custom_registries-description"> </a>
**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](#table-custom_registries)


### no_proxy


<a id="no_proxy-description"> </a>
**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](#table-no_proxy)



### Checking the current configuration

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

```bash
juju config containerd
```

### Setting a config option

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

```bash
juju config containerd gpu_driver=none
```

## Migrating to containerd

If you are upgrading from a version of **Charmed Kubernetes** that uses the `docker`
subordinate charm for the container runtime, transition to `containerd` by following
the steps outlined in [this section of the upgrade notes][docker2containerd].


<!-- LINKS -->

[docker2containerd]: /kubernetes/docs/upgrade-notes#1.15

<!-- FEEDBACK -->
<div class="p-notification--information">
  <div class="p-notification__content">
    <p class="p-notification__message">We appreciate your feedback on the documentation. You can
    <a href="https://github.com/charmed-kubernetes/kubernetes-docs/edit/main/pages/k8s/container-runtime.md" >edit this page</a>
    or
    <a href="https://github.com/charmed-kubernetes/kubernetes-docs/issues/new">file a bug here</a>.</p>
    <p>See the guide to <a href="/kubernetes/docs/how-to-contribute"> contributing </a> or discuss these docs in our <a href="https://chat.charmhub.io/charmhub/channels/kubernetes"> public Mattermost channel</a>.</p>
  </div>
</div>

