backend-service

by Unique AI

Helm chartv10.3.0App latestApache-2.0Verified publisher

The 'backend-service' chart is a "convenience" chart from Unique AG that can generically be used to deploy backend workloads to Kubernetes. Note that this chart assumes that you have a valid contract with Unique AG and thus access to the required Docker images.

About this chart

backend-service

The 'backend-service' chart is a "convenience" chart from Unique AG that can generically be used to deploy backend workloads to Kubernetes.

Note that this chart assumes that you have a valid contract with Unique AG and thus access to the required Docker images.

Implementation Details

OCI Availability

# Helm Repository
helm repo add unique https://unique-ag.github.io/helm-charts/
helm install my-backend-service unique/backend-service --version 10.3.0

# OCI
helm install my-backend-service oci://ghcr.io/unique-ag/helm-charts/backend-service --version 10.3.0

Docker Images

The chart uses ghcr.io/unique-ag/chart-testing-service as its default image for CI testing. Replace with actual Unique images when deploying.

Networking

The chart supports Gateway API resources (recommended). Enable specific routes or use extraRoutes to configure them. See Routes.

Ports

added in 3.1.0

ports:
  application: 8080  # container port
  service: 80        # service port (service.port takes precedence if set)

Simplifies inter-service communication by using standard ports:

# before
ANOTHER_SERVICE_URL: http://backend-service.namespace.svc:8080

# after
ANOTHER_SERVICE_URL: http://backend-service.namespace.svc

Routes

added in 2.0.0

Supports Gateway API route resources. Use routes for simplified configuration or extraRoutes for full control.

Requirements: Gateway API CRDs must be installed in at least 1.3.0.

HTTPS Redirects: Not enabled by default. Handle in upstream services or via extraAnnotations.

Timeouts: HTTPRoute timeouts are supported via routes.timeout or per-path routes.paths.<name>.timeout. The value sets both request and backendRequest timeouts (GEP-2257). Note: Kubernetes Service annotations (e.g., konghq.com/read-timeout) take precedence over HTTPRoute timeouts in KIC's translation pipeline and it is not recommended to set both values. Preferred is the Gateway APIs timeout(s).

Network Policies

added in 4.4.0

Two flavors supported:

  • kubernetes (default): Standard Kubernetes NetworkPolicy resources
  • cilium: Cilium's CiliumNetworkPolicy resources with enhanced features
networkPolicy:
  enabled: true
  flavor: kubernetes  # or "cilium"
  policyTypes: [Ingress, Egress]
  ingress:
    - from:
        - namespaceSelector:
            matchLabels: { name: monitoring }
      ports:
        - { protocol: TCP, port: 8080 }
  egress:
    - to:
        - namespaceSelector:
            matchLabels: { name: database }
      ports:
        - { protocol: TCP, port: 5432 }
FlavorAPI VersionSelector
kubernetes (default)networking.k8s.io/v1podSelector
ciliumcilium.io/v2endpointSelector

Notes:

  • Requires a CNI that supports NetworkPolicy (Calico, Cilium, Weave Net)
  • Include DNS (port 53/UDP) in egress rules if pods need hostname resolution

Examples: ci/networkpolicy-values.yaml, ci/networkpolicy-cilium-values.yaml

CronJobs

Deploy cron jobs alongside the main deployment, sharing environment settings and image. Use for workload-related jobs only.

Example: ci/cronjobs-values.yaml

Audit Volumes

added in 9.0.0

Cloud-agnostic audit log storage with blue-green migration support.

auditVolumes:
  target: blue  # or "/dev/stdout"
  volumes:
    blue:
      enabled: true
      capacity: 1Ti
      azure:
        resourceGroup: my-rg
        storageAccount: mystorageaccount
        containerName: audit-logs

Key Concepts

FieldDescription
targetWhere audit logs go. Can be a volume key (blue) or direct path (/dev/stdout)
volumesMap of named volumes. Each creates a PV/PVC pair named {fullname}-audit-{key}
azureAzure Blob NFS config. Presence of this field enables Azure provider
nameOptional explicit PV/PVC name for backward compatibility
mountPathOptional, defaults to /audit-{key}

AUDIT_LOG_DIR Environment Variable

The AUDIT_LOG_DIR environment variable is automatically set based on auditVolumes.target:

