Kubernetes Deployment
This guide explains how to deploy Drill4J services to a Kubernetes cluster with Helm. The chart installs the Admin API, UI, and optionally PostgreSQL.
Prerequisites#
- A Kubernetes cluster and
kubectlconfigured to use the intended cluster context. - Helm 3.
- An Ingress controller and DNS configured for the hostname you plan to use.
- A default StorageClass, or a StorageClass configured for the PostgreSQL and backup volumes.
- TLS certificate and key files, unless TLS is provisioned by cert-manager.
The chart requires Kubernetes 1.25 or later.
Get the Helm chart#
Pull and extract the chart from the GitHub Container Registry:
helm pull oci://ghcr.io/drill4j/drill --version 0.12.0 --untar
This creates a drill folder containing Chart.yaml. Run the following Helm commands from that folder.
Deploy to a Kubernetes cluster#
Check that
kubectlis connected to the intended cluster and create thedrillnamespace:If TLS is not provisioned automatically by cert-manager, create a TLS Secret in the namespace:
Install the chart, replacing the example hostname and
nginxwith values for your cluster:If cert-manager provisions TLS, omit the Secret creation command, configure the issuer in the Ingress annotations, and ensure it provisions the
drill-tlsSecret configured invalues-prod.yaml.Check the workloads and run the chart test:
Open
https://drill.example.comand sign in with the default credentials:admin/admin. Change the password after signing in. The API is available at/apiand Swagger at/swagger. Configure Drill4J agents to send data tohttps://drill.example.com/api.
Minikube#
For local development, start Minikube with the port mappings used by the chart's NodePort services, then install the local values:
Open the UI at http://localhost:8091.
The default login is admin / admin.
If Minikube was started without the port mappings, use the kubectl port-forward commands printed in the Helm install notes.
Secure deployment#
values-local-secure.yaml is values-local.yaml with a hardened bundled PostgreSQL:
It enables:
postgresql.tls.enabled— PostgreSQL accepts only SSL connections from other pods. A self-signed certificate is generated at startup; setpostgresql.tls.existingSecretto use your ownkubernetes.io/tlsSecret.postgresql.adminUser.enabled— the admin service connects as a dedicateddrillrole without superuser,CREATEDB,CREATEROLE, replication, or RLS-bypass privileges. Its password is generated into the chart Secret unlesspostgresql.adminUser.passwordis set.postgresql.hardenPublicRole— defaultPUBLICprivileges are revoked in both Drill4J databases.
Use it for a new installation with an empty database volume. The same settings can be added to values-prod.yaml.
Configuration#
Use values-local.yaml for Minikube development and values-prod.yaml as a starting point for a Kubernetes cluster.
Adjust resource requests, storage, Ingress settings, and TLS to match your environment. The full list of chart values is in values.yaml.
To use an external PostgreSQL instance, create a Secret containing its password and disable the chart's bundled database:
The database user must be allowed to create the configured databases, or create them in advance and set admin.dbInit.enabled=false.
Upgrade and rollback#
Use the same values file and overrides that were used for installation:
Backups are disabled by default. Admin applies database migrations at startup, and a migration may not be reversible.