Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions chart/skywalking/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,56 @@ Define the banyandb grpc port
{{- .Values.banyandb.cluster.liaison.grpcSvc.port -}}
{{- end -}}
{{- end -}}

{{/*
Define volumeMounts for OAP containers
*/}}
{{- define "skywalking.oap.volumeMounts" -}}
{{- range $path, $config := .Values.oap.config }}
{{- if typeIs "string" $config }}
- name: skywalking-oap-override
mountPath: /skywalking/config/{{ $path }}
subPath: {{ $path }}
{{- else }}
{{- range $subpath, $subconfig := $config }}
{{- if typeIs "string" $subconfig }}
- name: skywalking-oap-override
mountPath: /skywalking/config/{{ $path }}/{{ $subpath }}
subPath: {{ print $path "-" $subpath }}
{{- else }}
{{- range $subsubpath, $subsubconfig := $subconfig }}
- name: skywalking-oap-override
mountPath: /skywalking/config/{{ $path }}/{{ $subpath }}/{{ $subsubpath }}
subPath: {{ print $path "-" $subpath "-" $subsubpath }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- range .Values.oap.secretMounts }}
- name: {{ .name }}
mountPath: {{ .path }}
{{- if .subPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- end -}}

{{/*
Define volumes for OAP containers
*/}}
{{- define "skywalking.oap.volumes" -}}
{{- if .Values.oap.config }}
- name: skywalking-oap-override
configMap:
name: {{ template "skywalking.fullname" . }}-oap-cm-override
{{- end }}
{{- range .Values.oap.secretMounts }}
- name: {{ .name }}
secret:
secretName: {{ .secretName }}
{{- if .defaultMode }}
defaultMode: {{ .defaultMode }}
{{- end }}
{{- end }}
{{- end -}}
43 changes: 2 additions & 41 deletions chart/skywalking/templates/oap-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,46 +164,7 @@ spec:
{{- end }}

volumeMounts:
{{- range $path, $config := .Values.oap.config }}
{{- if typeIs "string" $config }}
- name: skywalking-oap-override
mountPath: /skywalking/config/{{ $path }}
subPath: {{ $path }}
{{- else }}
{{- range $subpath, $subconfig := $config }}
{{- if typeIs "string" $subconfig }}
- name: skywalking-oap-override
mountPath: /skywalking/config/{{ $path }}/{{ $subpath }}
subPath: {{ print $path "-" $subpath }}
{{- else }}
{{- range $subsubpath, $subsubconfig := $subconfig }}
- name: skywalking-oap-override
mountPath: /skywalking/config/{{ $path }}/{{ $subpath }}/{{ $subsubpath }}
subPath: {{ print $path "-" $subpath "-" $subsubpath }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- range .Values.oap.secretMounts }}
- name: {{ .name }}
mountPath: {{ .path }}
{{- if .subPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- include "skywalking.oap.volumeMounts" . | nindent 8 }}

volumes:
{{- if .Values.oap.config }}
- name: skywalking-oap-override
configMap:
name: {{ template "skywalking.fullname" . }}-oap-cm-override
{{- end }}
{{- range .Values.oap.secretMounts }}
- name: {{ .name }}
secret:
secretName: {{ .secretName }}
{{- if .defaultMode }}
defaultMode: {{ .defaultMode }}
{{- end }}
{{- end }}
{{- include "skywalking.oap.volumes" . | nindent 6 }}
35 changes: 2 additions & 33 deletions chart/skywalking/templates/oap-init.job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,38 +85,7 @@ spec:
{{- end }}

volumeMounts:
{{- range $path, $config := .Values.oap.config }}
{{- if typeIs "string" $config }}
- name: skywalking-oap-override
mountPath: /skywalking/config/{{ $path }}
subPath: {{ $path }}
{{- else }}
{{- range $subpath, $oalContent := $config }}
- name: skywalking-oap-override
mountPath: /skywalking/config/{{ $path }}/{{ $subpath }}
subPath: {{ print $path "-" $subpath }}
{{- end }}
{{- end }}
{{- end }}
{{- range .Values.oap.secretMounts }}
- name: {{ .name }}
mountPath: {{ .path }}
{{- if .subPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- include "skywalking.oap.volumeMounts" . | nindent 8 }}

volumes:
{{- if .Values.oap.config }}
- name: skywalking-oap-override
configMap:
name: {{ template "skywalking.fullname" . }}-oap-cm-override
{{- end }}
{{- range .Values.oap.secretMounts }}
- name: {{ .name }}
secret:
secretName: {{ .secretName }}
{{- if .defaultMode }}
defaultMode: {{ .defaultMode }}
{{- end }}
{{- end }}
{{- include "skywalking.oap.volumes" . | nindent 6 }}
Loading