Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
a9a65e70
Commit
a9a65e70
authored
Jan 30, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #20371 from pmorie/secrets-dotfiles-docs
Auto commit by PR queue bot
parents
4ed43968
c2063833
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
+62
-0
secrets.md
docs/user-guide/secrets.md
+62
-0
No files found.
docs/user-guide/secrets.md
View file @
a9a65e70
...
...
@@ -57,6 +57,7 @@ a docker image. See [Secrets design document](../design/secrets.md) for more inf
-
[
Use cases
](
#use-cases
)
-
[
Use-Case: Pod with ssh keys
](
#use-case-pod-with-ssh-keys
)
-
[
Use-Case: Pods with prod / test credentials
](
#use-case-pods-with-prod--test-credentials
)
-
[
Use-case: Dotfiles in secret volume
](
#use-case-dotfiles-in-secret-volume
)
-
[
Use-case: Secret visible to one container in a pod
](
#use-case-secret-visible-to-one-container-in-a-pod
)
-
[
Security Properties
](
#security-properties
)
-
[
Protections
](
#protections
)
...
...
@@ -473,6 +474,67 @@ one called, say, `prod-user` with the `prod-db-secret`, and one called, say,
}
```
### Use-case: Dotfiles in secret volume
In order to make piece of data 'hidden' (ie, in a file whose name begins with a dot character), simply
make that key begin with a dot. For example, when the following secret secret is mounted into a volume:
```
json
{
"kind"
:
"Secret"
,
"apiVersion"
:
"v1"
,
"metadata"
:
{
"name"
:
"dotfile-secret"
},
"data"
:
{
".secret-file"
:
"dmFsdWUtMg0KDQo="
,
}
}
{
"kind"
:
"Pod"
,
"apiVersion"
:
"v1"
,
"metadata"
:
{
"name"
:
"secret-dotfiles-pod"
,
},
"spec"
:
{
"volumes"
:
[
{
"name"
:
"secret-volume"
,
"secret"
:
{
"secretName"
:
"dotfile-secret"
}
}
],
"containers"
:
[
{
"name"
:
"dotfile-test-container"
,
"image"
:
"gcr.io/google_containers/busybox"
,
"command"
:
"ls -l /etc/secret-volume"
"volumeMounts"
:
[
{
"name"
:
"secret-volume"
,
"readOnly"
:
true
,
"mountPath"
:
"/etc/secret-volume"
}
]
}
]
}
}
```
The
`secret-volume`
will contain a single file, called
`.secret-file`
, and
the
`dotfile-test-container`
will have this file present at the path
`/etc/secret-volume/.secret-file`
.
**NOTE**
Files beginning with dot characters are hidden from the output of
`ls -l`
;
you must use
`ls -la`
to see them when listing directory contents.
### Use-case: Secret visible to one container in a pod
<a
name=
"use-case-two-containers"
></a>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment