commons

by WyriHaximus

Helm chartv0.1.1Verified publisher

commons library

About this chart

Commons

Opinionated helm library chart containing metadata helpers for helm application charts.

Example deployment using helpers from this chart:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ template "commons.fullname" . }}
  labels:
    {{- include "commons.labels" . | nindent 4 }}
    app.kubernetes.io/component: controller
spec:
  selector:
    matchLabels:
      {{- include "commons.selectorLabels" . | nindent 6 }}
  replicas: 1
  template:
    metadata:
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "9696"
      labels:
        {{- include "commons.labels" . | nindent 8 }}
    spec:
      containers:
        - name: default-backend
          image: "ghcr.io/wyrihaximusnet/default-backend:random"
          imagePullPolicy: Always
          ports:
            - name: default-backend
              containerPort: 6969
              protocol: TCP
            - name: metrics
              containerPort: 9696
              protocol: TCP
          livenessProbe:
            failureThreshold: 6
            httpGet:
              path: /
              port: metrics
          readinessProbe:
            failureThreshold: 6
            httpGet:
              path: /
              port: metrics
          startupProbe:
            httpGet:
              path: /
              port: metrics
            failureThreshold: 90
            periodSeconds: 1
          resources:
            limits:
              cpu: 75m
              memory: 64Mi
            requests:
              cpu: 75m
              memory: 64Mi
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: appRevision
                operator: In
                values:
                - {{ template "commons.nameRevision" . }}
            topologyKey: "kubernetes.io/hostname"

Deploy commons with OpenTenant

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