lab2: add yaml for secret
This commit is contained in:
parent
50a85f8c24
commit
8a6c8e59ae
2 changed files with 42 additions and 0 deletions
11
02_wordpress/yaml/06_secret.yaml
Normal file
11
02_wordpress/yaml/06_secret.yaml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
data:
|
||||||
|
mysql_password: c2VjdXJlcGFzc3dvcmQ=
|
||||||
|
mysql_user: cm9vdA==
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: mysql-creds
|
||||||
|
type: Opaque
|
||||||
|
|
||||||
|
# vim: set ts=2 sw=2 et:
|
31
02_wordpress/yaml/07_deployment.yaml
Normal file
31
02_wordpress/yaml/07_deployment.yaml
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: mysql
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: mysql
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: mysql
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: mysql
|
||||||
|
image: mariadb:10
|
||||||
|
ports:
|
||||||
|
- containerPort: 3306
|
||||||
|
env:
|
||||||
|
- name: MYSQL_ROOT_PASSWORD
|
||||||
|
value: securepassword
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mysql-creds
|
||||||
|
key: mysql_password
|
||||||
|
- name: MYSQL_DATABASE
|
||||||
|
value: wordpress
|
||||||
|
|
||||||
|
# vim: set ts=2 sw=2 et:
|
Loading…
Reference in a new issue