Skip to content

Commit 248d315

Browse files
committed
feat: ✨ add extraVolumes, extraVolumeMounts and image.pullPolicy
1 parent aebdb4e commit 248d315

File tree

4 files changed

+38
-15
lines changed

4 files changed

+38
-15
lines changed

charts/dso-ansible-job/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: v2
22
name: cpn-ansible-job
33
description: Creates Job for Socle services post-configuration.
44
type: application
5-
version: 1.5.0
6-
appVersion: 1.0.0
5+
version: 1.6.0
6+
appVersion: 1.1.0
77
maintainers:
88
- name: cloud-pi-native
99
email: cloudpinative-relations@interieur.gouv.fr

charts/dso-ansible-job/README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# cpn-ansible-job
22

3-
![Version: 1.5.0](https://img.shields.io/badge/Version-1.5.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square)
3+
![Version: 1.6.0](https://img.shields.io/badge/Version-1.6.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.1.0](https://img.shields.io/badge/AppVersion-1.1.0-informational?style=flat-square)
44

55
Creates Job for Socle services post-configuration.
66

@@ -19,19 +19,22 @@ Creates Job for Socle services post-configuration.
1919
| cronJob.schedule | string | `"0 */6 * * *"` | CronJob schedule. |
2020
| fullnameOverride | string | `""` | String to fully override the default application name. |
2121
| global.platform | string | `"kubernetes"` | For security context depending of the cluster distribution. |
22-
| job.activeDeadlineSeconds | string | `nil` | Optional maximum time in seconds before de Pod is killed (no matter of the backoffLimit) |
22+
| job.activeDeadlineSeconds | string | `nil` | Optional maximum time in seconds before de Pod is killed (no matter of the backoffLimit). |
2323
| job.annotations | object | `{"argocd.argoproj.io/hook":"PostSync","argocd.argoproj.io/hook-delete-policy":"HookSucceeded"}` | Kubernetes annotations to apply to the job resource. |
24-
| job.backoffLimit | int | `6` | Number of retries before setting de Job status to failed |
25-
| job.dscName | string | `nil` | Name of the DsoSocleConfig to use as source-of-truth |
26-
| job.extraEnv | Optional | `[]` | Extra environment variables to pass to the job container |
24+
| job.backoffLimit | int | `6` | Number of retries before setting de Job status to failed. |
25+
| job.dscName | string | `nil` | Name of the DsoSocleConfig to use as source-of-truth. |
26+
| job.extraEnv | Optional | `[]` | Extra environment variables to pass to the job container. |
27+
| job.extraVolumeMounts | Optional | `[]` | Extra volume mounts for the job container. |
28+
| job.extraVolumes | Optional | `[]` | Extra volumes to mount into the job container. |
29+
| job.image.pullPolicy | string | `"IfNotPresent"` | Pull policy for the job image. |
2730
| job.image.repository | string | `"ghcr.io/cloud-pi-native/git-ansible"` | Repository to use for the job. |
2831
| job.image.tag | string | `""` | Tag to use for the job. # Overrides the image tag whose default is the chart appVersion. |
2932
| job.name | string | `"example-playbook"` | Playbook name. |
3033
| job.restartPolicy | string | `"OnFailure"` | Job restart policy (e.g., Never or OnFailure). |
3134
| job.serviceAccount.annotations | object | `{}` | Annotations applied to created service account. |
3235
| job.serviceAccount.create | bool | `true` | Create a service account for the job. |
3336
| job.serviceAccount.name | string | `""` | Service account name. |
34-
| job.targetRevision | string | `"main"` | Git branch or tag to checkout before applying the Ansible playbook |
37+
| job.targetRevision | string | `"main"` | Git branch or tag to checkout before applying the Ansible playbook. |
3538
| nameOverride | string | `""` | Provide a name in place of the default application name. |
3639

3740
----------------------------------------------

charts/dso-ansible-job/templates/_helpers.tpl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ spec:
6363
containers:
6464
- name: {{ .playbookName }}-post-conf
6565
image: {{ .Values.job.image.repository }}:{{ .Values.job.image.tag | default .Chart.AppVersion }}
66-
imagePullPolicy: Always
66+
imagePullPolicy: {{ .Values.job.image.pullPolicy }}
6767
command:
6868
- /bin/sh
6969
- -c
@@ -77,6 +77,14 @@ spec:
7777
env:
7878
{{- toYaml . | nindent 12 }}
7979
{{- end }}
80+
{{- with .Values.job.extraVolumeMounts }}
81+
volumeMounts:
82+
{{- toYaml . | nindent 12 }}
83+
{{- end }}
84+
{{- with .Values.job.extraVolumes }}
85+
volumes:
86+
{{- toYaml . | nindent 8 }}
87+
{{- end }}
8088
{{- end }}
8189

8290

charts/dso-ansible-job/values.yaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ global:
77
# -- For security context depending of the cluster distribution.
88
platform: kubernetes
99

10-
# Job configuration
10+
# Job configuration.
1111
job:
1212
# -- Playbook name.
1313
name: "example-playbook"
14-
# -- (string) Name of the DsoSocleConfig to use as source-of-truth
14+
# -- (string) Name of the DsoSocleConfig to use as source-of-truth.
1515
dscName: null
16-
# -- Git branch or tag to checkout before applying the Ansible playbook
16+
# -- Git branch or tag to checkout before applying the Ansible playbook.
1717
targetRevision: "main"
1818
serviceAccount:
1919
# -- Create a service account for the job.
@@ -24,24 +24,36 @@ job:
2424
name: ""
2525
# -- Job restart policy (e.g., Never or OnFailure).
2626
restartPolicy: OnFailure
27-
# -- Optional maximum time in seconds before de Pod is killed (no matter of the backoffLimit)
27+
# -- Optional maximum time in seconds before de Pod is killed (no matter of the backoffLimit).
2828
activeDeadlineSeconds: null
29-
# -- Number of retries before setting de Job status to failed
29+
# -- Number of retries before setting de Job status to failed.
3030
backoffLimit: 6
3131
image:
3232
# -- Repository to use for the job.
3333
repository: ghcr.io/cloud-pi-native/git-ansible
3434
# -- Tag to use for the job.
3535
## Overrides the image tag whose default is the chart appVersion.
3636
tag: ""
37+
# -- Pull policy for the job image.
38+
pullPolicy: IfNotPresent
3739
# -- Kubernetes annotations to apply to the job resource.
3840
annotations:
3941
argocd.argoproj.io/hook: PostSync
4042
argocd.argoproj.io/hook-delete-policy: HookSucceeded
41-
# -- (Optional) Extra environment variables to pass to the job container
43+
# -- (Optional) Extra environment variables to pass to the job container.
4244
extraEnv: []
4345
# - name: MY_CUSTOM_VAR
4446
# value: "custom-value"
47+
# -- (Optional) Extra volumes to mount into the job container.
48+
extraVolumes: []
49+
# - name: my-random-volume
50+
# configMap:
51+
# name: my-random-config
52+
# -- (Optional) Extra volume mounts for the job container.
53+
extraVolumeMounts: []
54+
# - name: my-random-volume
55+
# mountPath: /random/path
56+
# readOnly: true
4557

4658
cronJob:
4759
# -- Create a cronJob.

0 commit comments

Comments
 (0)