-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsecret-generator.yaml
75 lines (66 loc) · 2.54 KB
/
secret-generator.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
apiVersion: secretize/v1
kind: SecretGenerator
metadata:
name: my-app-secrets # this will be the generated secret name
labels:
app: my-app # labels are added to the generated secret
sources:
- provider: aws-sm
literals:
# Fetches a single secret as string
- mySecret
# Set the generated key name explicitly
- explicitName=anotherSecret
kv:
# Tries to parse a secret as JSON. Example:
# aws secretsmanager create-secret --name myJsonSecret \
# --secret-string '{"secret_key_1":"secret_value_1", "secret_key_2": "secret_value_2"}'
- myJsonSecret
- provider: env
literals:
# Fetches a single variable as a string
- MY_LITERAL_SECRET
# Set the generated key name explicitly
- newName=MY_LITERAL_SECRET
kv:
# Tries to parse a variable as JSON. Example:
# export MY_KV_SECRET='{"secret_key_1":"secret_value_1", "secret_key_2": "secret_value_2"}'
- MY_KV_SECRET
- provider: azure-vault
params:
name: my-vault # Azure Vault name
literals:
# Fetches a single secret as string
- mySecret
# Set the generated key name explicitly
- explicitName=anotherSecret
kv:
# Tries to parse a secret as JSON. Example:
# az keyvault secret set --vault-name my-vault --name myJsonSecret \
# --value '{"secret_key_1":"secret_value_1", "secret_key_2": "secret_value_2"}'
- myJsonSecret
- provider: hashicorp-vault
literals:
# Fetches a single secret as string.
# Note the `:` separator - this is crucial to query the particular key in the Hashicorp Vault secret data.
- secret/data/mySecret:secret_key_1
# Set the generated key name explicitly
- explicitName=secret/data/mySecret:secret_key_1
kv:
# Fetch all secret data. Example:
# vault kv put secret/mySecret secret_key_1=secret_value_1 secret_key_2=secret_value_2
- secret/data/mySecret
- provider: k8s-secret
params:
namespace: default # Kubernetes namespace name of the original secret
literals:
# Fetches a single secret as string.
# Note the `:` separator - this is crucial to query the particular key in the K8S secret data.
- original-secret:secret_key_1
# Set the generated key name explicitly
- explicitName=original-secret:secret_key_1
kv:
# Fetch all secret data. Example:
# kubectl create secret generic original-secret \
# --from-literal=secret_key_1=secret_value_1 --from-literal=secret_key_2=secret_value_2
- original-secret