If you work with Docker, you’ve surely noticed recently that DockerHub requires authentication when you download a bit more from it. In this article, I’ve decided to describe how to handle this in connection with MicroK8s.

The first thing we need to modify is the file /var/snap/microk8s/current/args/certs.d/docker.io/hosts.toml. If any subdirectory or file doesn’t exist, create it. The file should look like this:

server = "https://docker.io"

[host."https://registry-1.docker.io"]
  capabilities = ["pull", "resolve"]
  [host."https://registry-1.docker.io".auth]
    username = "YOUR_DOCKERHUB_USERNAME"
    identitytoken = "dckr_pat_TOKEN"

You need to generate a token on the DockerHub website. You can do this by clicking on Account -> Personal Access Tokens

ArgoCD

Then you just need to run:

microk8s stop
microk8s start

And you can download as much as you like.