Docker has a mechanism for retrieving Docker registry passwords from a remote store, instead of just storing them in a config file - this mechanism is called a Credentials Store. It has a similar mechanism that are used to retrieve a password for a specific registry called Credential Helpers.
Basically, it involves defining a value in ~/.docker/config.json
that is interpreted as the name of an executable.
{
"credsStore": "osxkeychain"
}
The value of the credsStore
key has a prefix docker-credential-
pre-pended to it and if that executable (e.g. docker-credential-osxkeychain
) exists on the path then it will be executed and is expected to echo the username and password to stdout
, which Docker will use to log in to a private registry. The idea is that the executable reaches out to a store and retrieves your password for you, so you don't have to have lots of files laying around in your cluster with your username/password encoded in them.
I can't get a Kubernetes kubelet to make use of this credential store. It seems to just ignore it and when Kubernetes attempts to download from a private registry I get a "no basic auth credentials" error. If I just have a config.json
with the username / password in it then kubelet works ok.
Does Kubernetes support Docker credential stores/credential helpers and if so, how do I get them to work?
For reference, kubelet is running through systemd
, the credential store executable is on the path and the config.json
file is being read.