application
Generic Helm chart for Deployment, StatefulSet, DaemonSet, Job and CronJob
About this chart
application
application deploys your applications to your Kubernetes cluster as Deployments, StatefulSets, DaemonSets, CronJobs or Jobs. Each release runs one of them, set under a key named after its type.
application can also create the resources the applications need, including: Services, Gateway API routes and ListenerSets, ServiceAccounts with Roles and RoleBindings, ConfigMaps, Secrets, ExternalSecrets, PersistentVolumeClaims, NetworkPolicies, Cilium network policies, ServiceMonitors and PodMonitors.
Prerequisites
Make sure you are using Kubernetes 1.30 or later.
Installing the Chart
To install the chart with the release name my-app:
helm repo add fawzihmouda https://fawzihmouda.github.io/helm-charts
helm install \
my-app fawzihmouda/application \
--namespace my-app \
--create-namespace \
--version 1.0.0 \
--set deployment.image.repository=ghcr.io/example/my-app \
--set deployment.image.tag=1.0.0
The only required values are one workload type key, such as deployment, and the image repository and tag or digest of each container.
Workload layout
The top-level key names the workload type: deployment, statefulset, daemonset, job or cronjob. A release sets exactly one of them. The chart rejects the old controllers key.
deployment:
replicas: 2
strategy: RollingUpdate
image:
repository: ghcr.io/example/my-app
tag: 1.0.0
additionalContainers:
shipper:
image:
repository: fluent/fluent-bit
tag: "3.2"
service:
ports:
http:
port: 80
- The main container's fields, such as
image,env,probesandresources, sit directly under the type key. The main container takes the release name. additionalContainersholds sidecars andinitContainersholds init containers, each keyed by name. The namemainis reserved:dependsOnandpersistence.<name>.advancedMountsuse it to refer to the main container.- Type options sit under the type key too, such as
schedulefor a CronJob orvolumeClaimTemplatesfor a StatefulSet. serviceconfigures the one Service, which targets the workload.- Setting a type key to
null, such as--set deployment=null, unsets a type that a values file sets.
More information on the values and how to configure them can be found in the Configuration section.
For information on how to deploy a resource the chart doesn't create, such as an Ingress, see rawResources in the Configuration section.
Tip: List all releases using
helm list
Uninstalling the Chart
To uninstall/delete the my-app release:
helm delete my-app --namespace my-app
The command removes all the Kubernetes components associated with the chart, except resources annotated helm.sh/resource-policy: keep, and deletes the release.
If you want to completely uninstall the application from your cluster, you will also need to delete the PersistentVolumeClaims of a StatefulSet, which Helm doesn't delete.
This will remove the data of every pod of the release:
kubectl delete pvc \ --namespace my-app \ --selector app.kubernetes.io/instance=my-app
Configuration
Parameters
configMaps ~ object
Default value: See below
Kubernetes ConfigMaps to be generated by the chart. Additional ConfigMaps can be added by adding a dictionary key similar to the 'config' object.
configMapsFromFolder ~ object
Default value:
autoDetectBinary: false configMapsOverrides: {} enabled: false
Generate ConfigMaps from files in the chart filesystem
configMapsFromFolder.autoDetectBinary ~ string
Default value:
false
Base path containing configmap subfolders basePath:
defaultExternalSecretStoreRef ~ object
Default value:
name: ""
Default SecretStore or ClusterSecretStore reference for ExternalSecret objects.
defaultExternalSecretStoreRef.name ~ string
Default value:
""
Name of the SecretStore resource.
defaultPodOptions ~ object
Default value:
affinity: {} annotations: {} automountServiceAccountToken: false dnsConfig: {} enableServiceLinks: false hostAliases: [] hostIPC: false hostNetwork: false hostPID: false hostUsers: null imagePullSecrets: [] labels: {} nodeSelector: {} resizePolicy: [] resourceClaims: [] resources: {} schedulingGates: [] securityContext: {} shareProcessNamespace: null terminationGracePeriodSeconds: null tolerations: [] topologySpreadConstraints: []
Default options for the workload's pod. The workload's pod options override them. Useful for setting node selectors, tolerations, security contexts, or service accounts.
defaultPodOptions.affinity ~ object
Default value:
{}
Set affinity constraint rules. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
defaultPodOptions.annotations ~ object
Default value:
{}
Annotations to set on the item. Keys and values support Helm templating.
defaultPodOptions.automountServiceAccountToken ~ bool
Default value:
false
Set to true to automatically mount the service account token.
defaultPodOptions.dnsConfig ~ object
Default value:
{}
Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. Configuring the ndots option may resolve nslookup issues on some Kubernetes setups.
defaultPodOptions.enableServiceLinks ~ bool
Default value:
false
Enable/disable the generation of environment variables for services. See https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#accessing-the-service
defaultPodOptions.hostAliases ~ list
Default value:
[]
Use hostAliases to add custom entries to /etc/hosts - mapping IP addresses to hostnames. See https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
defaultPodOptions.hostIPC ~ bool
Default value:
false
Set to true to use the host's ipc namespace.
defaultPodOptions.hostNetwork ~ bool
Default value:
false
Set to false to disable host networking on the Pod. When using hostNetwork, make sure you set dnsPolicy to 'ClusterFirstWithHostNet'
defaultPodOptions.hostPID ~ bool
Default value:
false
Set to true to use the host's pid namespace.
defaultPodOptions.hostUsers ~ bool
Set to false to create a new userns for the Pod. (Requires Kubernetes 1.29 or newer)
defaultPodOptions.imagePullSecrets ~ list
Default value:
[]
Set image pull secrets.
defaultPodOptions.labels ~ object
Default value:
{}
Labels to set on the item. Keys and values support Helm templating.
defaultPodOptions.nodeSelector ~ object
Default value:
{}
Node selection constraint. See https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector
defaultPodOptions.resizePolicy ~ list
Default value:
[]
Pod-level resize policy for controlling container restart on resource resize. (Requires Kubernetes 1.36 or newer with InPlacePodLevelResourcesVerticalScaling enabled)
defaultPodOptions.resourceClaims ~ list
Default value:
[]
ResourceClaims defines which ResourceClaims must be allocated and reserved before the Pod is allowed to start. The resources will be made available to those containers which consume them by name. (Requires Kubernetes 1.32 or newer)
defaultPodOptions.resources ~ object
Default value:
{}
Set the resource requests / limits for the Pod. (Requires Kubernetes 1.32 or newer)
defaultPodOptions.schedulingGates ~ list
Default value:
[]
SchedulingGates is an opaque list of values that if specified will block scheduling the pod. If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the scheduler will not attempt to schedule the pod. See https://kubernetes.io/docs/concepts/scheduling-eviction/pod-scheduling-readiness/
defaultPodOptions.securityContext ~ object
Default value:
{}
Configure the Security Context for the Pod.
defaultPodOptions.shareProcessNamespace ~ bool
Allows sharing process namespace between containers in a Pod. See https://kubernetes.io/docs/tasks/configure-pod-container/share-process-namespace/
defaultPodOptions.terminationGracePeriodSeconds ~ int
Duration in seconds the pod needs to terminate gracefully. See https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#lifecycle
defaultPodOptions.tolerations ~ list
Default value:
[]
Specify taint tolerations. See https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
defaultPodOptions.topologySpreadConstraints ~ list
Default value:
[]
Defines topologySpreadConstraint rules. See https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
defaultPodOptionsStrategy ~ string
Default value:
overwrite
Set the strategy for the default pod options. Defaults to overwrite. overwrite: If pod-level options are set, use those instead of the defaults. merge: If pod-level options are set, merge them with the defaults.
externalSecrets ~ object
Default value: See below
ExternalSecret objects to be generated by the chart. Each key is an ExternalSecret identifier.
global ~ object
Default value:
alwaysAppendIdentifierToResourceName: false annotations: {} createDefaultServiceAccount: true fullnameOverride: null labels: {} nameOverride: null propagateGlobalMetadataToPods: false templateEvaluation: {}
Allows for configuring chart-wide settings
global.alwaysAppendIdentifierToResourceName ~ bool
Default value:
false
Always append identifier slugs to resource names, regardless of the enabled resource count.
global.annotations ~ object
Default value:
{}
Set additional global annotations.
global.createDefaultServiceAccount ~ bool
Default value:
true
When true (default), automatically create a dedicated ServiceAccount using the release name as the identifier if no serviceAccount is explicitly configured. If any serviceAccount entries are present, the default is not created and user configuration takes precedence.
global.fullnameOverride ~ string
Set the chart fullname definition
global.labels ~ object
Default value:
{}
Set additional global labels.
global.nameOverride ~ string
Set the chart name
global.propagateGlobalMetadataToPods ~ bool
Default value:
false
Set to true to propagate global metadata to Pod labels.
global.templateEvaluation ~ object
Default value:
{}
Configure global string template evaluation.
listenerSets ~ object
Default value: See below
Kubernetes Gateway API ListenerSet objects to be generated by the chart. Each key is a ListenerSet identifier. Routes can attach to a ListenerSet by referencing its identifier via the route parentRefs[].identifier key. See https://gateway-api.sigs.k8s.io/references/spec/ for the Gateway API specification.
namespace ~ object
Default value:
annotations: {} create: false labels: {}
Configure the creation of the Helm release namespace.
namespace.annotations ~ object
Default value:
{}
Annotations to set on the item. Keys and values support Helm templating.
namespace.create ~ bool
Default value:
false
Set to true to create the Helm release namespace.
namespace.labels ~ object
Default value:
{}
Labels to set on the item. Keys and values support Helm templating.
networkpolicies ~ object
Default value: See below
networkPolicy objects to be generated by the chart. Additional networkPolicies can be added by adding a dictionary key similar to the 'main' networkPolicy. networkpolicies: ciliumClusterwide: type: ciliumClusterwide nodeSelector: matchLabels: kubernetes.io/os: linux ingress: - fromEntities: - cluster
persistence ~ object
Default value: See below
Configure persistent storage and mount options. Each key is an identifier for a persistence item. Supported types: persistentVolumeClaim (default), configMap, secret, nfs, emptyDir, hostPath, image, projected, custom. By default each item mounts to /. Use globalMounts or advancedMounts to customize mount paths. persistence: config: type: persistentVolumeClaim accessMode: ReadWriteOnce size: 1Gi globalMounts: - path: /config tmp: type: emptyDir persistence: api-token: type: projected defaultMode: 0400 sources: - serviceAccountToken: audience: https://api.example.com expirationSeconds: 3600 path: token globalMounts: - path: /var/run/secrets/tokens persistence: config: type: persistentVolumeClaim accessMode: ReadWriteOnce size: 1Gi
podMonitor ~ object
Default value: See below
podMonitor objects to be generated by the c
Deploy application with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has application 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartapplication is pinned at v1.0.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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