Skip to content

Commit

Permalink
Fix the satellite could not run when exists config (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrproliu authored Dec 1, 2021
1 parent 9f42abf commit e6166c0
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
7 changes: 7 additions & 0 deletions chart/skywalking/files/conf.d/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@ Files under `oap/*` will override the counterparts under the Docker image's `/sk
| `files/config.d/oap/oal/browser.oal` | `/skywalking/config/oal/browser.oal` |
| `files/config.d/oap/oc-rules/oap.yaml` | `/skywalking/config/oc-rules/oap.yaml` |
| `...` | `...` |

Files under `satellite/*` will override the counterparts under the Docker image's `/skywalking/configs/*`, with the directory structure retained, here are some examples:

| File under `files/config.d/satellite` directory | Overrides the file under Docker image's `/skywalking/configs/` |
| ---- | -------- |
| `files/config.d/satellite/satellite_config.yaml` | `/skywalking/configs/satellite_config.yaml` |
| `...` | `...` |
30 changes: 30 additions & 0 deletions chart/skywalking/templates/satellite-cm-override.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

{{- if (.Files.Glob "files/conf.d/satellite/**") }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "skywalking.fullname" . }}-satellite-cm-override
labels:
app: {{ template "skywalking.name" . }}
release: {{ .Release.Name }}
component: {{ .Values.satellite.name }}
binaryData:
{{ range $path, $bytes := .Files.Glob "files/conf.d/satellite/**" }}
{{- $path | replace "files/conf.d/satellite/" "" | b64enc | replace "=" "-" | indent 2 }}: |
{{ $.Files.Get $path | b64enc | indent 4 }}
{{ end }}
{{ end }}
2 changes: 1 addition & 1 deletion chart/skywalking/templates/satellite-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ spec:
{{- if (.Files.Glob "files/conf.d/satellite/**") }}
{{ range $path, $bytes := .Files.Glob "files/conf.d/satellite/**" }}
- name: skywalking-satellite-override
mountPath: {{ print "/skywalking/config/" ($path | replace "files/conf.d/satellite/" "") }}
mountPath: {{ print "/skywalking/configs/" ($path | replace "files/conf.d/satellite/" "") }}
subPath: {{ $path | replace "files/conf.d/satellite/" "" | b64enc | replace "=" "-" }}
{{- end }}
{{- end }}
Expand Down

0 comments on commit e6166c0

Please sign in to comment.