Skip to content

Commit

Permalink
feat: add helm chart more re-suable (#41)
Browse files Browse the repository at this point in the history
* feat: add helm chart more re-suable

* feat: PR changes addressed
  • Loading branch information
xavidop authored Sep 30, 2022
1 parent 5c1e8dd commit a3d1bb6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
4 changes: 3 additions & 1 deletion chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ apiVersion: v2
appVersion: 1.7.1
description: Deploys a cronJob which will renew ECR imagePullSecrets automatically
name: k8s-ecr-login-renew
version: 1.0.1
version: 1.0.2
maintainers:
- name: Nabeel Sulieman
url: https://nabeel.dev
- name: James "ec0" Hebden
email: [email protected]
- name: Xavier Portilla Edo
email: [email protected]
keywords:
- aws
- ecr
Expand Down
11 changes: 7 additions & 4 deletions chart/templates/005-CronJob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
spec:
schedule: "* */6 * * *"
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 5
schedule: "{{ required "Schedule is required" .Values.cronjob.schedule }}"
successfulJobsHistoryLimit: {{ required "Success job history limit is required" .Values.cronjob.successfulJobsHistoryLimit }}
failedJobsHistoryLimit: {{ required "Failed job history limit is required" .Values.cronjob.failedJobsHistoryLimit }}
{{- if .Values.cronjob.startingDeadlineSeconds }}
startingDeadlineSeconds: {{ .Values.cronjob.startingDeadlineSeconds }}
{{- end }}
jobTemplate:
spec:
template:
Expand All @@ -32,7 +35,7 @@ spec:
{{- end }}
spec:
serviceAccountName: {{ required "Service account name is required" .Values.names.serviceAcount }}
terminationGracePeriodSeconds: 0
terminationGracePeriodSeconds: {{ required "Termination grace period is required" .Values.cronjob.terminationGracePeriodSeconds }}
restartPolicy: Never
containers:
- name: k8s-ecr-login-renew
Expand Down
13 changes: 13 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ targetNamespace: "default"
# Example: registries: https://ACCOUNT_2_ID.dkr.ecr.us-east-1.amazonaws.com,https://ACCOUNT_2_ID.dkr.ecr.us-east-1.amazonaws.com
registries: null

cronjob:
# the schedule of the cronjob
schedule: "0 */6 * * *"

# Success job history limit
successfulJobsHistoryLimit: 3

# Failed job history limit
failedJobsHistoryLimit: 5

# Termination grace period Seconds
terminationGracePeriodSeconds: 0

# Set this to false in order to generate raw YAML that can be used without Helm
# The main difference is that the default Helm labels are not added to the objects.
forHelm: true
Expand Down

0 comments on commit a3d1bb6

Please sign in to comment.