From 3090f0c7ead5bc2beedf1d59d499205418e4d10f Mon Sep 17 00:00:00 2001 From: galal-hussein Date: Fri, 1 Apr 2016 02:13:15 +0200 Subject: [PATCH] Add Ghost Template --- kubernetes-templates/ghost/0/README.md | 5 +++ .../ghost/0/ghost-service.yaml | 14 +++++++ kubernetes-templates/ghost/0/ghost.yaml | 30 +++++++++++++ .../ghost/0/mysql-service.yaml | 11 +++++ kubernetes-templates/ghost/0/mysql.yaml | 36 ++++++++++++++++ .../ghost/0/rancher-compose.yml | 30 +++++++++++++ .../ghost/catalogIcon-ghost.svg | 42 +++++++++++++++++++ kubernetes-templates/ghost/config.yml | 4 ++ 8 files changed, 172 insertions(+) create mode 100644 kubernetes-templates/ghost/0/README.md create mode 100644 kubernetes-templates/ghost/0/ghost-service.yaml create mode 100644 kubernetes-templates/ghost/0/ghost.yaml create mode 100644 kubernetes-templates/ghost/0/mysql-service.yaml create mode 100644 kubernetes-templates/ghost/0/mysql.yaml create mode 100644 kubernetes-templates/ghost/0/rancher-compose.yml create mode 100644 kubernetes-templates/ghost/catalogIcon-ghost.svg create mode 100644 kubernetes-templates/ghost/config.yml diff --git a/kubernetes-templates/ghost/0/README.md b/kubernetes-templates/ghost/0/README.md new file mode 100644 index 0000000..46eb16d --- /dev/null +++ b/kubernetes-templates/ghost/0/README.md @@ -0,0 +1,5 @@ +# Ghost + +Ghost is a platform dedicated to one thing: Publishing. It's beautifully designed, completely customisable and completely Open Source. Ghost allows you to write and publish your own blog, giving you the tools to make it easy and even fun to do. + +This is a Ghost deployment on Kubernetes environment, using MySQL as backend store for the blogging paltform. diff --git a/kubernetes-templates/ghost/0/ghost-service.yaml b/kubernetes-templates/ghost/0/ghost-service.yaml new file mode 100644 index 0000000..8f11c17 --- /dev/null +++ b/kubernetes-templates/ghost/0/ghost-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + name: ghost-lb + name: ghost-lb +spec: + ports: + - port: 80 + targetPort: 2368 + selector: + name: ghost + app: ghost + type: LoadBalancer diff --git a/kubernetes-templates/ghost/0/ghost.yaml b/kubernetes-templates/ghost/0/ghost.yaml new file mode 100644 index 0000000..cf43d5a --- /dev/null +++ b/kubernetes-templates/ghost/0/ghost.yaml @@ -0,0 +1,30 @@ +apiVersion: v1 +kind: Pod +metadata: + name: ghost + labels: + name: ghost + app: ghost +spec: + restartPolicy: Always + containers: + - image: "husseingalal/ghost" + name: "ghost" + ports: + - containerPort: 2368 + name: ghost + env: + - name: GHOST_USER + value: ${ghost_db_user} + - name: GHOST_PASSWORD + value: ${ghost_db_pass} + - name: GHOST_DB + value: ${ghost_db} + - name: GHOST_URL + value: ${ghost_url} + volumeMounts: + - name: "ghost-ephemeral-storage" + mountPath: /var/lib/ghost + volumes: + - name: "ghost-ephemeral-storage" + emptyDir: {} diff --git a/kubernetes-templates/ghost/0/mysql-service.yaml b/kubernetes-templates/ghost/0/mysql-service.yaml new file mode 100644 index 0000000..f4338cc --- /dev/null +++ b/kubernetes-templates/ghost/0/mysql-service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + name: mysql + name: mysql +spec: + ports: + - port: 3306 + selector: + name: mysql diff --git a/kubernetes-templates/ghost/0/mysql.yaml b/kubernetes-templates/ghost/0/mysql.yaml new file mode 100644 index 0000000..8003c64 --- /dev/null +++ b/kubernetes-templates/ghost/0/mysql.yaml @@ -0,0 +1,36 @@ +apiVersion: v1 +kind: Pod +metadata: + name: mysql + labels: + name: mysql +spec: + containers: + - image: mysql + name: mysql + env: + - name: MYSQL_ROOT_PASSWORD + value: ${mysql_root_pass} + - name: MYSQL_DATABASE + value: ${ghost_db} + - name: MYSQL_USER + value: ${ghost_db_user} + - name: MYSQL_PASSWORD + value: ${ghost_db_pass} + ports: + - containerPort: 3306 + name: mysql + volumeMounts: + - name: mysql-vol + mountPath: /var/lib/mysql + livenessProbe: + tcpSocket: + port: "mysql" + initialDelaySeconds: 5 + timeoutSeconds: 1 + readinessProbe: + exec: + command: ["mysqladmin", "status", "-p${mysql_root_pass}"] + volumes: + - name: mysql-vol + emptyDir: {} diff --git a/kubernetes-templates/ghost/0/rancher-compose.yml b/kubernetes-templates/ghost/0/rancher-compose.yml new file mode 100644 index 0000000..59e429a --- /dev/null +++ b/kubernetes-templates/ghost/0/rancher-compose.yml @@ -0,0 +1,30 @@ +.catalog: + name: Ghost + version: 0.7.8-rancher1 + description: Open source publishing platform + questions: + - variable: "mysql_root_pass" + label: "MySQL root password" + required: true + type: "password" + - variable: "ghost_db" + label: "Ghost database name on mysql" + required: true + type: "string" + default: "ghost" + - variable: "ghost_db_user" + label: "Ghost database username" + required: true + type: "string" + default: "ghostuser" + - variable: "ghost_db_pass" + label: "Ghost database password" + required: true + type: "password" + default: "ghostpass" + description: "default password is ghostpass" + - variable: "ghost_url" + label: "Ghost url" + required: true + type: "string" + default: "http://example-ghost.com" diff --git a/kubernetes-templates/ghost/catalogIcon-ghost.svg b/kubernetes-templates/ghost/catalogIcon-ghost.svg new file mode 100644 index 0000000..44a4152 --- /dev/null +++ b/kubernetes-templates/ghost/catalogIcon-ghost.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kubernetes-templates/ghost/config.yml b/kubernetes-templates/ghost/config.yml new file mode 100644 index 0000000..db3892c --- /dev/null +++ b/kubernetes-templates/ghost/config.yml @@ -0,0 +1,4 @@ +name: Ghost +description: Open source publishing platform +version: 0.7.8-rancher1 +category: Blogging