Containerized deployments have become increasingly popular amongst our clients. We here at CloverDX maintain a Docker image for developers to use throughout their organizations. By leveraging our Docker repo along with a container management system (like Kubernetes) you gain the ability to easily spin up new instances of CloverDX Server and scale them as needed.
In this tutorial, we're going deploy several Docker containers within a Kubernetes pod on Google Cloud Platform using Google Kubernetes Engine (GKE).
What we need:
If you haven’t already done so, create a trial account for CloverDX. Log in using your CloverCARE credentials sent to your email. The log-in page can be found here: https://support.cloverdx.com
Once you're logged in, go to the "Downloads and Licenses" section using the button on the top bar.
Now we have everything we need to start working GCP!
After logging into your Google Cloud Project create new Google Cloud Project with a name of your choice.
Navigate to your new project in the Google Cloud Console.
PROJECT_ID
environment variable to your Google Cloud project ID
(PROJECT_ID
). You'll use this environment variable when you build the container image and push it to your repository.
export PROJECT_ID=<created project id> // e.g. cloverdx-123456
export REGION=<target region> // e.g. europe-west3
echo $PROJECT_ID $REGION
gcloud config set project $PROJECT_ID
Updated property [core/project].
$PROJECT_ID
—you will still see the Updated property output.gcloud artifacts repositories create hello-repo \
--repository-format=docker \
--location=$REGION \
--description="Docker repository"
Replace REGION with the a region for the repository, such as us-west1. To see a list of available locations, run the command:git clone https://github.com/cloverdx/cloverdx-server-docker.git
clover.war
and license.dat
files we got in previous steps into our cloverdx-server-docker
directory
cd cloverdx-server-docker
clover.war
and upload it.ls
and confirm that you see clover.war
in the current directory.license.dat
file. Move it into the examples/Kubernetes directory:cd examples/kubernetes
license.dat
file from your local computer to the shell cloud console using the same process as before.ls
license.dat
in the current directory.gcloud container clusters create hello-cluster --num-nodes=1 --region=$REGION
hello-cluster
in $REGION
(we set this variable in very first step in gcloud console) availability zone. It should take a few minutes of provisioning and then you should get a confirmation of it running that looks like this:gcloud container clusters get-credentials --region $REGION hello-cluster
./run.sh eu.gcr.io/$PROJECT
cloverdx
.To be able to access instance from the internet, you need to create load balancer which will proxy incoming traffic into your CloverDX GKS cluster.
Example project published on Github uses Gravitee Gateway to distribute HTTP calls to multiple applications and is set up to route traffic coming to port 8082. To route external calls coming from HTTP port (80) to exposed one (8082), run:kubectl expose deployment gravitee-gateway --name=internet-lb --type=LoadBalancer --port 80 --target-port 8082 --namespace=cloverdx
kubectl get service --namespace=cloverdx | grep internet-lb
<pending>
instead of an IP address. It usually takes just couple of seconds.We have now successfully provisioned and accessed our CloverDX Server instance running in a Kubernetes Pod on Google Cloud Platform. Be mindful about the fact, this is in no way production-grade deployment but rather an example of how to deploy CloverDX Server (or Cluster) in K8s.
To Shut down your Kubernetes Pod:kubectl delete --all pods --namespace=cloverdx
. To completely remove all resources created by this tutorial. You also need to remove K8s cluster and container repository!