Skip to content
This repository was archived by the owner on Jul 26, 2022. It is now read-only.

Commit d04cf1d

Browse files
author
Silas Boyd-Wickizer
authored
docs(frontends): propose a volume-based "frontend" (#91)
Propose and document an API for writing secret data to volumes. See: #78
1 parent fd256d7 commit d04cf1d

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

api.md

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Kubernetes External Secrets Storage Frontends
2+
3+
Kubernetes External Secrets supports several "frontends" for storing
4+
secret data and presenting it to applications:
5+
6+
* [Secret frontend](#secret-frontend)
7+
* [Volume frontend](#volume-frontend)
8+
9+
## Secret frontend
10+
11+
TODO.
12+
13+
## Volume frontend
14+
15+
The volume frontend writes secret data to volumes included in `Pod`
16+
specs. The volume frontend implements a behavior analogous to the
17+
secret volume type. You specify `ExternalSecret` objects to use as
18+
volumes and the External Secret controller creates files containing
19+
secret data.
20+
21+
To emulate an "externalSecret" volume type, you configure which
22+
volumes the External Secret controller writes data to by adding the
23+
`externalsecrets.kubernetes-client.io/volumes` annotation to a `Pod`
24+
manifest". With the manifest below, the External Secret controller
25+
should:
26+
27+
* create password and username files in the db-secrets volume;
28+
* fetch the value of db/password from AWS Secrets Manager and write
29+
that value to password file in the db-secrets volume;
30+
* fetch the value of db/username from AWS Secrets Manager and write
31+
that value to the username file in the db-secrets volume;
32+
* create a key file in the client-secrets volume; and
33+
* fetch the value of api/key from AWS Secrets Manager and write that
34+
values to the api file in the client-secrets volume.
35+
36+
```yaml
37+
apiVersion: v1
38+
kind: Pod
39+
metadata:
40+
generateName: pod-example-
41+
annotations:
42+
externalsecrets.kubernetes-client.io/volumes: |
43+
- name: "db-secrets"
44+
externalSecret:
45+
externalSecretName: "db-secrets"
46+
- name: "client-secrets"
47+
externalSecret:
48+
externalSecretName: "client-secrets"
49+
spec:
50+
containers:
51+
- image: busybox
52+
name: busybox
53+
volumeMounts:
54+
- mountPath: /db-secrets
55+
name: db-secrets
56+
- mountPath: /client-secrets
57+
name: client-secrets
58+
volumes:
59+
- name: db-secrets
60+
emptyDir:
61+
medium: Memory
62+
- name: client-secrets
63+
emptyDir:
64+
medium: Memory
65+
---
66+
apiVersion: 'kubernetes-client.io/v1'
67+
kind: ExternalSecret
68+
metadata:
69+
name: db-secrets
70+
secretDescriptor:
71+
backendType: secretsManager
72+
data:
73+
- key: db/password
74+
name: password
75+
- key: db/username
76+
name: username
77+
---
78+
apiVersion: 'kubernetes-client.io/v1'
79+
kind: ExternalSecret
80+
metadata:
81+
name: client-secrets
82+
secretDescriptor:
83+
backendType: secretsManager
84+
data:
85+
- key: api/key
86+
name: key
87+
```
88+
89+
The value of `externalsecrets.kubernetes-client.io/volumes` is a JSON or
90+
YAML serialized array of volume configuration objects:
91+
92+
|Property|Type|Description|
93+
|--------|----|-----------|
94+
|`name`|string|Name of volume to write secret data to|
95+
|`externalSecretName`|string|Name of ExternalSecret to get secret data from|
96+
97+
You can configure any [type of
98+
volume](https://kubernetes.io/docs/concepts/storage/volumes/#types-of-volumes)
99+
to hold secret data. To avoid storing secret data on disk,
100+
use an
101+
[`emptyDir`](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir)
102+
volume and set `emptyDir.medium` field to `"Memory"`.

0 commit comments

Comments
 (0)