From 8a6c8e59ae199b59624fce02ffe8fff4a8e5a3a6 Mon Sep 17 00:00:00 2001 From: Cedric Girard Date: Wed, 8 Jan 2020 11:31:46 +0100 Subject: [PATCH] lab2: add yaml for secret --- 02_wordpress/yaml/06_secret.yaml | 11 ++++++++++ 02_wordpress/yaml/07_deployment.yaml | 31 ++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 02_wordpress/yaml/06_secret.yaml create mode 100644 02_wordpress/yaml/07_deployment.yaml diff --git a/02_wordpress/yaml/06_secret.yaml b/02_wordpress/yaml/06_secret.yaml new file mode 100644 index 0000000..9c8d482 --- /dev/null +++ b/02_wordpress/yaml/06_secret.yaml @@ -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: diff --git a/02_wordpress/yaml/07_deployment.yaml b/02_wordpress/yaml/07_deployment.yaml new file mode 100644 index 0000000..4f01b95 --- /dev/null +++ b/02_wordpress/yaml/07_deployment.yaml @@ -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: