common

by Snowplow

Helm chartv0.9.0Verified publisher

A library chart containing common template helpers for Snowplow Helm charts

About this chart

Common Library Chart

A Helm library chart containing common template helpers and resources for Snowplow Helm charts.

Overview

This library chart provides reusable template helpers and Kubernetes resource definitions that can be shared across multiple Snowplow Helm charts, reducing code duplication and ensuring consistency. It supports both single-service and multi-service deployments.

Usage

Add this chart as a dependency in your Chart.yaml:

dependencies:
  - name: common
    version: 0.1.0
    repository: "https://snowplow-devops.github.io/helm-charts"

Then use the template definitions in your chart templates:

{{- include "common.deployment" . }}
{{- include "common.service" . }}
{{- include "common.ingress" . }}

Template Design

All resource templates support N instances by iterating over .Values.services. This allows:

  • Single-service charts: Pass a list with one service
  • Multi-service charts: Pass a list with multiple services

Expected Values Structure

global:
  cloud: aws  # or gcp, azure
  labels:
    team: platform

services:
  - name: my-service
    image:
      repository: myapp
      tag: v1.0.0
    deployment:
      kind: Deployment
      replicas: 3
    service:
      deploy: true
      port: 8080
    # ... additional configuration

# Optional: Shared ingress for path-based routing to multiple services
sharedIngress:
  - name: my-shared-ingress
    hostname: api.example.com
    certificateIssuer: letsencrypt-prod
    routes:
      - path: /service-a
        serviceName: service-a
        port: 8080
      - path: /service-b
        serviceName: service-b
        port: 8081

Available Template Helpers

Naming Helpers

  • common.fullname: Generate full app name (truncated to 50 chars)
  • common.secret.fullname: Generate secret name based on app fullname
  • common.chart: Generate chart name and version label

Label Helpers

  • common.labels: Generate standard Snowplow labels including global labels

GCP Helpers

  • common.gcp.networkEndpointGroupName: Generate GCP Network Endpoint Group name

Available Resource Templates

Core Resources

  • common.deployment: Generate Deployment or StatefulSet resources
  • common.service: Generate Service resources
  • common.secret: Generate Secret resources
  • common.configmaps: Generate ConfigMap resources
  • common.hooks: Generate Helm hook Jobs with optional secrets and configmaps

Scaling Resources

  • common.hpa: Generate HorizontalPodAutoscaler resources
  • common.vpa: Generate VerticalPodAutoscaler resources

Storage Resources

  • common.pvc: Generate PersistentVolumeClaim resources

Network Resources

  • common.ingress: Generate Ingress resources (per-service)
  • common.sharedingress: Generate shared Ingress resources with path-based routing to multiple services
  • common.certificate: Generate cert-manager Certificate resources
  • common.ipallowlist: Generate Traefik Middleware for IP allowlisting
  • common.ratelimit: Generate Traefik Middleware for rate limiting
  • common.targetgroupbinding: Generate AWS TargetGroupBinding resources

RBAC Resources

  • common.role: Generate Role resources
  • common.rolebinding: Generate RoleBinding resources
  • common.clusterrole: Generate ClusterRole resources
  • common.clusterrolebinding: Generate ClusterRoleBinding resources

Chart Type

This is a library chart (type: library) and cannot be installed directly. It must be used as a dependency in other charts.

Deploy common with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has common 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 chartcommon is pinned at v0.9.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