Abstract

Helm Template documentation master file, created by sphinx-quickstart on Sun Apr 28 15:35:08 2024. You can adapt this file completely to your liking, but it should at least contain the root toctree directive.

Template Helm Chart#

Repository Contents#

Indices and tables#

GitHub#

Most likely the site this repository is hosted on. More information is available here.

Helm#

A tool commonly used to deploy applications to Kubernetes. More information is available here.

Kubernetes#

An ancient Greek word that means ‘sailor’ or ‘navigator’, it is the most common container orchestration system currently in use. More information is available here.

Usage#

Typical Helm chart rules.

Chart#

apiVersion

API Version


The Helm API version to use for this chart.

apiVersion: v2
appVersion

App Version


This is the version number of the application being deployed. This version number should be incremented each time you make changes to the application. Versions are not expected to follow Semantic Versioning.

They should reflect the version the application is using.

It is recommended to use it with quotes.

appVersion: "0.0.1"
description

Description


A brief description of the Chart.

description: A Helm chart to deploy resources to bare metal Kubernetes.
icon

Icon


A url or file path to an icon for the Chart’s application.

icon: file://./_static/img/logo/helm.png
name

Name


The name of the application or library provided by the chart.

name: template
type

Type


A chart can be either an ‘application’ or a ‘library’ chart.

Application charts are a collection of templates that can be packaged into versioned archives to be deployed.

Library charts provide useful utilities or functions for the chart developer. They’re included as a dependency of application charts to inject those utilities and functions into the rendering pipeline. Library charts do not define any templates and therefore cannot be deployed.

type: application
version

Version


