Kubernetes fails to start on Docker Desktop without direct internet access

Viewed 1338

I'm running Docker Desktop 3.6.0 on Windows 10 with WSL2. When I try to enable Kubernetes I only see "Failed to start" within the Docker Desktop UI. Docker itself works fine. Not sure how I can get any further logs.

Here the output from kubectl version:

kubectl version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.3", GitCommit:"ca643a4d1f7bfe34773c74f79527be4afd95bf39", GitTreeState:"clean", BuildDate:"2021-07-15T21:04:39Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"windows/amd64"}
Error from server (InternalError): an error on the server ("") has prevented the request from succeeding

From other posts it seems that and internet connections is required for initial setup:

Direct internet connection is not possible on my work environment, I can only manually copy required images on my pc. I also do not have admin access.

Is there a way to manually setup Kubernetes on Docker Desktop or somehow indicate where the required images can be found?

I have a nexus Docker repository where I can push required images to. I have changed the ~\.docker\daemon.json and added my docker repository in insecure-registries. After first login docker is able to pull images from there and run them.

Already tried to reset or enable and disable Kubernetes. Also deleting ~/.kube/config did not work.

1 Answers

High level answer...

  1. Get a docker registry
    1. If you work for an old skool cool enterprise; use JFrog Artifactory
    2. If you just want to get it to work; use Harbor
    3. GitHub and GitLab (depending on license) have registries available too...
  2. Edit the docker daemon on the kubernetes nodes (your workstation) to only pull from these registries.
    1. if redhat; /etc/containers/registries.conf
    2. if debain; /etc/docker/daemon.json
    3. you might be able to hack a /etc/hosts entry too...
  3. Populate the new registry
  4. Run kubernetes and yoiu should be good to go. Depending on the configuration you choose you may need to add a registry credential secret.
Related