You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2020/10/21 15:01:20 UTC
[skywalking-kubernetes] branch refactor2 updated (9f39bc6 ->
a6ab928)
This is an automated email from the ASF dual-hosted git repository.
kezhenxu94 pushed a change to branch refactor2
in repository https://gitbox.apache.org/repos/asf/skywalking-kubernetes.git.
discard 9f39bc6 Allow overriding arbitrary files under /skywalking/config and only start es-init when the storage type is ES
new a6ab928 Allow overriding arbitrary files under /skywalking/config and only start es-init when the storage type is ES
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (9f39bc6)
\
N -- N -- N refs/heads/refactor2 (a6ab928)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
...-override-alarm-settings-yml.yaml => oap-cm-override.yaml} | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
rename chart/skywalking/templates/{oap-cm-override-alarm-settings-yml.yaml => oap-cm-override.yaml} (74%)
[skywalking-kubernetes] 01/01: Allow overriding arbitrary files
under /skywalking/config and only start es-init when the storage type is ES
Posted by ke...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kezhenxu94 pushed a commit to branch refactor2
in repository https://gitbox.apache.org/repos/asf/skywalking-kubernetes.git
commit a6ab9280993d8e222a38842138e280279b0d9313
Author: kezhenxu94 <ke...@163.com>
AuthorDate: Wed Oct 21 22:58:21 2020 +0800
Allow overriding arbitrary files under /skywalking/config and only start es-init when the storage type is ES
---
chart/skywalking/templates/es-init.job.yaml | 5 +-
.../oap-cm-override-alarm-settings-yml.yaml | 27 -----------
.../templates/oap-cm-override-application.yaml | 27 -----------
.../oap-cm-override-endpoint-name-grouping.yaml | 27 -----------
...m-override-log4j2.yaml => oap-cm-override.yaml} | 11 +++--
chart/skywalking/templates/oap-deployment.yaml | 56 +++++-----------------
6 files changed, 23 insertions(+), 130 deletions(-)
diff --git a/chart/skywalking/templates/es-init.job.yaml b/chart/skywalking/templates/es-init.job.yaml
index 936e05b..8234552 100644
--- a/chart/skywalking/templates/es-init.job.yaml
+++ b/chart/skywalking/templates/es-init.job.yaml
@@ -14,6 +14,8 @@
# limitations under the License.
# https://docs.sentry.io/server/installation/docker/#running-migrations
+
+{{- if hasPrefix .Values.oap.storageType "elasticsearch" }}
apiVersion: batch/v1
kind: Job
metadata:
@@ -35,7 +37,7 @@ spec:
spec:
restartPolicy: Never
initContainers:
- {{- include "skywalking.containers.wait-for-es" . | nindent 6 }}
+ {{- include "skywalking.containers.wait-for-es" . | nindent 6 }}
containers:
- name: {{ .Values.oap.name }}
image: {{ .Values.oap.image.repository }}:{{ required "oap.image.tag is required" .Values.oap.image.tag }}
@@ -69,3 +71,4 @@ spec:
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
+{{- end}}
diff --git a/chart/skywalking/templates/oap-cm-override-alarm-settings-yml.yaml b/chart/skywalking/templates/oap-cm-override-alarm-settings-yml.yaml
deleted file mode 100644
index be03aee..0000000
--- a/chart/skywalking/templates/oap-cm-override-alarm-settings-yml.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-# 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/oap/alarm-settings.yml") }}
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: {{ template "skywalking.fullname" . }}-override-alarm-settings-yml
- labels:
- app: {{ template "skywalking.name" . }}
- release: {{ .Release.Name }}
- component: {{ .Values.oap.name }}
-data:
-{{ (.Files.Glob "files/conf.d/oap/alarm-settings.yml").AsConfig | indent 2 }}
-{{- end }}
diff --git a/chart/skywalking/templates/oap-cm-override-application.yaml b/chart/skywalking/templates/oap-cm-override-application.yaml
deleted file mode 100644
index 329a0af..0000000
--- a/chart/skywalking/templates/oap-cm-override-application.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-# 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/oap/application.yml") }}
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: {{ template "skywalking.fullname" . }}-override-application-yml
- labels:
- app: {{ template "skywalking.name" . }}
- release: {{ .Release.Name }}
- component: {{ .Values.oap.name }}
-data:
-{{ (.Files.Glob "files/conf.d/oap/application.yml").AsConfig | indent 2 }}
-{{- end }}
diff --git a/chart/skywalking/templates/oap-cm-override-endpoint-name-grouping.yaml b/chart/skywalking/templates/oap-cm-override-endpoint-name-grouping.yaml
deleted file mode 100644
index 2242a71..0000000
--- a/chart/skywalking/templates/oap-cm-override-endpoint-name-grouping.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-# 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/oap/endpoint-name-grouping.yml") }}
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: {{ template "skywalking.fullname" . }}-override-endpoint-name-grouping-yml
- labels:
- app: {{ template "skywalking.name" . }}
- release: {{ .Release.Name }}
- component: {{ .Values.oap.name }}
-data:
-{{ (.Files.Glob "files/conf.d/oap/endpoint-name-grouping.yml").AsConfig | indent 2 }}
-{{- end }}
diff --git a/chart/skywalking/templates/oap-cm-override-log4j2.yaml b/chart/skywalking/templates/oap-cm-override.yaml
similarity index 74%
rename from chart/skywalking/templates/oap-cm-override-log4j2.yaml
rename to chart/skywalking/templates/oap-cm-override.yaml
index 698e28c..f89884d 100644
--- a/chart/skywalking/templates/oap-cm-override-log4j2.yaml
+++ b/chart/skywalking/templates/oap-cm-override.yaml
@@ -13,15 +13,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-{{- if (.Files.Glob "files/conf.d/oap/log4j2.xml") }}
+ {{- if (.Files.Glob "files/conf.d/oap/**") }}
apiVersion: v1
kind: ConfigMap
metadata:
- name: {{ template "skywalking.fullname" . }}-override-log4j2-xml
+ name: {{ template "skywalking.fullname" . }}-oap-cm-override
labels:
app: {{ template "skywalking.name" . }}
release: {{ .Release.Name }}
component: {{ .Values.oap.name }}
data:
-{{ (.Files.Glob "files/conf.d/oap/log4j2.xml").AsConfig | indent 2 }}
-{{- end }}
+ {{ range $path, $bytes := .Files.Glob "files/conf.d/oap/**" }}
+ {{- $path | replace "files/conf.d/oap/" "" | b64enc | replace "=" "-" | indent 2 }}: |
+ {{ $.Files.Get $path | indent 4 }}
+ {{ end }}
+ {{ end }}
diff --git a/chart/skywalking/templates/oap-deployment.yaml b/chart/skywalking/templates/oap-deployment.yaml
index 11dacd0..bafbcf0 100644
--- a/chart/skywalking/templates/oap-deployment.yaml
+++ b/chart/skywalking/templates/oap-deployment.yaml
@@ -77,7 +77,9 @@ spec:
{{ toYaml .Values.oap.tolerations | indent 8 }}
{{- end }}
initContainers:
- {{- include "skywalking.containers.wait-for-es" . | nindent 6 }}
+ {{- if hasPrefix .Values.oap.storageType "elasticsearch" }}
+ {{- include "skywalking.containers.wait-for-es" . | nindent 6 }}
+ {{- end }}
containers:
- name: {{ .Values.oap.name }}
image: {{ .Values.oap.image.repository }}:{{ required "oap.image.tag is required" .Values.oap.image.tag }}
@@ -103,7 +105,7 @@ spec:
{{- end }}
env:
- name: JAVA_OPTS
- value: "{{ .Values.oap.javaOpts }} -Dmode=no-init"
+ value: "-Dmode=no-init {{ .Values.oap.javaOpts }}"
- name: SW_CLUSTER
value: kubernetes
- name: SW_CLUSTER_K8S_NAMESPACE
@@ -144,51 +146,17 @@ spec:
{{- end }}
volumeMounts:
- {{- if (.Files.Glob "files/conf.d/oap/application.yml") }}
- - name: skywalking-override-application-yml
- mountPath: /skywalking/config/application.yml
- subPath: application.yml
- {{- end }}
-
- {{- if (.Files.Glob "files/conf.d/oap/log4j2.xml") }}
- - name: skywalking-override-log4j2-xml
- mountPath: /skywalking/config/log4j2.xml
- subPath: log4j2.xml
- {{- end }}
-
- {{- if (.Files.Glob "files/conf.d/oap/alarm-settings.yml") }}
- - name: skywalking-override-alarm-settings-yml
- mountPath: /skywalking/config/alarm-settings.yml
- subPath: alarm-settings.yml
+ {{- if (.Files.Glob "files/conf.d/oap/**") }}
+ {{ range $path, $bytes := .Files.Glob "files/conf.d/oap/**" }}
+ - name: skywalking-oap-override
+ mountPath: {{ print "/skywalking/config/" ($path | replace "files/conf.d/oap/" "") }}
+ subPath: {{ $path | replace "files/conf.d/oap/" "" | b64enc | replace "=" "-" }}
{{- end }}
-
- {{- if (.Files.Glob "files/conf.d/oap/endpoint-name-grouping.yml") }}
- - name: skywalking-override-endpoint-name-grouping-yml
- mountPath: /skywalking/config/endpoint-name-grouping.yml
- subPath: endpoint-name-grouping.yml
{{- end }}
volumes:
- {{- if (.Files.Glob "files/conf.d/oap/application.yml") }}
- - name: skywalking-override-application-yml
- configMap:
- name: {{ template "skywalking.fullname" . }}-override-application-yml
- {{- end }}
-
- {{- if (.Files.Glob "files/conf.d/oap/log4j2.xml") }}
- - name: skywalking-override-log4j2-xml
- configMap:
- name: {{ template "skywalking.fullname" . }}-override-log4j2-xml
- {{- end }}
-
- {{- if (.Files.Glob "files/conf.d/oap/alarm-settings.yml") }}
- - name: skywalking-override-alarm-settings-yml
- configMap:
- name: {{ template "skywalking.fullname" . }}-override-alarm-settings-yml
- {{- end }}
-
- {{- if (.Files.Glob "files/conf.d/oap/endpoint-name-grouping.yml") }}
- - name: skywalking-override-endpoint-name-grouping-yml
+ {{- if (.Files.Glob "files/conf.d/oap/**") }}
+ - name: skywalking-oap-override
configMap:
- name: {{ template "skywalking.fullname" . }}-override-endpoint-name-grouping-yml
+ name: {{ template "skywalking.fullname" . }}-oap-cm-override
{{- end }}