-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathsecrets.yaml
36 lines (33 loc) · 1.46 KB
/
secrets.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
# By Sharon Campbell, Ken Simon, and Joe Beda for Heptio
# You can generate the Secret object on your Kubernetes cluster directly, which is more secure
# Use "kubectl create secret generic ..." and provide keys and values
# Or you can generate the encoded values manually and add them to a file like this one
# See https://kubernetes.io/docs/concepts/configuration/secret/#creating-a-secret-using-kubectl-create-secret
# Secrets in this file are referenced throughout our application as environment variables
# The plain text values in the comments are included for the demo
# Do not include the plain text values in a production environment
apiVersion: v1
# https://kubernetes.io/docs/concepts/configuration/secret/
kind: Secret
# Other Kubernetes objects in the cluster can reference values from our Secret
# using name: mysql-credentials and key: <somekey>, like key: user
metadata:
name: mysql-credentials
labels:
"heptio.com/example": lamp
type: Opaque
# Encode secrets exactly like this from your command line
# if you use a different command, you will run into errors with newlines
data:
# root password for MySQL
# the actual password is varMyRootPass
# echo -n varMyRootPass | base64
rootpw: dmFyTXlSb290UGFzcw==
# user for MySQL
# the actual username is varMyDBUser
# echo -n varMyDBUser | base64
user: dmFyTXlEQlVzZXI=
# password for the second MySQL user
# the actual password is varMyDBPass
# echo -n varMyDBPass | base64
password: dmFyTXlEQlBhc3M=