From a438fd524b0495134943ef41ad44c7dc47398f47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lui=CC=81s=20Marques?= Date: Fri, 18 Oct 2024 13:03:42 +0100 Subject: [PATCH 1/2] ops(helm): add imagePullSecrets support --- deploy/helm/galaxy/README.md | 1 + deploy/helm/galaxy/templates/cronjob.yaml | 6 +++++- deploy/helm/galaxy/templates/deployment.yaml | 4 ++++ deploy/helm/galaxy/values.yaml | 8 ++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/deploy/helm/galaxy/README.md b/deploy/helm/galaxy/README.md index ad3934d..4d1841c 100644 --- a/deploy/helm/galaxy/README.md +++ b/deploy/helm/galaxy/README.md @@ -21,6 +21,7 @@ Rely Galaxy Framework Helm chart for Kubernetes | image.pullPolicy | string | `"IfNotPresent"` | Pull policy for the image | | image.repository | string | `"devrelyio/galaxy"` | | | image.tag | string | `""` | Tag to use for deploying the application | +| imagePullSecrets | list | `[]` | The image pull secrets to use for pulling the image imagePullSecrets is an array of objects with the following keys name -- The name of the image pull secret eg.: imagePullSecrets: - name: myregistrykey https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ | | integration | object | `{"apiUrl":"https://magneto.rely.io/","daemonInterval":60,"executionType":"cronjob","type":null}` | The configuration for the integration | | integration.apiUrl | string | `"https://magneto.rely.io/"` | The url for the Rely API | | integration.daemonInterval | int | `60` | The interval in minutes at which the integration should run only required if the execution type is daemon | diff --git a/deploy/helm/galaxy/templates/cronjob.yaml b/deploy/helm/galaxy/templates/cronjob.yaml index e59b0ab..bbe110b 100644 --- a/deploy/helm/galaxy/templates/cronjob.yaml +++ b/deploy/helm/galaxy/templates/cronjob.yaml @@ -27,10 +27,14 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 12 }} + {{- end }} serviceAccountName: {{ include "galaxy-helm.serviceAccountName" . }} {{- with .Values.podSecurityContext }} securityContext: - {{- toYaml . | nindent 10 }} + {{- toYaml . | nindent 12 }} {{- end }} containers: - name: {{ .Chart.Name }} diff --git a/deploy/helm/galaxy/templates/deployment.yaml b/deploy/helm/galaxy/templates/deployment.yaml index 9a80774..8c8f08c 100644 --- a/deploy/helm/galaxy/templates/deployment.yaml +++ b/deploy/helm/galaxy/templates/deployment.yaml @@ -24,6 +24,10 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} serviceAccountName: {{ include "galaxy-helm.serviceAccountName" . }} {{- with .Values.podSecurityContext }} securityContext: diff --git a/deploy/helm/galaxy/values.yaml b/deploy/helm/galaxy/values.yaml index 0285f1b..20798a5 100644 --- a/deploy/helm/galaxy/values.yaml +++ b/deploy/helm/galaxy/values.yaml @@ -51,6 +51,14 @@ env: # env.RELY_INTEGRATION_ID -- The identifier of this integration instance RELY_INTEGRATION_ID: +# imagePullSecrets -- The image pull secrets to use for pulling the image +# imagePullSecrets is an array of objects with the following keys +# name -- The name of the image pull secret +# eg.: +# imagePullSecrets: +# - name: myregistrykey +# https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ +imagePullSecrets: [] # nameOverride -- Override the name of the chart nameOverride: "" # fullnameOverride -- Override the fullname of the chart From 13d48e66bd04c675a931d02c355cd89756674523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lui=CC=81s=20Marques?= Date: Fri, 18 Oct 2024 13:08:34 +0100 Subject: [PATCH 2/2] ops(helm): set container resources in cronjob --- deploy/helm/galaxy/templates/cronjob.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/deploy/helm/galaxy/templates/cronjob.yaml b/deploy/helm/galaxy/templates/cronjob.yaml index bbe110b..f210b13 100644 --- a/deploy/helm/galaxy/templates/cronjob.yaml +++ b/deploy/helm/galaxy/templates/cronjob.yaml @@ -68,7 +68,19 @@ spec: - secretRef: name: {{ include "galaxy-helm.fullname" . }} {{- end }} + {{- with .Values.resources }} + resources: + {{- toYaml . | nindent 14 }} + {{- end }} + {{- with .Values.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 14 }} + {{- end }} restartPolicy: Never + {{- with .Values.volumes }} + volumes: + {{- toYaml . | nindent 12 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 12 }}