Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bambash/helm-cronjobs

a helm chart for cronjobs in kubernetes
https://github.com/bambash/helm-cronjobs

helm kubernetes

Last synced: 8 days ago
JSON representation

a helm chart for cronjobs in kubernetes

Awesome Lists containing this project

README

        

# helm-cronjobs
You can define an array of jobs in values.yaml helm will take care of creating all the CronJobs.

## How to use as a starter chart

1. Find your Helm data directory, `HELM_DATA_HOME`

```
helm env
```

1. `cd` to this directory, then

```
mkdir starters
cd starters
```

1. Clone this repo

1. In your cronjob project, set up your new chart with

```
helm create -p helm-cronjobs your_chart_name
```

## Configuration

Via `values.yaml`

### Overview

```yaml
jobs:
jobname-1:
# job definition
jobname-2:
# job definition
jobname-n:
# job definition
```

### Details

```yaml
jobs:
### REQUIRED ###
:
image:
repository:
tag:
imagePullPolicy:
schedule: ""
failedJobsHistoryLimit:
successfulJobsHistoryLimit:
concurrencyPolicy:
restartPolicy:
### OPTIONAL ###
imagePullSecrets:
- username:
password:
email:
registry:
env:
- name: ENV_VAR
value: ENV_VALUE
envFrom:
- secretRef:
name:
- configMapRef:
name:
command: [""]
args:
- ""
- ""
resources:
limits:
cpu:
memory:
requests:
cpu:
memory:
serviceAccount:
name:
annotations: # Optional
my-annotation-1:
my-annotation-2:
nodeSelector:
key:
tolerations:
- effect: NoSchedule
operator: Exists
volumes:
- name: config-mount
configMap:
name: configmap-name
items:
- key: configuration.yml
path: configuration.yml
volumeMounts:
- name: config-mount
mountPath: /etc/config
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/e2e-az-name
operator: In
values:
- e2e-az1
- e2e-az2
```

## Examples
```
$ helm install test-cron-job .
NAME: cold-fly
LAST DEPLOYED: Fri Feb 1 15:29:21 2019
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1/CronJob
NAME AGE
cold-fly-hello-world 1s
cold-fly-hello-ubuntu 1s
cold-fly-hello-env-var 1s
```
list cronjobs:
```
$ kubectl get cronjob
NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE
cold-fly-hello-env-var * * * * * False 0 23s 1m
cold-fly-hello-ubuntu */5 * * * * False 0 23s 1m
cold-fly-hello-world * * * * * False 0 23s 1m
```
list jobs:
```
$ kubectl get jobs
NAME DESIRED SUCCESSFUL AGE
cold-fly-hello-env-var-1549056600 1 1 45s
cold-fly-hello-ubuntu-1549056600 1 1 45s
cold-fly-hello-world-1549056600 1 1 45s
```