job

by ameijer

Helm chartv1.1.1App v1.0.0Verified publisher

Helm Chart representing a single Job Kubernetes API object

About this chart

Job Chart

TL;DR;

$ helm repo add k8s-as-helm https://ameijer.github.io/k8s-as-helm/
$ helm install my-release k8s-as-helm/job

Introduction

Helm charts are great! They are really configurable and let you build complicated software stacks in seconds. Tools like Helmfile combine helm charts together to allow you to set up an environment consisting entirely of helm releases.

Let's say, though, you want to add additional code to a third party helm chart. You could make a new chart with your K8s API resource and the third party chart as a dependency, but that requires maintenance which might not be worth it if you only needed a single additional resource created. That's where k8s-as-helm charts come in. These charts wrap a single Kubernetes resource in a helm chart with all the key parameters exposed.

The pod chart deploys a single Kubernetes Job object.

Installation

$ helm repo add k8s-as-helm https://ameijer.github.io/k8s-as-helm/
$ helm install my-release k8s-as-helm/job

Configuration

The following table lists the configurable parameters of the pod chart and their default values.

ParameterDescriptionDefault
nameOverrideoverride name of the chart component.Release.Name
apiVersionapi version of k8s object"batch/v1"
annotationsannotations in yaml map format to be added to the objectnull
labelslabels to add to Job objectnull
podAnnotationsannotations in yaml map format to be added to the Pod objectnull
podLabelslabels to add to Pod objectnull
containersArray of container objects in the job pods[]
containers[].nameThe name of the given containernull
containers[].imageThe image of the given containernull
containers[].extraSettingsYAML representation of additional config settings for the given containernull
containers[].volumeMountsMap of volume mount names to settings for each given mountnull
dnsPolicyThe job pod DNS policyClusterFirst
restartPolicyThe restart policy of the pods in the jobAlways
saNameThe job pod service account namedefault
tgpsThe job pods' terminationGracePeriodSeconds setting30
extraSettingsYaml representation of any additional required pod settingsnull
volumesMapping of volume name to volume settings for each volume mount used by the job podsnull
backoffLimitThe job's backoffLimit settings. Leave unset to use defaultsnull
activeDeadlineSecondsThe maximum time the job may take. Leave unset to use default 600 secondsnull
parallelismThe parallelism of the pods in the job. Leave unset to use default of no parallelismnull
completionsThe number of successful pod completions for the job. Leave unset to use the default of 1null
completionModeSet to Indexed to pass an index to each pod. Leave unset to omit index passing.null
ttlSecondsAfterFinishedNumber of seconds to delete the job after finishingnull

Example Configuration

For some examples of values used to configure this chart, see the ci/example values for this chart

Deploy job with OpenTenant

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