-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Simon Misencik <[email protected]>
- Loading branch information
1 parent
9e0cde6
commit 5ca3a43
Showing
7 changed files
with
186 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: v2 | ||
name: job | ||
version: 1.0.0 | ||
description: A Helm chart for Kubernetes Job | ||
keywords: | ||
- job | ||
home: https://github.com/SimonMisencik/helm-charts | ||
sources: | ||
- https://github.com/SimonMisencik/helm-charts | ||
maintainers: | ||
- name: SimonMisencik | ||
email: [email protected] | ||
icon: https://cdn-icons-png.flaticon.com/512/942/942800.png | ||
appVersion: "1.0.0" | ||
annotations: | ||
artifacthub.io/changes: | | ||
- kind: added | ||
description: First release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# job | ||
|
||
A Helm chart for Kubernetes Job | ||
|
||
## Get Repo Info | ||
|
||
```console | ||
helm repo add open https://simonmisencik.github.io/helm-charts | ||
helm repo update | ||
``` | ||
|
||
## Install Chart | ||
|
||
```console | ||
helm install [RELEASE_NAME] open/job | ||
``` | ||
|
||
## Upgrading Chart | ||
|
||
```console | ||
helm upgrade [RELEASE_NAME] open/job | ||
``` | ||
|
||
## Uninstall Chart | ||
|
||
```console | ||
helm uninstall [RELEASE_NAME] | ||
``` | ||
|
||
## Configuration | ||
|
||
| Parameter | Description | Default | | ||
|-----------|-------------|---------| | ||
| `image.repository` | Image repository | `ubuntu` | | ||
| `image.pullPolicy` | Image pull policy | `IfNotPresent` | | ||
| `image.tag` | Image tag | `"latest"` | | ||
| `imagePullSecrets` | Pull secrets for images | `[]` | | ||
| `restartPolicy` | Restart policy for job container | `OnFailure` | | ||
| `command` | Command for container | `'["bash", "-c", "sleep 365d"]'` | | ||
| `extraInitContainers` | extraInitContainers for job | | | ||
| `env` | Environment variables for job container | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Your job was deployed! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "job.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "job.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "job.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "job.labels" -}} | ||
helm.sh/chart: {{ include "job.chart" . }} | ||
{{ include "job.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "job.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "job.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "job.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "job.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{ include "job.fullname" . }} | ||
labels: | ||
{{- include "job.labels" . | nindent 4 }} | ||
spec: | ||
template: | ||
spec: | ||
restartPolicy: {{ .Values.restartPolicy }} | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.extraInitContainers }} | ||
initContainers: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
command: {{ .Values.command }} | ||
env: | ||
{{- range $key, $val := .Values.env }} | ||
- name: {{ $key | quote }} | ||
value: {{ $val | quote }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Default values for job. | ||
|
||
image: | ||
repository: ubuntu | ||
pullPolicy: IfNotPresent | ||
tag: "latest" | ||
|
||
imagePullSecrets: [] | ||
restartPolicy: OnFailure | ||
command: '["bash", "-c", "sleep 365d"]' | ||
|
||
extraInitContainers: | ||
|
||
env: |