Skip to content
This repository has been archived by the owner on Mar 27, 2021. It is now read-only.

Run Ragios on a Kubernetes Cluster

Obi Akubue edited this page Jul 16, 2019 · 12 revisions

Requirements

  • Git
  • A Kubernetes Cluster
  • Kubectl (Kubernetes client)

This will work with any Kubernetes Cluster, but I recommend the DigitalOcean's Kubernetes Service https://www.digitalocean.com/products/kubernetes/, because it is cheap, easy to use and great for side-projects.

Steps

Download Ragios

  • Clone the Ragios Repo
git clone git@github.com:obi-a/ragios.git
  • Switch to the directory of the cloned repo
cd ragios

Create the Cluster and Namespace

  • Create a Kubernetes cluster (If you are using DigitalOcean, simply create a kubernetes cluster and download the config file for the cluster)
  • Skip this if you are already familiar with Kubernetes. Set the KUBECONFIG environment variable to point to the cluster config file you downloaded.
export KUBECONFIG=/dir/of/the/config/file.yaml
  • Create a Ragios namespace on the Cluster
kubectl apply -f kubernetes-manifests/ragios-namespace.yaml

Add Ragios and CouchDB Credentials

  • Add a Ragios Web Dashboard username and password as a Kubernetes secret, insert your username and password in the command below and run it to create the secret
kubectl create secret generic ragios-secret \
--from-literal=username='<INSERT USERNAME>' \
--from-literal=password='<INSERT PASSWORD>' \
--namespace='ragios'

Note the username and password you used here because you will use it later to login into the Ragios Web Dashboard later.

  • Add a CouchDB username and password as a kubernetes secret, insert your username and password in the command below and run it
kubectl create secret generic couchdb-secret \
--from-literal=username='<INSERT USERNAME>' \
--from-literal=password='<INSERT USERNAME>' \
--namespace='ragios'

Apply Ragios on the Kubernetes cluster

kubectl apply -f kubernetes-manifests/
kubectl apply -k ./kubernetes-manifests/base
kubectl apply -k ./kubernetes-manifests/overlays

The above commands will install Ragios and all its services on the Cluster. We are using Kustomize so you can make configuration adjustments to Ragios by adding additional overlays.

  • Check and wait for the pods to start running
kubectl get pods -n ragios

When it is running the results of the above command should look like this below:

NAME                              READY   STATUS      RESTARTS   AGE
couchdb-0                         1/1     Running     0          82s
database-setup-lwtw6              0/1     Completed   0          82s
events-8fbf9c5c8-bb2ws            1/1     Running     0          85s
notifications-c846b7889-hlclv     1/1     Running     0          85s
recurring-jobs-79959878d4-wqg7q   1/1     Running     0          84s
web-67cf9d8854-h6sgs              1/1     Running     0          69s
workers-9b845d8ff-97tnh           1/1     Running     1          68s 
  • Pull the Ragios web service
kubectl get svc web -n ragios

The result should look like this below:

NAME   TYPE           CLUSTER-IP       EXTERNAL-IP     PORT(S)        AGE
web    LoadBalancer   10.245.164.208   139.59.196.50   80:31290/TCP   4m57s

From the result, copy the EXTERNAL-IP address and paste it on your web browser, it will load the Ragios Web Dashboard running on the cluster.

  • Use the username and password you previously added as a Kubernetes secret to login into Ragios Web Dashboard and now you are all set. See documentation for using the Ragios Web Dashboard.