Skip to content

Commit

Permalink
Merge pull request #302 from CAAPIM/custom_volumes_ic_sc
Browse files Browse the repository at this point in the history
charts/gateway added customInit and Sidecar volumes
  • Loading branch information
burbanski authored Mar 14, 2024
2 parents 6a22458 + b85803c commit 90013b3
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/gateway/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "11.0.00_CR2"
description: This Helm Chart deploys the Layer7 Gateway in Kubernetes.
name: gateway
version: 3.0.23
version: 3.0.24
type: application
home: https://github.com/CAAPIM/apim-charts
maintainers:
Expand Down
6 changes: 6 additions & 0 deletions charts/gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ The Layer7 API Gateway is now running with Java 11 with the release of the v10.1

Things to note and be aware of are the deprecation of TLSv1.0/TLSv1.1 and the JAVA_HOME dir has gone through some changes as well.

## 3.0.24 General Updates
- Custom Volumes for initContainers and Sidecars
- This allows configmaps/secrets to be mounted to initContainers and sideCars
- customSideCarVolumes
- customInitVolumes

## 3.0.23 OTK 4.6.2_202402 Released
- Updated OTK image version value

Expand Down
8 changes: 8 additions & 0 deletions charts/gateway/production-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,14 @@ sidecars: []
## containerPort: 1234
##

# customSideCarVolumes applies to sidecars. By default volumes of type emptyDir are automatically created for sidecars and initContainers. This config allows you to override that
# Filtering is done by name, make sure that the volumeMount and volume names are the same.
customSideCarVolumes: []

# customInitVolumes applies to initContainers. By default volumes of type emptyDir are automatically created for volumeMounts in initContainers. This config allows you to override that
# Filtering is done by name, make sure that the volumeMount and volume names are the same.
customInitVolumes: []

# Configure custom hosts
customHosts:
enabled: false
Expand Down
73 changes: 67 additions & 6 deletions charts/gateway/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,28 @@ spec:
mountPath: /opt/SecureSpan/Gateway/node/default/etc/bootstrap/bundle/000OTK
{{- end }}
{{- if .Values.sidecars }}
{{- range .Values.sidecars }}
{{- range .volumeMounts }}
{{- range .Values.sidecars }}
{{- range .volumeMounts }}
{{- $vn := .name }}
{{ $duplicate := false}}
{{- if $.Values.initContainers}}
{{- range $_,$ic := $.Values.initContainers }}
{{- range $_,$icvm := $ic.volumeMounts }}
{{- if eq $vn $icvm.name }}
{{ $duplicate = true}}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{ if not $duplicate }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
{{ if .subPath }}
subPath: {{ .subPath }}
{{ end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
envFrom:
- configMapRef:
Expand Down Expand Up @@ -608,9 +621,27 @@ spec:
{{- end }}
{{- if .Values.initContainers }}
{{- range .Values.initContainers }}
{{- $cvIndex := 0 }}
{{- range .volumeMounts }}
- name: {{ .name }}
{{- $vn := .name }}
{{- $found := false }}
{{- $cvIndex = 0 }}
{{- if $.Values.customInitVolumes }}
{{- range $i,$cv := $.Values.customInitVolumes }}
{{- if eq $vn $cv.name }}
{{- $found = true }}
{{- $cvIndex = $i }}
{{- end }}
{{- end }}
{{- end }}
{{- if eq $found true }}
{{- with (index $.Values.customInitVolumes $cvIndex) }}
- {{- toYaml . | nindent 10}}
{{- end }}
{{- else }}
- name: {{ $vn }}
emptyDir: {}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -642,9 +673,39 @@ spec:
{{- end }}
{{- if .Values.sidecars }}
{{- range .Values.sidecars }}
{{- $cvIndex := 0 }}
{{- range .volumeMounts }}
- name: {{ .name }}
{{- $vn := .name }}
{{- $found := false }}
{{- $duplicate := false }}
{{- $cvIndex = 0 }}
{{- if $.Values.initContainers }}
{{- range $_,$ic := $.Values.initContainers }}
{{- range $_,$icvm := $ic.volumeMounts }}
{{- if eq $vn $icvm.name }}
{{- $duplicate = true }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if $.Values.customSideCarVolumes }}
{{- range $i,$cv := $.Values.customSideCarVolumes }}
{{- if eq $vn $cv.name }}
{{- $found = true }}
{{- $cvIndex = $i }}
{{- end }}
{{- end }}
{{- end }}
{{- if not $duplicate }}
{{- if $found }}
{{- with (index $.Values.customSideCarVolumes $cvIndex) }}
- {{- toYaml . | nindent 10}}
{{- end }}
{{- else }}
- name: {{ $vn }}
emptyDir: {}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/gateway/templates/pm-tagger-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spec:
- name: {{ template "gateway.imagePullSecret" . }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
- name: {{ .Chart.Name }}-pm-tagger
image: {{.Values.pmtagger.image.registry}}/{{.Values.pmtagger.image.repository}}:{{.Values.pmtagger.image.tag}}
imagePullPolicy: {{ .Values.pmtagger.image.pullPolicy }}
{{- if .Values.pmtagger.containerSecurityContext }}
Expand Down
8 changes: 8 additions & 0 deletions charts/gateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,14 @@ sidecars: []
## containerPort: 1234
##

# customSideCarVolumes applies to sidecars. By default volumes of type emptyDir are automatically created for sidecars and initContainers. This config allows you to override that
# Filtering is done by name, make sure that the volumeMount and volume names are the same.
customSideCarVolumes: []

# customInitVolumes applies to initContainers. By default volumes of type emptyDir are automatically created for volumeMounts in initContainers. This config allows you to override that
# Filtering is done by name, make sure that the volumeMount and volume names are the same.
customInitVolumes: []

# Configure custom hosts
customHosts:
enabled: false
Expand Down

0 comments on commit 90013b3

Please sign in to comment.