This is the chart version. This version number should be incremented each time you make changes to the chart and its templates, including the app version. Versions are expected to follow Semantic Versioning (https://semver.org/)

version: 0.0.4

Values#

affinity

Default Values


Default values for the Helm template-replace- template.

This is a YAML-formatted file.

Declare variables to be passed into your templates.

affinity#
affinity:
  nodeAffinity:
  requiredDuringSchedulingIgnoredDuringExecution:
    nodeSelectorTerms:
    - matchExpressions:
      - key: kubernetes.io/os
        operator: In
        values:
        - linux
autoscaling

Autoscaling


Configure auto scaling on the cluster.

affinity#
autoscaling:
  enabled: false
  maxReplicas: 0
  minReplicas: 0

targetCPUUtilizationPercentage: 80

targetMemoryUtilizationPercentage: 80

config

template-replace- Config


Configure the template-replace- deployment.

config#
config:
  allowed_hosts: "*"
  caches_backend: django_redis.cache.RedisCache
  celery:
    img:
      repository: ghcr.io/edwardtheharris/helm-template-replace-/celery
      tag: '0.0.1.rc29'
    broker: 'redis://redis.redis.svc.cluster.local:6379/0'
    name: celery-config
    results: 'redis://redis.redis.svc.cluster.local:6379/0'
    root: '/opt/celery'
  name: template-replace--config
database

Database


Configure a relational database connection, MySQL and PostgreSQL are supported.

database#
database:
  database: template-replace-
  engine: django.db.backends.postgresql
  host: postgresql.postgresql.svc.cluster.local
  name: postgres
  password: ""
  port: '5432'
  secretfile: secrets/secrets.yaml
  timeout: '300'
  username: ""
fullnameOverride

Full Name Override


Override the full name of the release.

fullname override#
fullnameOverride: "template-replace-"
image

Container image settings


Define the image, tag and repository to be deployed.

image#
image:
  pullPolicy: Always
  repository: ghcr.io/edwardtheharris/helm-template-replace-/template-replace-
  # Overrides the image tag whose default is the chart appVersion.
  tag: '0.0.1.rc29'
  secret:
    name: ghcr
    data: ''
imagePullSecrets

Image Pull Secrets


Secrets required to pull the deployment image.

imagePullSecrets#
imagePullSecrets:
- name: ghcr
ingress

Ingress


Configure Ingress for the service.

ingress#
ingress:
  annotations:
    kubernetes.io/ingress.class: nginx
    # kubernetes.io/tls-acme: "true"
  className: "nginx"
  enabled: true
  hosts:
  - host: template-replace-.svc.cluster.local
    paths:
    - path: /
      pathType: ImplementationSpecific
  tls: []
tls example#
tls:
 - secretName: chart-example-tls
   hosts:
     - chart-example.local
livenessProbe

Liveness Probe


Set a command to test for liveness.

liveness probe#
livenessProbe:
  exec:
    command:
    - /opt/template-replace-/bin/template-replace--server
    - status
  # When to give up and restart the container
  failureThreshold: 3
  # Delay before the first probe is initiated
  initialDelaySeconds: 30
  # How often to perform the probe
  periodSeconds: 10
  # Minimum consecutive successes for the probe to
  # be considered successful after having failed
  successThreshold: 1
  # When the probe times out
  timeoutSeconds: 5
nameOverride

Name Override


Override the release name, but not quite all the way.

name override#
fullnameOverride: "template-replace-"
nodeSelector

Node Selector


Select nodes for workloads to run on.

affinity#
nodeSelector:
  kubernetes.io/os: linux
persistence

Persistence Configuration


Provision persistent storage if required.

persistence#
persistence:
  claim:
    enabled: false
  name: template-replace-
  size: 50Gi
  storageClass: csi-driver-lvm-linear
podAnnotations

Pod Annotations


Apply these annotations to all pods.

pod annotations#
podAnnotations: {}
podLabels

Pod Labels


Apply these labels to all pods.

pod labels#
podLabels:
  app: template-replace-
podSecurityContext

Pod Security Context


Define security context for pods.

pod security context#
podSecurityContext: {}
pod security context EXAMPLE#
podSecurityContext:
 fsGroup: 1000
replicaCount

Replica Count


Deploy this many replicas by default.

replicas#
replicaCount: 1

readinessProbe: exec: command: - pg_isready - -U - postgres failureThreshold: 3 # When to give up, marking the Pod as Unready initialDelaySeconds: 5 # Delay before the first probe is initiated, can be shorter than liveness probe periodSeconds: 5 # How often to perform the probe successThreshold: 1 # Minimum consecutive successes for the probe to be considered successful timeoutSeconds: 1 # When the probe times out

resources

Resource Requests and Limits


Set requests and limits for workload resources.

resources#
resources:
  limits:
    cpu: 2
    memory: 4096Mi

We usually recommend not to specify default resources and to leave this as a conscious choice for the user. This also increases chances charts run on environments with little resources, such as Minikube. If you do want to specify resources, uncomment the following lines, adjust them as necessary, and remove the curly braces after resources:.

resources example#
limits:
  cpu: 100m
  memory: 128Mi
requests:
  cpu: 100m
  memory: 128Mi
securityContext

Security Context


Set a security context on the workloads.

securityContext#
securityContext: {}
service

Service


Define the service used to access the application.

service#
service:
  enabled: true
  port: 8000
  targetPort: 8000
  type: ClusterIP
  selectorLabels:
    app.kubernetes.io/component: network
    app.kubernetes.io/name: template-replace-
capabilities example#
capabilities:
  drop:
  - ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
serviceAccount

Service Account


When enabled, will create a Kubernetes Service Account during deployment.

serviceAccount#
serviceAccount:
  # Annotations to add to the service account
  annotations:
    sa.kubernetes.io/name: template-replace-
  # Automatically mount a ServiceAccount's API credentials?
  automount: true
  # Specifies whether a service account should be created
  create: true
  # The name of the service account to use.
  # If not set and create is true, a name is generated using the fullname template
  name: "template-replace-"
superUser

Super User Config


When enabled, will create a super user account during deployment.

superUser#
superUser:
  create: true
  email: template-replace-@template-replace-.svc.cluster.local
  name: nb-admin
  password: ""
  secret:
    name: secret.superuser
  secretKey: '57evlrs^0pmu5#ys=9t6==lf6hdz&$1)qq-(%f1noo_b+nsy@f'
  token: ""
  username: ""
tolerations

Tolerations


Define taints that will be tolerated to run workloads on nodes.

tolerations#
tolerations: []
type

Type


May be set to Deployment or StatefulSet.

type#
type: Deployment
volumeMounts

Volume Mounts


Additional volumeMounts on the output Deployment definition.

volume mounts#
volumeMounts: []
volumeMounts example#
- mountPath: "/mnt/k8s/psql"
  name: data
  readOnly: false
- name: foo
  mountPath: "/etc/foo"
  readOnly: true
volumes

Volumes


Additional volumes on the output Deployment definition.

volumes#
volumes: []
volume example#
- name: foo
  secret:
    secretName: mysecret
    optional: false

Section author: Xander Harris xandertheharris@gmail.com