Fix secret file mode bits example on JSON

I tested the example on YAML and, wrongly, asumed that JSON supported it too.

Fixes: https://github.com/kubernetes/kubernetes/issues/33162
reviewable/pr1280/r2
Rodrigo Campos 2016-09-21 19:17:06 -03:00
parent 7f8b65d3e0
commit 5319085101
1 changed files with 8 additions and 3 deletions

View File

@ -291,7 +291,7 @@ For example, you can specify a default mode like this:
"name": "foo",
"secret": {
"secretName": "mysecret",
"defaultMode": 0400
"defaultMode": 256
}
}]
}
@ -301,6 +301,10 @@ For example, you can specify a default mode like this:
Then, the secret will be mounted on `/etc/foo` and all the files created by the
secret volume mount will have permission `0400`.
Note that the JSON spec doesn't support octal notation, so use the value 256 for
0400 permissions. If you use yaml instead of json for the pod, you can use octal
notation to specify permissions in a more natural way.
You can also use mapping, as in the previous example, and specify different
permission for different files like this:
@ -328,7 +332,7 @@ permission for different files like this:
"items": [{
"key": "username",
"path": "my-group/my-username",
"mode": 0777
"mode": 511
}]
}
}]
@ -337,7 +341,8 @@ permission for different files like this:
```
In this case, the file resulting in `/etc/foo/my-group/my-username` will have
permission `0777`.
permission value of `0777`. Owing to JSON limitations, you must specify the mode
in decimal notation.
**Consuming Secret Values from Volumes**