Skip to content

Deployment with Kubernetes

This tutorial explains how to deploy our demo site Luna (see quick start guide) to Kubernetes using a Digital Ocean Managed Kubernetes cluster.

Notice

Setting up WebSight CMS on Digital Ocean via the steps presented in this tutorial will incur Digital Ocean hosting costs of approximately 2 dollars per day.

Prerequisites

To complete this tutorial, you will also need:

Step 1: Kubernetes cluster configuration

At the moment of writing this tutorial, Digital Ocean does not support persistent volumes with ReadWriteMany access mode. For simplicity's sake, we create a single node Kubernetes cluster to work with ReadWriteOnce access mode.

  1. Start by Authenticating doctl with an API token. Set API token scopes as follows: Read and Write
  2. Create a Kubernetes cluster using the Control Panel with the following options:
    • scaling type: Fixed size
    • machine type: Basic nodes
    • node plan: Professional plans 8 GB RAM / 4 vCPUs
    • nodes: 1
  3. Configure your kubectl context for the new cluster

Step 2: Project configuration

  1. Set up an NGINX Ingress Controller
  2. Create a values.yml file with the following content:

    nginx:
        replicas: 1
        host: <YOUR_CLUSTER_IP>.nip.io
    
    ingress:
        enabled: true
        hosts:
            cms: "cms.<YOUR_CLUSTER_IP>.nip.io"
            sites: 
              - "luna.<YOUR_CLUSTER_IP>.nip.io"
    
    - YOUR_CLUSTER_IP - replace with Digital Ocean Load Balancer IP (you can obtain it by running doctl compute load-balancer list)

    See WebSight Helm chart documentation for more details.

Step 3: CMS Deployment

  1. Run:
    helm upgrade --install websight-cms websight-cms \
        --repo https://websight-io.github.io/charts \
        --namespace websight-cms --create-namespace \
        -f values.yaml
    
    It may take a couple of minutes to finish.

Step 4: Verification

  1. Check the Kubernetes Dashboard to verify that all pods are running.
  2. Open the WebSight CMS admin panel on http://cms.<YOUR_CLUSTER_IP>.nip.io/ (SSL is not covered in this guide). Use the credentials wsadmin/wsadmin to log in.
  3. Publish some Luna pages (see Publish demo site guide for help).
  4. Open http://luna.<YOUR_CLUSTER_IP>.nip.io/ to see the demo page.

Cleanup

  1. When finished, you can delete your Kubernetes cluster along with the Load Balancer and volumes.