backend-common

by serge.logvinov

Helm chartv0.1.7App 1.0.0Verified publisher

Deploy common backend services with workers and jobs

About this chart

backend-common

Deploy common backend services with workers and jobs

This is a common chart for backend services. It includes the following components:

  • Deployment
  • Job
  • Service
  • Ingress
  • Horizontal Pod Autoscaler
  • Pod Disruption Budget

Homepage: https://github.com/sergelogvinov/helm-charts

Maintainers

NameEmailUrl
sergelogvinovhttps://github.com/sergelogvinov

Source Code

Example:

# Default image for all components, can be overridden
image:
  repository: ghcr.io/sergelogvinov/backend-example

# Default replica count for all components, can be overridden
replicaCount: 1

services:
  # Deployment with service, default port is 5200
  admin:
    enabled: true
    command: ["uwsgi","--ini","settings/uwsgi.ini","--http11-socket",":5200"]

workers:
  # Deployment do not expose service
  celery-worker:
    enabled: true
    command: ["celery", "-A", "core.celery", "worker", "-l", "info"]

cronjobs:
  # Cronjob to run runcrons management command
  runcrons:
    enabled: true
    schedule: "5 * * * *"
    command: ["python", "manage.py", "runcrons"]

jobs:
  # Job to run migrations, runs by helm install or helm upgrade
  migrate:
    enabled: true
    command: ["python", "manage.py", "-p", "migrate", "--noinput"]
    # Override default resources values
    resources:
      limits:
        cpu: 1
        memory: 1024Mi
      requests:
        cpu: 500m
        memory: 256Mi

ingress:
  enabled: true
  hosts:
    - host: example.com
      paths:
        # Name is the service name
        - name: admin
          path: /admin
          pathType: ImplementationSpecific
        - name: admin
          path: /api
          pathType: ImplementationSpecific

# Default resources for all components
resources:
  limits:
    cpu: 1
    memory: 512Mi
  requests:
    cpu: 100m
    memory: 256Mi

Values

KeyTypeDefaultDescription
replicaCountint1
image.repositorystring"nginx"
image.pullPolicystring"IfNotPresent"
image.tagstring""
imagePullSecretslist[]
nameOverridestring""
fullnameOverridestring""
serviceAccount.createboolfalse
serviceAccount.automountboolfalse
serviceAccount.annotationsobject{}
serviceAccount.namestring""
ingress.enabledboolfalse
ingress.classNamestring""
ingress.annotationsobject{}
ingress.hosts[0].hoststring"chart-example.local"
ingress.hosts[0].paths[0].namestring"service"
ingress.hosts[0].paths[0].pathstring"/"
ingress.hosts[0].paths[0].pathTypestring"ImplementationSpecific"
ingress.tlslist[]
podAnnotationsobject{}
podLabelsobject{}
podSecurityContext.runAsNonRootbooltrue
podSecurityContext.runAsUserint1100
podSecurityContext.runAsGroupint1100
podSecurityContext.fsGroupint1100
podSecurityContext.fsGroupChangePolicystring"OnRootMismatch"
securityContext.allowPrivilegeEscalationboolfalse
securityContext.seccompProfile.typestring"RuntimeDefault"
securityContext.capabilities.drop[0]string"ALL"
priorityClassNamestringnil
secretsMountPathstring"/etc/secrets"
secretsobject{}
configMountPathstring"/etc/settings"
configConfigMapstringnil
configstringnil
envlist[]
envSecretsobject{}
servicesobject{}
workersobject{}
cronjobsobject{}
jobsobject{}
resources.requests.cpustring"100m"
resources.requests.memorystring"256Mi"
startupProbe.initialDelaySecondsint30
startupProbe.periodSecondsint15
startupProbe.timeoutSecondsint10
startupProbe.failureThresholdint8
livenessProbe.initialDelaySecondsint120
livenessProbe.periodSecondsint60
livenessProbe.timeoutSecondsint10
livenessProbe.failureThresholdint5
readinessProbe.initialDelaySecondsint120
readinessProbe.periodSecondsint60
readinessProbe.timeoutSecondsint10
readinessProbe.failureThresholdint5
volumeslist[]
volumeMountslist[]
nodeSelectorobject{}
tolerationslist[]
affinityobject{}
nodeAffinityPresetobject{}
podAffinityPresetobject{}
podAntiAffinityPresetstring"soft"

Deploy backend-common with OpenTenant

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