Merge pull request #492 from joonathan/patch-1

Use `echo -n` for less ambiguous base64 secret example
This commit is contained in:
johndmulhausen
2016-05-31 16:32:03 -07:00
+9 -9
View File
@@ -94,10 +94,10 @@ in json or yaml format, and then create that object.
Each item must be base64 encoded: Each item must be base64 encoded:
```shell ```shell
$ echo "admin" | base64 $ echo -n "admin" | base64
YWRtaW4K YWRtaW4=
$ echo "1f2d1e2e67df" | base64 $ echo -n "1f2d1e2e67df" | base64
MWYyZDFlMmU2N2RmCg== MWYyZDFlMmU2N2Rm
``` ```
Now write a secret object that looks like this: Now write a secret object that looks like this:
@@ -109,8 +109,8 @@ metadata:
name: mysecret name: mysecret
type: Opaque type: Opaque
data: data:
password: MWYyZDFlMmU2N2RmCg== password: MWYyZDFlMmU2N2Rm
username: YWRtaW4K username: YWRtaW4=
``` ```
The data field is a map. Its keys must match The data field is a map. Its keys must match
@@ -138,8 +138,8 @@ Get back the secret created in the previous section:
$ kubectl get secret mysecret -o yaml $ kubectl get secret mysecret -o yaml
apiVersion: v1 apiVersion: v1
data: data:
password: MWYyZDFlMmU2N2RmCg== password: MWYyZDFlMmU2N2Rm
username: YWRtaW4K username: YWRtaW4=
kind: Secret kind: Secret
metadata: metadata:
creationTimestamp: 2016-01-22T18:41:56Z creationTimestamp: 2016-01-22T18:41:56Z
@@ -154,7 +154,7 @@ type: Opaque
Decode the password field: Decode the password field:
```shell ```shell
$ echo "MWYyZDFlMmU2N2RmCg==" | base64 -D $ echo "MWYyZDFlMmU2N2Rm" | base64 -D
1f2d1e2e67df 1f2d1e2e67df
``` ```