target valueConditionAUDIT_LOG_DIR value
Volume key (e.g., blue)Volume enabled: true + cloud provider configuredVolume's mountPath (or /audit-{key} if not set)
Volume key (e.g., blue)Volume missing, disabled, or no cloud providerNot set (env var omitted)
Direct path (e.g., /dev/stdout)AlwaysThe path directly (e.g., /dev/stdout)
Not specifiedAlwaysNot set (env var omitted)

⚠️ A volume requires both enabled: true and a cloud provider configuration (e.g., azure) to be created. Without a cloud provider, no PV/PVC is created and AUDIT_LOG_DIR is not set.

Blue-Green Migration

  1. Add new volume (green) → 2. Deploy (both mounted) → 3. Migrate data → 4. Switch target → 5. Disable old
auditVolumes:
  target: green
  volumes:
    blue: { enabled: true, name: my-release-audit, azure: { resourceGroup: old-rg, storageAccount: oldaccount } }
    green: { enabled: true, azure: { resourceGroup: new-rg, storageAccount: newaccount } }

Stdout Logging

auditVolumes:
  target: /dev/stdout  # No PV/PVC created

Environment Variables

SourceTypeDescription
envmapFlat key-value pairs, creates internal ConfigMap
envVarslistFull Kubernetes env syntax (supports valueFrom)
extraEnvCMlistNames of existing ConfigMaps
extraEnvSecretslistNames of existing Secrets
secretProvidermapAzure Key Vault secrets via CSI driver

Precedence Order

Environment variables are loaded in a specific order. Later sources override earlier sources when the same variable name is defined.

Deployment

envFrom (loaded first, lower precedence):
  1. ConfigMap (contains: env + VERSION + PORT)
  2. extraEnvCM
  3. extraEnvSecrets

env (loaded last, higher precedence):
  4. envVars
  5. secretProvider
  6. auditVolumes (AUDIT_LOG_DIR)
  7. workloadIdentity.gcp (GOOGLE_APPLICATION_CREDENTIALS)

cronJobs

envFrom:
  1. extraEnvCM
  2. extraEnvSecrets

env:
  3. envVars (global, deduplicated with local envVars)
  4. Merged env (global env + cronJobs.<name>.env, local takes precedence)
  5. cronJobs.<name>.envVars (local)
  6. auditVolumes (AUDIT_LOG_DIR) - protected
  7. VERSION (auto-set) - protected
  8. secretProvider

Global envVars entries are excluded if the same name exists in local envVars.

Hooks

envFrom:
  1. ConfigMap (contains: env + VERSION)
  2. extraEnvCM
  3. extraEnvSecrets

env:
  4. envVars (global, deduplicated with per-hook envVars)
  5. Merged env (global env + hooks.<name>.env, per-hook takes precedence)
  6. hooks.<name>.envVars (per-hook)
  7. VERSION (auto-set) - protected
  8. workloadIdentity.gcp (GOOGLE_APPLICATION_CREDENTIALS)
  9. secretProvider

Global envVars entries are excluded if the same name exists in per-hook envVars.

Example: Overriding Variables

env:
  DATABASE_URL: "postgres://global:5432/db"

cronJobs:
  cleanup:
    schedule: "0 0 * * *"
    env:
      DATABASE_URL: "postgres://readonly:5432/db"  # takes precedence

envVars:
  - name: DATABASE_PASSWORD
    valueFrom:
      secretKeyRef:
        name: db-secret
        key: password

Protected Variables

The following variables are automatically set and cannot be overridden via env:

  • VERSION - Set to the image tag
  • PORT - Set to the application port (deployment only)

To override these, use envVars which has higher precedence.

JSON Schema

Schema available in values.schema.json for validation and IDE autocompletion.

Azure Key Vault Access

Supports VM Managed Identity via secretProvider:

Other methods (service principals, pod identity) not supported. Use extraObjects for custom setups. Workload Identity: open an issue if needed.

Upgrade Guides

~> 10.0.1

Version 10.0.0 shall be skipped as it introduced an error-prone rename that was reverted for 10.0.1.

Migrate my backend-service Helm values from 9.x to 10.x:

