auth.md
February 22, 2023 ยท View on GitHub
Authentication Via Environment Variables
kp can also use following environment variables for registry authentication:
KP_REGISTRY_HOSTNAMEto specify registry URL (e.g. gcr.io, docker.io, my-harbor-instance.net)KP_REGISTRY_USERNAMEto specify registry usernameKP_REGISTRY_PASSWORDto specify registry password
Since you may need to provide multiple registry credentials, you may use the above environment variables multiple times with a suffix of _N where N is a positive integer. Use same suffix for registry URL, username and password.
Example
$ KP_REGISTRY_HOSTNAME_1=gcr.io \
KP_REGISTRY_USERNAME_1=pat \
KP_REGISTRY_PASSWORD_1=p4ssw0rd \
KP_REGISTRY_HOSTNAME_2=docker.io \
KP_REGISTRY_USERNAME_2=sam \
KP_REGISTRY_PASSWORD_2=s3cret \
kp import -f descriptor.yaml
Credentials provided by these environment variables will be used first when authenticating against a given registry. If those credentials fail, the credentials provided in your ~/.docker/config.json will be used.
Affected kp commands
The following kp commands can utilize environment variables for registry authentication:
kp clusterstack createkp clusterstack patchkp clusterstack savekp clusterstore addkp clusterstore createkp clusterstore savekp lifecycle patchkp image createkp image patchkp image savekp import