aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/templates/db.yaml
diff options
context:
space:
mode:
authorWuKong <rebirthmonkey@gmail.com>2017-12-23 21:49:35 +0100
committerWuKong <rebirthmonkey@gmail.com>2017-12-23 21:49:58 +0100
commit1100c66ce03a059ebe7ece9734e799b49b3a5a9e (patch)
treea057e7e7511f6675a9327b79e6919f07c5f89f07 /kubernetes/templates/db.yaml
parent7a4dfdde6314476ae2a1a1c881ff1e3c430f790e (diff)
moonv4 cleanup
Change-Id: Icef927f3236d985ac13ff7376f6ce6314b2b39b0 Signed-off-by: WuKong <rebirthmonkey@gmail.com>
Diffstat (limited to 'kubernetes/templates/db.yaml')
-rw-r--r--kubernetes/templates/db.yaml84
1 files changed, 84 insertions, 0 deletions
diff --git a/kubernetes/templates/db.yaml b/kubernetes/templates/db.yaml
new file mode 100644
index 00000000..38418643
--- /dev/null
+++ b/kubernetes/templates/db.yaml
@@ -0,0 +1,84 @@
+#apiVersion: v1
+#kind: PersistentVolume
+#metadata:
+# name: local-pv-1
+# labels:
+# type: local
+#spec:
+# capacity:
+# storage: 5Gi
+# accessModes:
+# - ReadWriteOnce
+# hostPath:
+# path: /tmp/data/pv-1
+#---
+#
+#apiVersion: v1
+#kind: PersistentVolumeClaim
+#metadata:
+# name: mysql-pv-claim
+# labels:
+# platform: moon
+# app: db
+#spec:
+# accessModes:
+# - ReadWriteOnce
+# resources:
+# requests:
+# storage: 5Gi
+#---
+
+apiVersion: apps/v1beta1
+kind: Deployment
+metadata:
+ namespace: moon
+ name: db
+spec:
+ replicas: 1
+ strategy:
+ type: Recreate
+ template:
+ metadata:
+ labels:
+ app: db
+ spec:
+ containers:
+ - name: db
+ image: mysql:latest
+ env:
+ - name: MYSQL_DATABASE
+ value: "moon"
+ - name: MYSQL_USER
+ value: "moon"
+ - name: MYSQL_PASSWORD
+ valueFrom:
+ secretKeyRef:
+ name: mysql-pass
+ key: password_moon.txt
+ - name: MYSQL_ROOT_PASSWORD
+ valueFrom:
+ secretKeyRef:
+ name: mysql-root-pass
+ key: password_root.txt
+ ports:
+ - containerPort: 3306
+ name: mysql
+# volumeMounts:
+# - name: mysql-persistent-storage
+# mountPath: /var/lib/mysql
+# volumes:
+# - name: mysql-persistent-storage
+# persistentVolumeClaim:
+# claimName: mysql-pv-claim
+---
+apiVersion: v1
+kind: Service
+metadata:
+ namespace: moon
+ name: db
+spec:
+ ports:
+ - port: 3306
+ selector:
+ app: db
+--- \ No newline at end of file