1. `cronJob` + `extraCronJobs` → `cronJobs`: Merge both into a single `cronJobs` map.
   For `cronJob`: name becomes the key, move `jobTemplate.restartPolicy` to top-level,
   remove `jobTemplate.containers.name`. For `extraCronJobs`: move entries directly into `cronJobs`.

2. `envSecrets` → `envVars`: Replace with `extraEnvSecrets` ref or `envVars` with `secretKeyRef`.

3. envFrom order changed: now `extraEnvCM` → `extraEnvSecrets` (secrets take precedence).

Breaking changes:

ChangeMigration
cronJob removedUse cronJobs map syntax
extraCronJobs removedMerge into cronJobs map
envSecrets removedUse extraEnvSecrets or envVars with secretKeyRef
cronJobs envFrom orderNow extraEnvCM → extraEnvSecrets (secrets take precedence)
VERSION protected in hooksCannot be overridden via env values

Fixes: cronJobs duplicate envVars bug, env merging (local takes precedence)

New: Per-hook env and envVars support (hooks.<name>.env, hooks.<name>.envVars)

Migration examples:

cronJob → cronJobs:

cronJob:
  enabled: true
  name: my-cronjob
  schedule: "0 0 * * *"
  concurrencyPolicy: Forbid
  failedJobsHistoryLimit: 3
  successfulJobsHistoryLimit: 3
  startingDeadlineSeconds: 60
  suspend: false
  timeZone: Europe/Zurich
  jobTemplate:
    containers:
      name: my-container
    restartPolicy: OnFailure
  env:
    MY_VAR: value
  envVars:
    - name: SECRET_VAR
      valueFrom:
        secretKeyRef:
          name: my-secret
          key: password

To:

cronJobs:
  my-cronjob:  # name becomes the key
    schedule: "0 0 * * *"
    restartPolicy: OnFailure  # moved from jobTemplate
    env:
      MY_VAR: value
    envVars:
      - name: SECRET_VAR
        valueFrom:
          secretKeyRef:
            name: my-secret
            key: password

extraCronJobs → cronJobs (merge into map):

# Before
extraCronJobs:
  my-extra-job:
    schedule: "0 * * * *"
    restartPolicy: OnFailure
    env:
      MODE: extra

# After (merge into cronJobs)
cronJobs:
  my-extra-job:
    schedule: "0 * * * *"
    restartPolicy: OnFailure
    env:
      MODE: extra

envSecrets → envVars:

# Before (insecure)                   # After
envSecrets:                           envVars:
  DB_PASS: "secret123"                  - name: DB_PASS
                                          valueFrom:
                                            secretKeyRef:
                                              name: my-secret
                                              key: password

~> 9.0.0

Breaking change: auditVolume → auditVolumes (cloud-agnostic, blue-green ready). See Audit Volumes.

From:

auditVolume:
  enabled: true
  mountPath: /audit
  capacity: 1Ti
  attributes:
    resourceGroup: my-resource-group
    storageAccount: mystorageaccount
    containerName: audit-logs

To:

auditVolumes:
  target: blue
  volumes:
    blue:
      enabled: true
      capacity: 1Ti
      azure:
        resourceGroup: my-resource-group
        storageAccount: mystorageaccount
        containerName: audit-logs

~> 8.0.0

Breaking change: serviceAccount.workloadIdentity → workloadIdentity.azure

From:

serviceAccount:
  workloadIdentity:
    enabled: true
    clientId: "..."

To:

workloadIdentity:
  azure:
    enabled: true
    clientId: "..."

~> 7.0.0

Breaking changes: Pod identity and external-secrets removed.

Pod identity users: migrate to secretProvider with VM Managed Identity. External-secrets users: use extraObjects or manage secrets outside the chart.

~> 6.0.0

Breaking change: KEDA scalers list → triggers map for better overlay support.

From:

keda:
  enabled: true
  scalers:
    - type: rabbitmq
      metadata:
        protocol: amqp
        queueName: testqueue
        mode: QueueLength
        value: "20"
      authenticationRef:
        name: keda-trigger-auth-rabbitmq-conn
    - type: cron
      metadata:
        timezone: Europe/Zurich
        start: 0 6 * * *
        end: 0 20 * * *
        desiredReplicas: "10"
`

Deploy backend-service with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has backend-service on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartbackend-service is pinned at v10.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply