Setup edge cluster local image registry for MicroK8s¶
Note: Skip this section if using remote image registry. Enable the container registry and configure Docker to tolerate the insecure registry.
Procedure¶
- Enable the container registry:
microk8s.enable registry
export REGISTRY_ENDPOINT=localhost:32000
export REGISTRY_IP_ENDPOINT=$(kubectl get service registry -n container-registry | grep registry | awk '{print $3;}'):5000
- Install Docker (if not already installed,
docker --versionto check):
- Install jq (if not already installed):
- Define this registry as insecure to Docker. Create or add to
/etc/docker/daemon.json:
echo "{
\"insecure-registries\": [ \"$REGISTRY_ENDPOINT\", \"$REGISTRY_IP_ENDPOINT\" ]
}" >> /etc/docker/daemon.json
- Restart Docker to pick up the change: