Change:
<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks! If the matter is securit pty related, please disclose irivately via --What happened: There is a Windows minion node in my k8s cluster, I have specified "--pod-infra-container-image" for kubelet which is pointing to a private docker repository. The kubelet running as a Windows service, service account is LocalSystem: I have login to the repository with Administrator, and then copied from Administrator's profile folder to "C:windowssystem32configsystemprofile.docker". When I schedule pod on Windows node, kubelet cannot pull infra container image from the private repository with error: I can see there is a PR solved this issue, but it seems not work on Windows. What you expected to happen: Able to pull infra container image from a private repository on Windows node. How to reproduce it (as minimally and precisely as possible): Run kubelet as a Windows service and specify --pod-infra-container-image to point to a private repository with basic auth. Anything else we need to know?: Environment: Kubernetes version (use ): Linux node: Windows node: Cloud provider or hardware configuration: OS (e.g: ): Windows Server core 1709 Kernel (e.g. ): 10.0..125 Install tools: Others:
Reiterating the mentions to trigger a notification: <detailsIn response to : Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
Your private repo only provides http service? does it need authentication?
the private repo built by Nexus, it requires basic authentication
/assign
Hello, First of all, the PR you mentioned was closed, but not merged. Secondly, why do you need to use a private repo for the [2]. Even if you opt to use a private repo, if you pull it after you've authenticated, it would fix your problem. Finally, I can confirm that kubelet is not able to pull the configured private image case). [1] [2] [3]
Ok, so, I have a couple of updates regarding this. First of all, indeed, the PR mentioned in the issue was closed without merging, but another one was merged in its stead: [1] Secondly, it seems that kubelet is trying multiple credential providers, including for azure, aws, gcp, kubernetes secrets, and local configurations, as it can be seen here: [2]. I actually ended up getting it to work by setting up the local configrations properly. From what I can see in the code, it could still be a Windows related issue [3] (the env var name should be ), but it can be avoided, since it will check multiple locations for the configurations: I0513 16:22:05. ] looking for at C:varlibkubelet I0513 16:22:05. ] looking for at C:k I0513 16:22:05. ] looking for at C:k.docker I0513 16:22:05. ] looking for at C:.docker I0513 16:22:05. ] looking for .dockercfg at C:varlibkubelet.dockercfg I0513 16:22:05. ] looking for .dockercfg at C:k.dockercfg I0513 16:22:05. ] looking for .dockercfg at C:k.dockercfg I0513 16:22:05. ] looking for .dockercfg at C:.dockercfg I0513 16:22:05. ] Unable to parse Docker config file: couldn't find valid .dockercfg after checking in [/var/lib/kubelet /] So, basically, I just had to copy the file to one of those locations. [1] [2] [3]
Yes, %HOMEDRIVE%+%HOMEPATH% is the right profile path: HOMEDRIVE=C: HOMEPATH=UsersAdministrator
Hm, keep in mind that you're trying to run the Kubelet as a service, under the ` (probably).
sure, just to show the name of environment variables
this has a PR open, so adding /milestone v1.15

Discussion:
preferredPathLock sync.Mutex preferredPath     = "" workingDirPath    = "" <del> homeDirPath       = os.Getenv("HOME") </del> <ins> homeDirPath, _    = os.UserHomeDir() </ins> rootDirPath       = "/" homeJsonDirPath   = filepath.Join(homeDirPath, ".docker") rootJsonDirPath   = filepath.Join(rootDirPath, ".docker")