From 5ba4164891553194fd8d2a1a865e43464c64439e Mon Sep 17 00:00:00 2001 From: German Espinoza Tuesta Date: Mon, 19 Aug 2024 08:39:40 -0500 Subject: [PATCH] feat: Adds support for initContainers in deployments (#139) Co-authored-by: German Espinoza --- README.md | 5 +++++ charts/terrakube/Chart.yaml | 2 +- charts/terrakube/templates/deployment-api.yaml | 4 ++++ charts/terrakube/templates/deployment-executor.yaml | 4 ++++ charts/terrakube/templates/deployment-openldap.yaml | 4 ++++ charts/terrakube/templates/deployment-registry.yaml | 4 ++++ charts/terrakube/templates/deployment-ui.yaml | 4 ++++ charts/terrakube/values.yaml | 6 ++++++ 8 files changed, 32 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2cb747b..b26839b 100644 --- a/README.md +++ b/README.md @@ -245,6 +245,7 @@ Once you have completed the above steps you can complete the file values.yaml to | openldap.image | Yes | LDAP deployment image repository | | openldap.version | Yes | LDAP deployment image tag | | openldap.imagePullSecrets | No | Secret used to pull images from private repository | +| openldap.initContainers | No | Init containers for LDAP deployment | | openldap.podLabels | No | Pod labels for LDAP deployment | | openldap.securityContext | No | Security context for LDAP deployment | | openldap.containerSecurityContext | No | Container security context for LDAP deployment | @@ -284,6 +285,7 @@ Once you have completed the above steps you can complete the file values.yaml to | api.securityContext | No | Fill securityContext field | | api.containerSecurityContext | No | Fill securityContext field in the container spec | | api.imagePullSecrets | No | Specific Secret used to pull images from private repository | +| api.initContainers | No | Init containers for API deployment | | executor.enabled | Yes | true/false | | executor.image | No | Executor image repository | | executor.version | Yes | Terrakube Executor version | @@ -298,6 +300,7 @@ Once you have completed the above steps you can complete the file values.yaml to | executor.securityContext | No | Fill securityContext field | | executor.containerSecurityContext | No | Fill securityContext field in the container spec | | executor.imagePullSecrets | No | Specific Secret used to pull images from private repository | +| executor.initContainers | No | Init containers for executor deployment | | registry.enabled | Yes | | | registry.image | No | Registry image repository | | registry.version | Yes | | @@ -310,6 +313,7 @@ Once you have completed the above steps you can complete the file values.yaml to | registry.securityContext | No | Fill securityContext field | | registry.containerSecurityContext | No | Fill securityContext field in the container spec | | registry.imagePullSecrets | No | Specific Secret used to pull images from private repository | +| registry.initContainers | No | Init containers for registry deployment | | ui.enabled | Yes | true/false | | ui.image | No | UI image repository | | ui.version | Yes | | @@ -319,6 +323,7 @@ Once you have completed the above steps you can complete the file values.yaml to | ui.securityContext | No | Fill securityContext field | | ui.containerSecurityContext | No | Fill securityContext field in the container spec | | ui.imagePullSecrets | No | Specific Secret used to pull images from private repository | +| ui.initContainers | No | Init containers for UI deployment | | ingress.ui.ingressClassName | Yes | Default is set to nginx | | ingress.ui.useTls | Yes | true/false | | ingress.ui.enabled | Yes | true/false | diff --git a/charts/terrakube/Chart.yaml b/charts/terrakube/Chart.yaml index d56eda5..d05215b 100644 --- a/charts/terrakube/Chart.yaml +++ b/charts/terrakube/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 3.19.0 +version: 3.20.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/terrakube/templates/deployment-api.yaml b/charts/terrakube/templates/deployment-api.yaml index 80d8e27..b2e008d 100644 --- a/charts/terrakube/templates/deployment-api.yaml +++ b/charts/terrakube/templates/deployment-api.yaml @@ -24,6 +24,10 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.api.initContainers }} + initContainers: + {{- toYaml . | nindent 6 }} + {{- end }} containers: - name: terrakube-api image: {{ .Values.api.image }}:{{ default .Chart.AppVersion .Values.api.version }} diff --git a/charts/terrakube/templates/deployment-executor.yaml b/charts/terrakube/templates/deployment-executor.yaml index 987c9b4..5576565 100644 --- a/charts/terrakube/templates/deployment-executor.yaml +++ b/charts/terrakube/templates/deployment-executor.yaml @@ -24,6 +24,10 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.executor.initContainers }} + initContainers: + {{- toYaml . | nindent 6 }} + {{- end }} containers: - name: terrakube-executor image: {{ .Values.executor.image }}:{{ default .Chart.AppVersion .Values.executor.version }} diff --git a/charts/terrakube/templates/deployment-openldap.yaml b/charts/terrakube/templates/deployment-openldap.yaml index cdaf6fd..9fbb8b4 100644 --- a/charts/terrakube/templates/deployment-openldap.yaml +++ b/charts/terrakube/templates/deployment-openldap.yaml @@ -24,6 +24,10 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.openldap.initContainers }} + initContainers: + {{- toYaml . | nindent 6 }} + {{- end }} containers: - name: terrakube-openldap image: {{ .Values.openldap.image }}:{{ .Values.openldap.version }} diff --git a/charts/terrakube/templates/deployment-registry.yaml b/charts/terrakube/templates/deployment-registry.yaml index ce90682..678885f 100644 --- a/charts/terrakube/templates/deployment-registry.yaml +++ b/charts/terrakube/templates/deployment-registry.yaml @@ -24,6 +24,10 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.registry.initContainers }} + initContainers: + {{- toYaml . | nindent 6 }} + {{- end }} containers: - name: terrakube-registry image: {{ .Values.registry.image }}:{{ default .Chart.AppVersion .Values.registry.version }} diff --git a/charts/terrakube/templates/deployment-ui.yaml b/charts/terrakube/templates/deployment-ui.yaml index f4dcbd1..47dddf2 100644 --- a/charts/terrakube/templates/deployment-ui.yaml +++ b/charts/terrakube/templates/deployment-ui.yaml @@ -24,6 +24,10 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.ui.initContainers }} + initContainers: + {{- toYaml . | nindent 6 }} + {{- end }} containers: - name: terrakube-ui image: {{ .Values.ui.image }}:{{ default .Chart.AppVersion .Values.ui.version }} diff --git a/charts/terrakube/values.yaml b/charts/terrakube/values.yaml index 35a5ad9..cebe6f9 100644 --- a/charts/terrakube/values.yaml +++ b/charts/terrakube/values.yaml @@ -24,6 +24,7 @@ openldap: image: "bitnami/openldap" version: "2.6.4-debian-11-r4" imagePullSecrets: [] + initContainers: [] podLabels: {} securityContext: {} containerSecurityContext: {} @@ -192,6 +193,7 @@ api: securityContext: {} containerSecurityContext: {} imagePullSecrets: [] + initContainers: [] cache: moduleCacheMaxTotal: "128" moduleCacheMaxIdle: "128" @@ -236,6 +238,8 @@ executor: securityContext: {} containerSecurityContext: {} imagePullSecrets: [] + initContainers: [] + ## Registry properties registry: enabled: true @@ -252,6 +256,7 @@ registry: securityContext: {} containerSecurityContext: {} imagePullSecrets: [] + initContainers: [] ## UI Properties ui: @@ -267,6 +272,7 @@ ui: securityContext: {} containerSecurityContext: {} imagePullSecrets: [] + initContainers: [] ## Ingress properties ingress: