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:
- A Digital Ocean account
- The Digital Ocean CLI installed
kubectl
installed (if you use Docker Desktop,kubectl
should already be installed)helm
installed
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.
- Start by Authenticating
doctl
with an API token. Set API token scopes as follows:Read
andWrite
- 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
- scaling type:
- Configure your
kubectl
context for the new cluster
Step 2: Project configuration
- Set up an NGINX Ingress Controller
-
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 runningdoctl compute load-balancer list
)See WebSight Helm chart documentation for more details.
Step 3: CMS Deployment
- Run: It may take a couple of minutes to finish.
Step 4: Verification
- Check the Kubernetes Dashboard to verify that all pods are running.
- Open the WebSight CMS admin panel on
http://cms.<YOUR_CLUSTER_IP>.nip.io/
(SSL is not covered in this guide). Use the credentialswsadmin
/wsadmin
to log in. - Publish some Luna pages (see Publish demo site guide for help).
- Open
http://luna.<YOUR_CLUSTER_IP>.nip.io/
to see the demo page.
Cleanup
- When finished, you can delete your Kubernetes cluster along with the Load Balancer and volumes.