This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-kubernetes.git
The following commit(s) were added to refs/heads/master by this push:
new b670c41 Remove `files/config.d` mechanism and use `values.yaml` files
to put the configurations to override default config (#99)
b670c41 is described below
commit b670c41d94a82ddefcf466d54bab5c492d88d772
Author: kezhenxu94 <[email protected]>
AuthorDate: Tue Nov 22 18:16:53 2022 +0800
Remove `files/config.d` mechanism and use `values.yaml` files to put the
configurations to override default config (#99)
---
CHANGES.md | 11 +++++++++++
chart/skywalking/files/conf.d/README.md | 23 ----------------------
chart/skywalking/files/conf.d/oap/.gitignore | 1 -
chart/skywalking/templates/oap-cm-override.yaml | 21 +++++++++++++-------
chart/skywalking/templates/oap-deployment.yaml | 16 ++++++++++-----
.../templates/satellite-cm-override.yaml | 19 ++++++++++++------
.../skywalking/templates/satellite-deployment.yaml | 16 ++++++++++-----
chart/skywalking/values.yaml | 23 +++++++++++++++++++++-
test/e2e/e2e.yaml | 9 ++++-----
.../{metadata-service-mapping.yaml => values.yaml} | 7 +++++--
10 files changed, 91 insertions(+), 55 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index 088fcb1..6a39918 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -2,6 +2,17 @@ Changes by Version
==================
Release Notes.
+4.4.0
+------------------
+
+- [**Breaking Change**]: remove `.Values.oap.initEs`, there is no need to use
this to control whether to run init job anymore,
+ SkyWalking Helm Chart automatically delete the init job when
installing/upgrading.
+- [**Breaking Change**]: remove `files/config.d` mechanism and use
`values.yaml` files to put the configurations to override
+ default config files in the `/skywalking/config` folder, using
`files/config.d` is very limited and you have to clone the source
+ codes if you want to use this mechanism, now you can simply use our [Docker
Helm Chart](https://hub.docker.com/repository/docker/apache/skywalking-helm) to
install.
+- Refactor oap init job, and support postgresql storage.
+- Upgrade ElasticSearch Helm Chart dependency version.
+
4.3.0
------------------
diff --git a/chart/skywalking/files/conf.d/README.md
b/chart/skywalking/files/conf.d/README.md
deleted file mode 100644
index 18d50ac..0000000
--- a/chart/skywalking/files/conf.d/README.md
+++ /dev/null
@@ -1,23 +0,0 @@
-If you don't want to use the default configuration files packed into the
Docker image,
-put your own configuration files under this directory in the corresponding
component subdirectory,
-`oap`, `ui`, etc.
-
-Files under `oap/*` will override the counterparts under the Docker image's
`/skywalking/config/*`, with the directory structure retained, here are some
examples:
-
-| File under `files/config.d/oap` directory | Overrides the file under Docker
image's `/skywalking/config/` |
-| ---- | -------- |
-| `files/config.d/oap/application.yml` |
`/skywalking/config/application.yml` |
-| `files/config.d/oap/log4j2.xml` |
`/skywalking/config/log4j2.xml` |
-| `files/config.d/oap/alarm-settings.yml` |
`/skywalking/config/alarm-settings.yml` |
-| `files/config.d/oap/endpoint-name-grouping.yml` |
`/skywalking/config/endpoint-name-grouping.yml` |
-| `files/config.d/oap/oal/core.oal` |
`/skywalking/config/oal/core.oal` |
-| `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` |
-| `...` | `...`
|
diff --git a/chart/skywalking/files/conf.d/oap/.gitignore
b/chart/skywalking/files/conf.d/oap/.gitignore
deleted file mode 100644
index 72e8ffc..0000000
--- a/chart/skywalking/files/conf.d/oap/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*
diff --git a/chart/skywalking/templates/oap-cm-override.yaml
b/chart/skywalking/templates/oap-cm-override.yaml
index d39b97d..2cf14ad 100644
--- a/chart/skywalking/templates/oap-cm-override.yaml
+++ b/chart/skywalking/templates/oap-cm-override.yaml
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- {{- if (.Files.Glob "files/conf.d/oap/**") }}
+{{- if .Values.oap.config }}
apiVersion: v1
kind: ConfigMap
metadata:
@@ -22,9 +22,16 @@ metadata:
app: {{ template "skywalking.name" . }}
release: {{ .Release.Name }}
component: {{ .Values.oap.name }}
-binaryData:
- {{ range $path, $bytes := .Files.Glob "files/conf.d/oap/**" }}
- {{- $path | replace "files/conf.d/oap/" "" | b64enc | replace "=" "-" |
indent 2 }}: |
- {{ $.Files.Get $path | b64enc | indent 4 }}
- {{ end }}
- {{ end }}
+data:
+{{- range $path, $config := .Values.oap.config }}
+ {{- if typeIs "string" $config }}
+ {{ $path }}: |
+{{ $config | indent 4 }}
+ {{- else }}
+ {{- range $subpath, $subconfig := $config }}
+ {{ print $path "-" $subpath }}: |
+{{ $subconfig | indent 4 }}
+ {{- end }}
+ {{- end }}
+{{- end }}
+{{ end }}
diff --git a/chart/skywalking/templates/oap-deployment.yaml
b/chart/skywalking/templates/oap-deployment.yaml
index 5406f64..6d330f5 100644
--- a/chart/skywalking/templates/oap-deployment.yaml
+++ b/chart/skywalking/templates/oap-deployment.yaml
@@ -131,16 +131,22 @@ spec:
{{- end }}
volumeMounts:
- {{- if (.Files.Glob "files/conf.d/oap/**") }}
- {{ range $path, $bytes := .Files.Glob "files/conf.d/oap/**" }}
+ {{- range $path, $config := .Values.oap.config }}
+ {{- if typeIs "string" $config }}
- name: skywalking-oap-override
- mountPath: {{ print "/skywalking/config/" ($path | replace
"files/conf.d/oap/" "") }}
- subPath: {{ $path | replace "files/conf.d/oap/" "" | b64enc |
replace "=" "-" }}
+ 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 }}
volumes:
- {{- if (.Files.Glob "files/conf.d/oap/**") }}
+ {{- if .Values.oap.config }}
- name: skywalking-oap-override
configMap:
name: {{ template "skywalking.fullname" . }}-oap-cm-override
diff --git a/chart/skywalking/templates/satellite-cm-override.yaml
b/chart/skywalking/templates/satellite-cm-override.yaml
index ed61bee..1533dee 100644
--- a/chart/skywalking/templates/satellite-cm-override.yaml
+++ b/chart/skywalking/templates/satellite-cm-override.yaml
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-{{- if (.Files.Glob "files/conf.d/satellite/**") }}
+{{- if .Values.satellite.config }}
apiVersion: v1
kind: ConfigMap
metadata:
@@ -22,9 +22,16 @@ metadata:
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 }}
+data:
+{{- range $path, $config := .Values.satellite.config }}
+ {{- if typeIs "string" $config }}
+ {{ $path }}: |
+{{ $config | indent 4 }}
+ {{- else }}
+ {{- range $subpath, $subconfig := $config }}
+ {{ print $path "-" $subpath }}: |
+{{ $subconfig | indent 4 }}
+ {{- end }}
+ {{- end }}
+{{- end }}
{{ end }}
diff --git a/chart/skywalking/templates/satellite-deployment.yaml
b/chart/skywalking/templates/satellite-deployment.yaml
index f17e78c..2659904 100644
--- a/chart/skywalking/templates/satellite-deployment.yaml
+++ b/chart/skywalking/templates/satellite-deployment.yaml
@@ -116,11 +116,17 @@ spec:
{{- end }}
volumeMounts:
- {{- if (.Files.Glob "files/conf.d/satellite/**") }}
- {{ range $path, $bytes := .Files.Glob "files/conf.d/satellite/**" }}
+ {{- range $path, $config := .Values.satellite.config }}
+ {{- if typeIs "string" $config }}
- name: skywalking-satellite-override
- mountPath: {{ print "/skywalking/configs/" ($path | replace
"files/conf.d/satellite/" "") }}
- subPath: {{ $path | replace "files/conf.d/satellite/" "" | b64enc
| replace "=" "-" }}
+ mountPath: /skywalking/config/{{ $path }}
+ subPath: {{ $path }}
+ {{- else }}
+ {{- range $subpath, $oalContent := $config }}
+ - name: skywalking-satellite-override
+ mountPath: /skywalking/config/{{ $path }}/{{ $subpath }}
+ subPath: {{ print $path "-" $subpath }}
+ {{- end }}
{{- end }}
{{- end }}
@@ -130,4 +136,4 @@ spec:
configMap:
name: {{ template "skywalking.fullname" . }}-satellite-cm-override
{{- end }}
-{{- end }}
\ No newline at end of file
+{{- end }}
diff --git a/chart/skywalking/values.yaml b/chart/skywalking/values.yaml
index 174eab6..2e79715 100644
--- a/chart/skywalking/values.yaml
+++ b/chart/skywalking/values.yaml
@@ -37,7 +37,6 @@ oap:
tag: null # Must be set explicitly
pullPolicy: IfNotPresent
storageType: null
- initEs: true # Whether need to initial ES
ports:
# add more ports here if you need, for example
# zabbix: 10051
@@ -68,6 +67,23 @@ oap:
# more env, please refer to
https://hub.docker.com/r/apache/skywalking-oap-server
# or
https://github.com/apache/skywalking-docker/blob/master/6/6.4/oap/README.md#sw_telemetry
+ # Allows you to add any config files in /skywalking/config
+ # such as log4j2.xml, oal/core.oal, etc.
+ config: {}
+ # metadata-service-mapping.yaml: |
+ # serviceName: e2e::${LABELS."service.istio.io/canonical-name"}
+ # serviceInstanceName: ${NAME}
+ # oal:
+ # core.oal: |
+ # service_resp_time = from(Service.latency).longAvg();
+ # service_sla = from(Service.*).percent(status == true);
+ # service_cpm = from(Service.*).cpm();
+ # log4j2.xml: |
+ # <Configuration status="DEBUG">
+ # <!-- ... -->
+ # </Configuration>
+
+
ui:
name: ui
replicas: 1
@@ -413,6 +429,11 @@ satellite:
# example: oap-foo
env:
# more env, please refer to
https://skywalking.apache.org/docs/skywalking-satellite/latest/en/setup/readme/#satellite_configyaml
+ # Allows you to add any config files in /skywalking/config.
+ config: {}
+ # satellite_config.yaml: |
+ # key: val
+
nameOverride: ""
fullnameOverride: ""
diff --git a/test/e2e/e2e.yaml b/test/e2e/e2e.yaml
index 0d7d6d2..c7d2ded 100644
--- a/test/e2e/e2e.yaml
+++ b/test/e2e/e2e.yaml
@@ -42,10 +42,8 @@ setup:
command: bash test/e2e/setup-e2e-shell/install.sh helm
- name: Install SkyWalking
command: |
- cd chart
- mkdir -p skywalking/files/conf.d/oap/ && cp
../test/e2e/metadata-service-mapping.yaml
skywalking/files/conf.d/oap/metadata-service-mapping.yaml
- helm dep up skywalking
- helm -n istio-system install skywalking skywalking \
+ helm dep up chart/skywalking
+ helm -n istio-system install skywalking chart/skywalking \
--set fullnameOverride=skywalking \
--set elasticsearch.replicas=1 \
--set elasticsearch.minimumMasterNodes=1 \
@@ -61,7 +59,8 @@ setup:
--set oap.storageType=elasticsearch \
--set satellite.enabled=true \
--set satellite.image.repository=$SATELLITE_REPO \
- --set satellite.image.tag=$SATELLITE_TAG
+ --set satellite.image.tag=$SATELLITE_TAG \
+ -f test/e2e/values.yaml
wait:
- namespace: istio-system
resource: deployments/skywalking-oap
diff --git a/test/e2e/metadata-service-mapping.yaml b/test/e2e/values.yaml
similarity index 83%
rename from test/e2e/metadata-service-mapping.yaml
rename to test/e2e/values.yaml
index 9e58722..82dd914 100644
--- a/test/e2e/metadata-service-mapping.yaml
+++ b/test/e2e/values.yaml
@@ -13,5 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-serviceName: e2e::${LABELS."service.istio.io/canonical-name"}
-serviceInstanceName: ${NAME}
+oap:
+ config:
+ metadata-service-mapping.yaml: |
+ serviceName: e2e::${LABELS."service.istio.io/canonical-name"}
+ serviceInstanceName: ${NAME}