From dac1606b3190fd92937e02cc3770c21f66148731 Mon Sep 17 00:00:00 2001 From: ScribblerCoder <35840617+ScribblerCoder@users.noreply.github.com> Date: Mon, 4 Dec 2023 03:49:01 +0300 Subject: [PATCH] Add another subpath level to `values.yaml` oap config override (#142) --- chart/skywalking/templates/oap-cm-override.yaml | 9 ++++++++- chart/skywalking/templates/oap-deployment.yaml | 10 +++++++++- chart/skywalking/values.yaml | 4 ++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/chart/skywalking/templates/oap-cm-override.yaml b/chart/skywalking/templates/oap-cm-override.yaml index 2cf14ad..2e539c1 100644 --- a/chart/skywalking/templates/oap-cm-override.yaml +++ b/chart/skywalking/templates/oap-cm-override.yaml @@ -29,9 +29,16 @@ data: {{ $config | indent 4 }} {{- else }} {{- range $subpath, $subconfig := $config }} + {{- if typeIs "string" $subconfig }} {{ print $path "-" $subpath }}: | {{ $subconfig | indent 4 }} + {{- else }} + {{- range $subsubpath, $subsubconfig := $subconfig }} + {{ print $path "-" $subpath "-" $subsubpath }}: | +{{ $subsubconfig | indent 4 }} + {{- end }} + {{- end }} + {{- end }} {{- end }} {{- end }} -{{- end }} {{ end }} diff --git a/chart/skywalking/templates/oap-deployment.yaml b/chart/skywalking/templates/oap-deployment.yaml index b061ca2..be07c41 100644 --- a/chart/skywalking/templates/oap-deployment.yaml +++ b/chart/skywalking/templates/oap-deployment.yaml @@ -170,10 +170,18 @@ spec: mountPath: /skywalking/config/{{ $path }} subPath: {{ $path }} {{- else }} - {{- range $subpath, $oalContent := $config }} + {{- 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 }} diff --git a/chart/skywalking/values.yaml b/chart/skywalking/values.yaml index a2e2f0a..90c84a1 100644 --- a/chart/skywalking/values.yaml +++ b/chart/skywalking/values.yaml @@ -102,6 +102,10 @@ oap: # # # + # ui-initialized-templates: + # general: + # general-service.json: | + # [{"id":"General-Service" ... }] # When 'dynamicConfig.enabled' set to true, enable oap dynamic configuration through k8s configmap, # Note: The default configmap data is empty, please refer to the detailed documentation (https://github.com/apache/skywalking/blob/master/docs/en/setup/backend/dynamic-config.md) # Sync period in seconds. Defaults to 60 seconds.