Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions charts/drone-tm/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
dependencies:
- name: postgresql
repository: oci://registry-1.docker.io/bitnamicharts
version: 15.2.2
- name: minio
repository: https://charts.min.io
version: 5.1.0
- name: redis
repository: oci://registry-1.docker.io/bitnamicharts
version: 18.1.0
digest: sha256:9299a363000374084bc7e53b5fccf4134373a4a8830c396f7c2ae2d3c211f646
generated: "2025-08-26T19:21:52.983129-03:00"
26 changes: 26 additions & 0 deletions charts/drone-tm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v2
name: drone-tm
description: Drone Tasking Manager - coordinated drone mapping
version: "0.1.0"
appVersion: "2025.3.2"
maintainers:
- email: [email protected]
name: HOTOSM
home: https://github.com/hotosm/drone-tm
icon: https://dronetm.hotosm.org/favicon.png
dependencies:
- name: postgresql
version: 15.2.2
repository: oci://registry-1.docker.io/bitnamicharts
condition: postgresql.enabled
alias: postgresql
- name: minio
version: 5.1.0
repository: https://charts.min.io
condition: minio.enabled
alias: minio
- name: redis
version: 18.1.0
repository: oci://registry-1.docker.io/bitnamicharts
condition: redis.enabled
alias: redis
94 changes: 94 additions & 0 deletions charts/drone-tm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Drone Task Manager Helm Chart

This Helm chart deploys the Drone Task Manager application and its dependencies.

## Values Files

### `values.yaml`

Default values for the chart. Contains all configurable parameters with sensible defaults.

### `values-local.yaml`

Development environment configuration:

- **Purpose**: Local development and testing
- **Usage**: `helm install drone-tm ./charts/drone-tm -f values-local.yaml`
- **Features**:
- Minimal resource allocation
- Ingress disabled (uses port-forward)
- ODM processing enabled for testing
- Local storage classes

## Environment-Specific Configuration

Environment-specific configurations (staging, production) are managed in the k8s-infra repository through ArgoCD applications. This approach:

- **Eliminates duplication** between chart repo and k8s-infra repo
- **Centralizes environment config** in the infrastructure repository
- **Maintains separation of concerns** between application and infrastructure
- **Enables GitOps** workflow for environment management

## Usage Examples

### Local Development

```bash
# Install with development values
helm install drone-tm ./charts/drone-tm -f values-local.yaml

# Upgrade with development values
helm upgrade drone-tm ./charts/drone-tm -f values-local.yaml
```

### Staging/Production Deployment

Staging and production deployments are managed through ArgoCD applications in the k8s-infra repository. The environment-specific configurations are embedded directly in the ArgoCD Application manifests, eliminating the need for separate values files.

To modify environment-specific settings:

1. Edit the ArgoCD Application manifest in k8s-infra repository
2. Update the `values` section in the `helm` configuration
3. ArgoCD will automatically sync the changes to the cluster

## Dependencies

This chart includes the following subcharts:

- **PostgreSQL**: Database with PostGIS extension
- **MinIO**: S3-compatible object storage
- **Redis**: Caching and task queue

## Configuration

Key configuration areas:

- **Global**: Domain, storage class, ingress class
- **Backend**: API server configuration
- **Frontend**: Web application configuration
- **Worker**: Background task processing
- **ODM**: Optional OpenDroneMap processing
- **PostgreSQL**: Database configuration
- **MinIO**: Object storage configuration
- **Redis**: Cache and queue configuration

## Secrets

Secrets are managed through Kubernetes secrets and should be created separately:

- `drone-tm-secrets`: Contains database, S3, Redis, and application secrets

## Monitoring

Health checks are configured for all services:

- **Liveness Probe**: Ensures containers are running
- **Readiness Probe**: Ensures containers are ready to serve traffic

## Resources

Resource limits and requests are configured per environment:

