# How do I configure MicroK8s contained to support transparent redirection of container images? 

**URL:** <https://discuss.kubernetes.io/t/how-do-i-configure-microk8s-contained-to-support-transparent-redirection-of-container-images/35448>\
**Category:** microk8s\
**Created:** [October 16, 2026, 10:18pm UTC](https://discuss.kubernetes.io/t/how-do-i-configure-microk8s-contained-to-support-transparent-redirection-of-container-images/35448 "2026-10-16T22:18:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![auglotus\_zheng](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/auglotus_zheng/32/18590_2.png) [@auglotus\_zheng](https://discuss.kubernetes.io/u/auglotus_zheng)\
**Post date:** [October 16, 2026, 10:18pm UTC](https://discuss.kubernetes.io/t/how-do-i-configure-microk8s-contained-to-support-transparent-redirection-of-container-images/35448/1 "2026-10-16T22:18:12Z")

</div>

Suppose there is a container image whose original image name is `quay.io/xyz/abc:0.1.0`. Use `ctr image pull` to pull it locally and load it into the built-in registry. Normally, to access the container image in the registry, you need to use the image name `localhost:32000/quay.io/xyz/abc:0.1.0`. For a YAML file whose `image` field is written with the original container image name, this means changing the `image` field from the original container image name to the registry image name. Modifying a large number of YAML files will cause a series of problems. Therefore, it is desirable to configure MicroK8s contained to support transparent redirection of container images, that is, without modifying the `image` field in the YAML file and keeping its original container image name, while actually automatically accessing the registry, i.e., `quay.io/xyz/abc:0.1.0` → `localhost:32000/quay.io/xyz/abc:0.1.0`. How should this be configured in practice?

---

<div class="post-metadata">

**Author:** ![jaharoni](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/jaharoni/32/18701_2.png) [@jaharoni](https://discuss.kubernetes.io/u/jaharoni)\
**Post date:** [November 20, 2026, 4:58pm UTC](https://discuss.kubernetes.io/t/how-do-i-configure-microk8s-contained-to-support-transparent-redirection-of-container-images/35448/2 "2026-11-20T16:58:57Z")

</div>

You can redirect pulls for `quay.io/xyz/abc:0.1.0` to MicroK8s’s built-in registry without modifying pod manifests by adding a snapped containerd `certs.d` mirror config and watching one subtle tag-path rule.

Create `/var/snap/microk8s/current/args/certs.d/quay.io/hosts.toml`. on each node (MicroK8s’s containerd reads `args/certs.d` under the snap directory rather than `/etc/containerd/certs.d`):

```toml
server = "https://quay.io"

[host."http://localhost:32000"]
  capabilities = ["pull", "resolve"]

```

Confirm `/var/snap/microk8s/current/args/containerd-template.toml` sets `config_path = "/var/snap/microk8s/current/args/certs.d"` (standard on recent MicroK8s releases) and restart containerd (`sudo snap restart microk8s.daemon-containerd`).

Push without repeating `quay.io/` in the local repo path: when containerd mirrors `quay.io/xyz/abc:0.1.0` against `http://localhost:32000`, it sends `GET /v2/xyz/abc/manifests/0.1.0` (the registry hostname `quay.io` is stripped from the OCI path). Because your local push used `localhost:32000/quay.io/xyz/abc:0.1.0`, `localhost:32000` stores it under `/v2/quay.io/xyz/abc/...` instead of `/v2/xyz/abc/...`.

Retag and push to the local registry as:

```bash
docker tag quay.io/xyz/abc:0.1.0 localhost:32000/xyz/abc:0.1.0
docker push localhost:32000/xyz/abc:0.1.0

```

With the image pushed under `localhost:32000/xyz/abc:0.1.0` and `certs.d/quay.io/hosts.toml` in place, Kubernetes manifests referencing `image: quay.io/xyz/abc:0.1.0` resolve transparently from the local registry.
