Ontrack deployment in a Digital Ocean Kubernetes cluster
It's fairly easy to deploy Ontrack using Helm. However, while his may suitable for a demo or a test, for production, it might be better to use a managed database instead of pod running Postgres.
The Ontrack Helm chart allows some configuration values to point to an external database, and in this article, we'll use that option to deploy Ontrack into a Digital Ocean Kubernetes cluster and to use a Digital Ocean managed Postgres database.
Prerequisites
- Terraform 1.1
- A Digital Ocean cluster
- A Digital Ocean API token with read/write access
Deploying Ontrack
First, clone the https://github.com/nemerosa/ontrack-infra-do-k8s-tf repository locally:
git clone https://github.com/nemerosa/ontrack-infra-do-k8s-tf
cd ontrack-infra-do-k8s-tf
Create a terraform.tfvars
file at the root of the working copy with the following values:
# Digital Ocean token with read/write authorizations
# Create one by going to https://cloud.digitalocean.com/account/api/tokens
do_token = "..."
# Unique name for the Ontrack instance inside its domain
name = "..."
# Name of the DO cluster
do_k8s_cluster = "..."
Run the plan:
terraform plan -input=false -out=plan
Apply the plan:
terraform apply plan
After a few minutes, Ontrack is deployed in your Digital Ocean cluster and a managed Postgres database is created.
Assuming that you kubectl
configuration points to the Digital Ocean cluster, you can access Ontrack by forwarding its port locally:
kubectl port-forward -n ontrack-<name> \
service/ontrack-<name>-ontrack 8080:8080
Where <name>
is the value of the name
variable in your terraform.tfvars
file. You can then access Ontrack locally using the default admin
/ admin
credentials.
Ingress options
By default, no ingress is setup for the Ontrack service. See https://github.com/nemerosa/ontrack-infra-do-k8s-tf for options on how to set it up.
Links
- https://github.com/nemerosa/ontrack-chart - the Ontrack Helm chart
- https://github.com/nemerosa/ontrack-infra-do-k8s-tf - the Terraform resources for deploying Ontrack in a Digital Ocean K8S cluster