- **Development**: Minimal resources for local testing
- **Staging**: Moderate resources for testing
- **Production**: High resources with autoscaling
Binary file added charts/drone-tm/charts/minio-5.1.0.tgz
Binary file not shown.
Binary file added charts/drone-tm/charts/postgresql-15.2.2.tgz
Binary file not shown.
Binary file added charts/drone-tm/charts/redis-18.1.0.tgz
Binary file not shown.
53 changes: 53 additions & 0 deletions charts/drone-tm/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
1. Get the application URL by running these commands:
{{- if .Values.frontend.ingress.enabled }}
{{- range $host := .Values.frontend.ingress.hosts }}
http{{ if $.Values.frontend.ingress.tls }}s{{ end }}://{{ $host.host }}
{{- end }}
{{- else if contains "NodePort" .Values.frontend.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "drone-tm.frontend.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.frontend.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "drone-tm.frontend.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "drone-tm.frontend.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.frontend.service.port }}
{{- else if contains "ClusterIP" .Values.frontend.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "drone-tm.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=frontend" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}

{{- if .Values.backend.ingress.enabled }}
2. API endpoint:
{{- range $host := .Values.backend.ingress.hosts }}
http{{ if $.Values.backend.ingress.tls }}s{{ end }}://{{ $host.host }}
{{- end }}
{{- end }}

{{- if .Values.odm.enabled }}
3. ODM processing is enabled:
- NodeODM service: {{ include "drone-tm.odm.nodeodm.fullname" . }}
- WebODM UI: Available through the main application
{{- end }}

4. Database connection:
{{- if .Values.postgresql.enabled }}
- PostgreSQL is deployed as part of this chart
- Host: {{ include "drone-tm.fullname" . }}-postgresql
- Port: 5432
- Database: {{ .Values.postgresql.auth.database }}
- User: {{ .Values.postgresql.auth.username }}
{{- else }}
- Using external PostgreSQL database
{{- end }}

5. S3 Storage:
{{- if .Values.minio.enabled }}
- MinIO is deployed as part of this chart
- Endpoint: http://{{ include "drone-tm.fullname" . }}-minio:9000
- Access Key: {{ .Values.minio.auth.rootUser }}
{{- else }}
- Using external S3-compatible storage
{{- end }}
98 changes: 98 additions & 0 deletions charts/drone-tm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "drone-tm.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "drone-tm.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "drone-tm.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "drone-tm.labels" -}}
helm.sh/chart: {{ include "drone-tm.chart" . }}
{{ include "drone-tm.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "drone-tm.selectorLabels" -}}
app.kubernetes.io/name: {{ include "drone-tm.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "drone-tm.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "drone-tm.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Create the name of the backend service
*/}}
{{- define "drone-tm.backend.fullname" -}}
{{- printf "%s-backend" (include "drone-tm.fullname" .) }}
{{- end }}

{{/*
Create the name of the frontend service
*/}}
{{- define "drone-tm.frontend.fullname" -}}
{{- printf "%s-frontend" (include "drone-tm.fullname" .) }}
{{- end }}

{{/*
Create the name of the worker service
*/}}
{{- define "drone-tm.worker.fullname" -}}
{{- printf "%s-worker" (include "drone-tm.fullname" .) }}
{{- end }}

{{/*
Create the name of the ODM services
*/}}
{{- define "drone-tm.odm.nodeodm.fullname" -}}
{{- printf "%s-odm-nodeodm" (include "drone-tm.fullname" .) }}
{{- end }}

{{- define "drone-tm.odm.webodm.fullname" -}}
{{- printf "%s-odm-webodm" (include "drone-tm.fullname" .) }}
{{- end }}

{{- define "drone-tm.odm.worker.fullname" -}}
{{- printf "%s-odm-worker" (include "drone-tm.fullname" .) }}
{{- end }}
60 changes: 60 additions & 0 deletions charts/drone-tm/templates/backend-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{{- if and .Values.backend.enabled .Values.backend.ingress.enabled -}}
{{- $fullName := include "drone-tm.backend.fullname" . -}}
{{- $svcPort := .Values.backend.service.port -}}
{{- if and .Values.global.ingress.className (not (hasKey .Values.backend.ingress.annotations "kubernetes.io/ingress.class")) }}
{{- $_ := set .Values.backend.ingress.annotations "kubernetes.io/ingress.class" .Values.global.ingress.className}}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "drone-tm.labels" . | nindent 4 }}
app.kubernetes.io/component: backend
{{- with .Values.backend.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.global.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.global.ingress.className }}
{{- end }}
{{- if .Values.backend.ingress.tls }}
tls:
{{- range .Values.backend.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.backend.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
19 changes: 19 additions & 0 deletions charts/drone-tm/templates/backend-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.backend.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "drone-tm.backend.fullname" . }}
labels:
{{- include "drone-tm.labels" . | nindent 4 }}
app.kubernetes.io/component: backend
spec:
type: {{ .Values.backend.service.type }}
ports:
- port: {{ .Values.backend.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "drone-tm.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: backend
{{- end }}
Loading