aboutsummaryrefslogtreecommitdiffstats
path: root/moonv4/kubernetes/templates
diff options
context:
space:
mode:
Diffstat (limited to 'moonv4/kubernetes/templates')
-rw-r--r--moonv4/kubernetes/templates/consul.yaml33
-rw-r--r--moonv4/kubernetes/templates/db.yaml82
-rw-r--r--moonv4/kubernetes/templates/keystone.yaml34
-rw-r--r--moonv4/kubernetes/templates/moon_configuration.yaml23
-rw-r--r--moonv4/kubernetes/templates/moon_gui.yaml33
-rw-r--r--moonv4/kubernetes/templates/moon_manager.yaml33
-rw-r--r--moonv4/kubernetes/templates/moon_orchestrator.yaml40
7 files changed, 278 insertions, 0 deletions
diff --git a/moonv4/kubernetes/templates/consul.yaml b/moonv4/kubernetes/templates/consul.yaml
new file mode 100644
index 00000000..f0fb764e
--- /dev/null
+++ b/moonv4/kubernetes/templates/consul.yaml
@@ -0,0 +1,33 @@
+apiVersion: apps/v1beta1
+kind: Deployment
+metadata:
+ namespace: moon
+ name: consul
+spec:
+ replicas: 1
+ template:
+ metadata:
+ labels:
+ app: consul
+ spec:
+ hostname: consul
+ containers:
+ - name: consul
+ image: consul:latest
+ ports:
+ - containerPort: 8500
+---
+
+apiVersion: v1
+kind: Service
+metadata:
+ name: consul
+ namespace: moon
+spec:
+ ports:
+ - port: 8500
+ targetPort: 8500
+ nodePort: 30005
+ selector:
+ app: consul
+ type: NodePort
diff --git a/moonv4/kubernetes/templates/db.yaml b/moonv4/kubernetes/templates/db.yaml
new file mode 100644
index 00000000..0a62c077
--- /dev/null
+++ b/moonv4/kubernetes/templates/db.yaml
@@ -0,0 +1,82 @@
+#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:
+ 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:
+ name: db
+spec:
+ ports:
+ - port: 3306
+ selector:
+ app: db
+--- \ No newline at end of file
diff --git a/moonv4/kubernetes/templates/keystone.yaml b/moonv4/kubernetes/templates/keystone.yaml
new file mode 100644
index 00000000..84a51f7a
--- /dev/null
+++ b/moonv4/kubernetes/templates/keystone.yaml
@@ -0,0 +1,34 @@
+apiVersion: apps/v1beta1
+kind: Deployment
+metadata:
+ namespace: moon
+ name: keystone
+spec:
+ replicas: 1
+ template:
+ metadata:
+ labels:
+ app: keystone
+ spec:
+ hostname: keystone
+ containers:
+ - name: keystone
+ image: asteroide/keystone:mitaka
+ ports:
+ - containerPort: 35357
+ containerPort: 5000
+---
+
+apiVersion: v1
+kind: Service
+metadata:
+ name: keystone
+ namespace: moon
+spec:
+ ports:
+ - port: 5000
+ targetPort: 5000
+ nodePort: 30006
+ selector:
+ app: keystone
+ type: NodePort
diff --git a/moonv4/kubernetes/templates/moon_configuration.yaml b/moonv4/kubernetes/templates/moon_configuration.yaml
new file mode 100644
index 00000000..f3816932
--- /dev/null
+++ b/moonv4/kubernetes/templates/moon_configuration.yaml
@@ -0,0 +1,23 @@
+apiVersion: batch/v1
+kind: Job
+metadata:
+ name: moonforming
+ namespace: moon
+spec:
+ template:
+ metadata:
+ name: moonforming
+ spec:
+ containers:
+ - name: moonforming
+ image: asteroide/moonforming:v1.1
+ imagePullPolicy: Always
+ volumeMounts:
+ - name: config-volume
+ mountPath: /etc/moon
+ volumes:
+ - name: config-volume
+ configMap:
+ name: moon-config
+ restartPolicy: Never
+ #backoffLimit: 4 \ No newline at end of file
diff --git a/moonv4/kubernetes/templates/moon_gui.yaml b/moonv4/kubernetes/templates/moon_gui.yaml
new file mode 100644
index 00000000..732a3ce1
--- /dev/null
+++ b/moonv4/kubernetes/templates/moon_gui.yaml
@@ -0,0 +1,33 @@
+apiVersion: apps/v1beta1
+kind: Deployment
+metadata:
+ namespace: moon
+ name: gui
+spec:
+ replicas: 1
+ template:
+ metadata:
+ labels:
+ app: gui
+ spec:
+ hostname: gui
+ containers:
+ - name: gui
+ image: wukongsun/moon_gui:v4.1
+ ports:
+ - containerPort: 80
+---
+
+apiVersion: v1
+kind: Service
+metadata:
+ name: gui
+ namespace: moon
+spec:
+ ports:
+ - port: 80
+ targetPort: 80
+ nodePort: 30002
+ selector:
+ app: gui
+ type: NodePort
diff --git a/moonv4/kubernetes/templates/moon_manager.yaml b/moonv4/kubernetes/templates/moon_manager.yaml
new file mode 100644
index 00000000..9c3772d1
--- /dev/null
+++ b/moonv4/kubernetes/templates/moon_manager.yaml
@@ -0,0 +1,33 @@
+apiVersion: apps/v1beta1
+kind: Deployment
+metadata:
+ name: manager
+ namespace: moon
+spec:
+ replicas: 3
+ template:
+ metadata:
+ labels:
+ app: manager
+ spec:
+ hostname: manager
+ containers:
+ - name: manager
+ image: wukongsun/moon_manager:v4.3
+ ports:
+ - containerPort: 8082
+---
+
+apiVersion: v1
+kind: Service
+metadata:
+ name: manager
+ namespace: moon
+spec:
+ ports:
+ - port: 8082
+ targetPort: 8082
+ nodePort: 30001
+ selector:
+ app: manager
+ type: NodePort
diff --git a/moonv4/kubernetes/templates/moon_orchestrator.yaml b/moonv4/kubernetes/templates/moon_orchestrator.yaml
new file mode 100644
index 00000000..419f2d52
--- /dev/null
+++ b/moonv4/kubernetes/templates/moon_orchestrator.yaml
@@ -0,0 +1,40 @@
+apiVersion: apps/v1beta1
+kind: Deployment
+metadata:
+ namespace: moon
+ name: orchestrator
+spec:
+ replicas: 1
+ template:
+ metadata:
+ labels:
+ app: orchestrator
+ spec:
+ hostname: orchestrator
+ containers:
+ - name: orchestrator
+ image: wukongsun/moon_orchestrator:v4.3
+ ports:
+ - containerPort: 8083
+ volumeMounts:
+ - name: config-volume
+ mountPath: /root/.kube
+ volumes:
+ - name: config-volume
+ configMap:
+ name: config
+---
+
+apiVersion: v1
+kind: Service
+metadata:
+ name: orchestrator
+ namespace: moon
+spec:
+ ports:
+ - port: 8083
+ targetPort: 8083
+ nodePort: 30003
+ selector:
+ app: orchestrator
+ type: NodePort