1

For docker pull we can do something like the following so it can pull from a local registry by running docker pull localhost:32000/hello:latest.

{
  "insecure-registries" : [
      "localhost:32000"
  ]
}

Is there similar config can be done, such when running cmd like:

microk8s ctr image pull localhost:32000/hello:latest

it doesn't run into server gave HTTP response to HTTPS client?

Progman
  • 16,827
  • 6
  • 33
  • 48
jack2684
  • 324
  • 3
  • 15

2 Answers2

2

From https://microk8s.io/docs/registry-private:

sudo bash
umask 770
AUTHORITY='localhost:32000'
mkdir -p "/var/snap/microk8s/current/args/certs.d/${AUTHORITY}"
cat <<EOF >"/var/snap/microk8s/current/args/certs.d/${AUTHORITY}/hosts.toml"
server = "http://${AUTHORITY}"

[host."${AUTHORITY}"]
capabilities = ["pull", "resolve"]
EOF
microk8s stop
microk8s start
Noel Yap
  • 18,822
  • 21
  • 92
  • 144
0

Use ctr flag --plain-text to use insecure protocol. Source code

microk8s ctr image pull --plain-text localhost:32000/hello:latest