Skip to content

Latest commit

 

History

History
82 lines (61 loc) · 2.02 KB

README.md

File metadata and controls

82 lines (61 loc) · 2.02 KB

Ghost

This demonstration uses kustomize to deploy ghost to OpenShift.

Steps

  1. Install kustomize
$ brew install kustomize
  1. Login to your cluster using oc.

  2. Generate a randomized password

$ ENV_PASS=$(openssl rand -hex 10)
$ echo ${ENV_PASS}

Note, save the output...

  1. Generate the working url for the cluster/ghost app.
$ export WEB_DOMAIN=https://web-route-ghost.$(oc get ingress.config.openshift.io cluster -o yaml | grep domain | awk '{print $NF}')
$ echo ${WEB_DOMAIN}
  1. Create the secret for the database
$ cat deploy/secrets/01_db_secret.yml | sed "s|ENV_PASS|${ENV_PASS}|" | oc apply -f -
  1. Create the configmap for the Ghost app URL.
$ cat deploy/secrets/02_web_cm.yml | sed "s|WEB_DOMAIN|${WEB_DOMAIN}|" | oc apply -f -
  1. Create the deployment for the website
$ oc apply -k overlays/dev
namespace/ghost configured
service/db-service unchanged
service/web unchanged
persistentvolumeclaim/db-pvc unchanged
persistentvolumeclaim/web-content unchanged
deployment.apps/ghost-db unchanged
deployment.apps/web unchanged
route.route.openshift.io/web-route unchanged
  1. To clean it up you can run...
$ oc delete -k overlays/dev
namespace "ghost" deleted
service "db-service" deleted
service "web" deleted
persistentvolumeclaim "db-pvc" deleted
persistentvolumeclaim "web-content" deleted
deployment.apps "ghost-db" deleted
deployment.apps "web" deleted
route.route.openshift.io "web-route" deleted
  1. To see your website URL, you can grab the config map.
$ oc get cm -o yaml
  1. Navigate to the URL, such as https://web-route-ghost.apps.xyz.zzz.zyz.com/ghost/ to start setting up your site.

References

  1. https://elixm.com/how-to-deploy-ghost-blog-with-kubernetes/
  2. https://hub.docker.com/_/ghost
  3. https://hub.docker.com/_/mysql
  4. https://github.com/openshift-cs/ghost-example/blob/master/ghost_template.yaml