Improvements to ImagePullSecrets section of the images.md doc.

Add an example for .docker/config.json based Secret config. Also, some
other minor corrections.
This commit is contained in:
Madhusudan.C.S 2016-02-29 15:04:59 -08:00
parent 83d74dd952
commit 1f8367fce2

View File

@ -215,8 +215,8 @@ Kubernetes supports specifying registry keys on a pod.
Run the following command, substituting the appropriate uppercase values: Run the following command, substituting the appropriate uppercase values:
```console ```console
$ kubectl create secret docker-registry my-registry-secret --docker-server=DOCKER_REGISTRY_SERVER --docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD --docker-email=DOCKER_EMAIL $ kubectl create secret docker-registry myregistrykey --docker-server=DOCKER_REGISTRY_SERVER --docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD --docker-email=DOCKER_EMAIL
secret "my-registry-secret" created. secret "myregistrykey" created.
``` ```
If you need access to multiple registries, you can create one secret for each registry. If you need access to multiple registries, you can create one secret for each registry.
@ -239,6 +239,19 @@ Be sure to:
as the value for field `data[".dockerconfigjson"]` as the value for field `data[".dockerconfigjson"]`
- set `type` to `kubernetes.io/dockerconfigjson` - set `type` to `kubernetes.io/dockerconfigjson`
Example:
```yaml
apiVersion: v1
kind: Secret
metadata:
name: myregistrykey
namespace: awesomeapps
data:
.dockerconfigjson: UmVhbGx5IHJlYWxseSByZWVlZWVlZWVlZWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGx5eXl5eXl5eXl5eXl5eXl5eXl5eSBsbGxsbGxsbGxsbGxsbG9vb29vb29vb29vb29vb29vb29vb29vb29vb25ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubmdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2cgYXV0aCBrZXlzCg==
type: kubernetes.io/dockerconfigjson
```
If you get the error message `error: no objects passed to create`, it may mean the base64 encoded string is invalid. If you get the error message `error: no objects passed to create`, it may mean the base64 encoded string is invalid.
If you get an error message like `Secret "myregistrykey" is invalid: data[.dockerconfigjson]: invalid value ...` it means If you get an error message like `Secret "myregistrykey" is invalid: data[.dockerconfigjson]: invalid value ...` it means
the data was successfully un-base64 encoded, but could not be parsed as a `.docker/config.json` file. the data was successfully un-base64 encoded, but could not be parsed as a `.docker/config.json` file.
@ -253,6 +266,7 @@ apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
name: foo name: foo
namespace: awesomeapps
spec: spec:
containers: containers:
- name: foo - name: foo