This is an automated email from the ASF dual-hosted git repository.

chenxingchun pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 01ee2b3  [Improvement][K8s] Adapt to the latest alert-server with 
updated config and port 50052
     new 969fba8  Merge pull request #4783 from 
chengshiwen/improve-k8s-adapt-alert-server
01ee2b3 is described below

commit 01ee2b32110371b9588e7e69984a2db8e8ac599e
Author: chengshiwen <[email protected]>
AuthorDate: Wed Feb 17 01:37:55 2021 +0800

    [Improvement][K8s] Adapt to the latest alert-server with updated config and 
port 50052
---
 .../dolphinscheduler/templates/NOTES.txt           |  9 +--
 .../configmap-dolphinscheduler-alert.yaml          | 14 ----
 .../deployment-dolphinscheduler-alert.yaml         | 73 +-------------------
 .../templates/deployment-dolphinscheduler-api.yaml |  2 +-
 .../statefulset-dolphinscheduler-worker.yaml       | 79 +---------------------
 .../{NOTES.txt => svc-dolphinscheduler-alert.yaml} | 34 ++++++----
 docker/kubernetes/dolphinscheduler/values.yaml     | 30 +++-----
 7 files changed, 39 insertions(+), 202 deletions(-)

diff --git a/docker/kubernetes/dolphinscheduler/templates/NOTES.txt 
b/docker/kubernetes/dolphinscheduler/templates/NOTES.txt
index 8afe766..6e2800a 100644
--- a/docker/kubernetes/dolphinscheduler/templates/NOTES.txt
+++ b/docker/kubernetes/dolphinscheduler/templates/NOTES.txt
@@ -15,17 +15,18 @@
 # limitations under the License.
 #
 
-** Please be patient while the chart Dolphinscheduler {{ .Chart.AppVersion }} 
is being deployed **
+** Please be patient while the chart DolphinScheduler {{ .Chart.AppVersion }} 
is being deployed **
 
-Get the Dolphinscheduler URL by running:
+Access DolphinScheduler by:
 
 {{- if .Values.ingress.enabled }}
 
-  export HOSTNAME=$(kubectl get ingress --namespace {{ .Release.Namespace }} 
{{ template "dolphinscheduler.fullname" . }} -o 
jsonpath='{.spec.rules[0].host}')
-  echo "Dolphinscheduler URL: http://$HOSTNAME/";
+  DolphinScheduler URL: http://{{ .Values.ingress.host }}/dolphinscheduler
 
 {{- else }}
 
   kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template 
"dolphinscheduler.fullname" . }}-api 12345:12345
 
+  DolphinScheduler URL: http://127.0.0.1:12345/dolphinscheduler
+
 {{- end }}
diff --git 
a/docker/kubernetes/dolphinscheduler/templates/configmap-dolphinscheduler-alert.yaml
 
b/docker/kubernetes/dolphinscheduler/templates/configmap-dolphinscheduler-alert.yaml
index 2c7dd67..b5ffadd 100644
--- 
a/docker/kubernetes/dolphinscheduler/templates/configmap-dolphinscheduler-alert.yaml
+++ 
b/docker/kubernetes/dolphinscheduler/templates/configmap-dolphinscheduler-alert.yaml
@@ -26,18 +26,4 @@ metadata:
 data:
   DOLPHINSCHEDULER_OPTS: {{ .Values.alert.configmap.DOLPHINSCHEDULER_OPTS | 
quote }}
   ALERT_PLUGIN_DIR: {{ .Values.alert.configmap.ALERT_PLUGIN_DIR | quote }}
-  XLS_FILE_PATH: {{ .Values.alert.configmap.XLS_FILE_PATH | quote }}
-  MAIL_SERVER_HOST: {{ .Values.alert.configmap.MAIL_SERVER_HOST | quote }}
-  MAIL_SERVER_PORT: {{ .Values.alert.configmap.MAIL_SERVER_PORT | quote }}
-  MAIL_SENDER: {{ .Values.alert.configmap.MAIL_SENDER | quote }}
-  MAIL_USER: {{ .Values.alert.configmap.MAIL_USER | quote }}
-  MAIL_PASSWD: {{ .Values.alert.configmap.MAIL_PASSWD | quote }}
-  MAIL_SMTP_STARTTLS_ENABLE: {{ 
.Values.alert.configmap.MAIL_SMTP_STARTTLS_ENABLE | quote }}
-  MAIL_SMTP_SSL_ENABLE: {{ .Values.alert.configmap.MAIL_SMTP_SSL_ENABLE | 
quote }}
-  MAIL_SMTP_SSL_TRUST: {{ .Values.alert.configmap.MAIL_SMTP_SSL_TRUST | quote 
}}
-  ENTERPRISE_WECHAT_ENABLE: {{ 
.Values.alert.configmap.ENTERPRISE_WECHAT_ENABLE | quote }}
-  ENTERPRISE_WECHAT_CORP_ID: {{ 
.Values.alert.configmap.ENTERPRISE_WECHAT_CORP_ID | quote }}
-  ENTERPRISE_WECHAT_SECRET: {{ 
.Values.alert.configmap.ENTERPRISE_WECHAT_SECRET | quote }}
-  ENTERPRISE_WECHAT_AGENT_ID: {{ 
.Values.alert.configmap.ENTERPRISE_WECHAT_AGENT_ID | quote }}
-  ENTERPRISE_WECHAT_USERS: {{ .Values.alert.configmap.ENTERPRISE_WECHAT_USERS 
| quote }}
 {{- end }}
\ No newline at end of file
diff --git 
a/docker/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-alert.yaml
 
b/docker/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-alert.yaml
index e4a2b21..f66427e 100644
--- 
a/docker/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-alert.yaml
+++ 
b/docker/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-alert.yaml
@@ -67,6 +67,9 @@ spec:
           imagePullPolicy: {{ .Values.image.pullPolicy }}
           args:
             - "alert-server"
+          ports:
+            - containerPort: 50052
+              name: "alert-port"
           env:
             - name: TZ
               value: {{ .Values.timezone }}
@@ -80,76 +83,6 @@ spec:
                 configMapKeyRef:
                   key: ALERT_PLUGIN_DIR
                   name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: XLS_FILE_PATH
-              valueFrom:
-                configMapKeyRef:
-                  key: XLS_FILE_PATH
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: MAIL_SERVER_HOST
-              valueFrom:
-                configMapKeyRef:
-                  key: MAIL_SERVER_HOST
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: MAIL_SERVER_PORT
-              valueFrom:
-                configMapKeyRef:
-                  key: MAIL_SERVER_PORT
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: MAIL_SENDER
-              valueFrom:
-                configMapKeyRef:
-                  key: MAIL_SENDER
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: MAIL_USER
-              valueFrom:
-                configMapKeyRef:
-                  key: MAIL_USER
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: MAIL_PASSWD
-              valueFrom:
-                configMapKeyRef:
-                  key: MAIL_PASSWD
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: MAIL_SMTP_STARTTLS_ENABLE
-              valueFrom:
-                configMapKeyRef:
-                  key: MAIL_SMTP_STARTTLS_ENABLE
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: MAIL_SMTP_SSL_ENABLE
-              valueFrom:
-                configMapKeyRef:
-                  key: MAIL_SMTP_SSL_ENABLE
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: MAIL_SMTP_SSL_TRUST
-              valueFrom:
-                configMapKeyRef:
-                  key: MAIL_SMTP_SSL_TRUST
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: ENTERPRISE_WECHAT_ENABLE
-              valueFrom:
-                configMapKeyRef:
-                  key: ENTERPRISE_WECHAT_ENABLE
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: ENTERPRISE_WECHAT_CORP_ID
-              valueFrom:
-                configMapKeyRef:
-                  key: ENTERPRISE_WECHAT_CORP_ID
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: ENTERPRISE_WECHAT_SECRET
-              valueFrom:
-                configMapKeyRef:
-                  key: ENTERPRISE_WECHAT_SECRET
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: ENTERPRISE_WECHAT_AGENT_ID
-              valueFrom:
-                configMapKeyRef:
-                  key: ENTERPRISE_WECHAT_AGENT_ID
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: ENTERPRISE_WECHAT_USERS
-              valueFrom:
-                configMapKeyRef:
-                  key: ENTERPRISE_WECHAT_USERS
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
             - name: DATABASE_TYPE
               {{- if .Values.postgresql.enabled }}
               value: "postgresql"
diff --git 
a/docker/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-api.yaml
 
b/docker/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-api.yaml
index f4b4795..b6af321 100644
--- 
a/docker/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-api.yaml
+++ 
b/docker/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-api.yaml
@@ -132,7 +132,7 @@ spec:
               {{- end }}
             - name: ZOOKEEPER_QUORUM
               {{- if .Values.zookeeper.enabled }}
-              value: "{{ template "dolphinscheduler.zookeeper.quorum" . }}"
+              value: {{ template "dolphinscheduler.zookeeper.quorum" . }}
               {{- else }}
               value: {{ .Values.externalZookeeper.zookeeperQuorum }}
               {{- end }}
diff --git 
a/docker/kubernetes/dolphinscheduler/templates/statefulset-dolphinscheduler-worker.yaml
 
b/docker/kubernetes/dolphinscheduler/templates/statefulset-dolphinscheduler-worker.yaml
index 7ca548c..0b12ed7 100644
--- 
a/docker/kubernetes/dolphinscheduler/templates/statefulset-dolphinscheduler-worker.yaml
+++ 
b/docker/kubernetes/dolphinscheduler/templates/statefulset-dolphinscheduler-worker.yaml
@@ -117,56 +117,8 @@ spec:
                 configMapKeyRef:
                   name: {{ include "dolphinscheduler.fullname" . }}-common
                   key: DOLPHINSCHEDULER_DATA_BASEDIR_PATH
-            - name: ALERT_PLUGIN_DIR
-              valueFrom:
-                configMapKeyRef:
-                  key: ALERT_PLUGIN_DIR
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: XLS_FILE_PATH
-              valueFrom:
-                configMapKeyRef:
-                  key: XLS_FILE_PATH
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: MAIL_SERVER_HOST
-              valueFrom:
-                configMapKeyRef:
-                  key: MAIL_SERVER_HOST
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: MAIL_SERVER_PORT
-              valueFrom:
-                configMapKeyRef:
-                  key: MAIL_SERVER_PORT
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: MAIL_SENDER
-              valueFrom:
-                configMapKeyRef:
-                  key: MAIL_SENDER
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: MAIL_USER
-              valueFrom:
-                configMapKeyRef:
-                  key: MAIL_USER
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: MAIL_PASSWD
-              valueFrom:
-                configMapKeyRef:
-                  key: MAIL_PASSWD
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: MAIL_SMTP_STARTTLS_ENABLE
-              valueFrom:
-                configMapKeyRef:
-                  key: MAIL_SMTP_STARTTLS_ENABLE
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: MAIL_SMTP_SSL_ENABLE
-              valueFrom:
-                configMapKeyRef:
-                  key: MAIL_SMTP_SSL_ENABLE
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: MAIL_SMTP_SSL_TRUST
-              valueFrom:
-                configMapKeyRef:
-                  key: MAIL_SMTP_SSL_TRUST
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
+            - name: ALERT_LISTEN_HOST
+              value: {{ include "dolphinscheduler.fullname" . }}-alert
             - name: DATABASE_TYPE
               {{- if .Values.postgresql.enabled }}
               value: "postgresql"
@@ -221,7 +173,7 @@ spec:
               {{- end }}
             - name: ZOOKEEPER_QUORUM
               {{- if .Values.zookeeper.enabled }}
-              value: "{{ template "dolphinscheduler.zookeeper.quorum" . }}"
+              value: {{ template "dolphinscheduler.zookeeper.quorum" . }}
               {{- else }}
               value: {{ .Values.externalZookeeper.zookeeperQuorum }}
               {{- end }}
@@ -263,31 +215,6 @@ spec:
                   key: fs-s3a-secret-key
                   name: {{ printf "%s-%s" .Release.Name "fs-s3a"  }}
             {{- end }}
-            - name: ENTERPRISE_WECHAT_ENABLE
-              valueFrom:
-                configMapKeyRef:
-                  key: ENTERPRISE_WECHAT_ENABLE
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: ENTERPRISE_WECHAT_CORP_ID
-              valueFrom:
-                configMapKeyRef:
-                  key: ENTERPRISE_WECHAT_CORP_ID
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: ENTERPRISE_WECHAT_SECRET
-              valueFrom:
-                configMapKeyRef:
-                  key: ENTERPRISE_WECHAT_SECRET
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: ENTERPRISE_WECHAT_AGENT_ID
-              valueFrom:
-                configMapKeyRef:
-                  key: ENTERPRISE_WECHAT_AGENT_ID
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
-            - name: ENTERPRISE_WECHAT_USERS
-              valueFrom:
-                configMapKeyRef:
-                  key: ENTERPRISE_WECHAT_USERS
-                  name: {{ include "dolphinscheduler.fullname" . }}-alert
           {{- if .Values.worker.resources }}
           resources:
             limits:
diff --git a/docker/kubernetes/dolphinscheduler/templates/NOTES.txt 
b/docker/kubernetes/dolphinscheduler/templates/svc-dolphinscheduler-alert.yaml
similarity index 55%
copy from docker/kubernetes/dolphinscheduler/templates/NOTES.txt
copy to 
docker/kubernetes/dolphinscheduler/templates/svc-dolphinscheduler-alert.yaml
index 8afe766..404c2e4 100644
--- a/docker/kubernetes/dolphinscheduler/templates/NOTES.txt
+++ 
b/docker/kubernetes/dolphinscheduler/templates/svc-dolphinscheduler-alert.yaml
@@ -14,18 +14,22 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-
-** Please be patient while the chart Dolphinscheduler {{ .Chart.AppVersion }} 
is being deployed **
-
-Get the Dolphinscheduler URL by running:
-
-{{- if .Values.ingress.enabled }}
-
-  export HOSTNAME=$(kubectl get ingress --namespace {{ .Release.Namespace }} 
{{ template "dolphinscheduler.fullname" . }} -o 
jsonpath='{.spec.rules[0].host}')
-  echo "Dolphinscheduler URL: http://$HOSTNAME/";
-
-{{- else }}
-
-  kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template 
"dolphinscheduler.fullname" . }}-api 12345:12345
-
-{{- end }}
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ include "dolphinscheduler.fullname" . }}-alert
+  labels:
+    app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-alert
+    app.kubernetes.io/instance: {{ .Release.Name }}
+    app.kubernetes.io/managed-by: {{ .Release.Service }}
+spec:
+  ports:
+    - port: 50052
+      targetPort: alert-port
+      protocol: TCP
+      name: alert-port
+  selector:
+    app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-alert
+    app.kubernetes.io/instance: {{ .Release.Name }}
+    app.kubernetes.io/managed-by: {{ .Release.Service }}
+    app.kubernetes.io/component: alert
\ No newline at end of file
diff --git a/docker/kubernetes/dolphinscheduler/values.yaml 
b/docker/kubernetes/dolphinscheduler/values.yaml
index 99979af..da282d8 100644
--- a/docker/kubernetes/dolphinscheduler/values.yaml
+++ b/docker/kubernetes/dolphinscheduler/values.yaml
@@ -31,7 +31,7 @@ image:
   pullPolicy: "IfNotPresent"
   pullSecrets: []
 
-# If not exists external database, by default, Dolphinscheduler's database 
will use it.
+## If not exists external database, by default, Dolphinscheduler's database 
will use it.
 postgresql:
   enabled: true
   postgresqlUsername: "root"
@@ -42,8 +42,8 @@ postgresql:
     size: "20Gi"
     storageClass: "-"
 
-# If exists external database, and set postgresql.enable value to false.
-# external database will be used, otherwise Dolphinscheduler's database will 
be used.
+## If exists external database, and set postgresql.enable value to false.
+## external database will be used, otherwise Dolphinscheduler's database will 
be used.
 externalDatabase:
   type: "postgresql"
   driver: "org.postgresql.Driver"
@@ -52,10 +52,10 @@ externalDatabase:
   username: "root"
   password: "root"
   database: "dolphinscheduler"
-  # multi params should join with & char
+  ## multi params should join with & char
   params: "characterEncoding=utf8"
 
-# If not exists external zookeeper, by default, Dolphinscheduler's zookeeper 
will use it.
+## If not exists external zookeeper, by default, Dolphinscheduler's zookeeper 
will use it.
 zookeeper:
   enabled: true
   fourlwCommandsWhitelist: srvr,ruok,wchs,cons
@@ -67,8 +67,8 @@ zookeeper:
     storageClass: "-"
   zookeeperRoot: "/dolphinscheduler"
 
-# If exists external zookeeper, and set zookeeper.enable value to false.
-# If zookeeper.enable is false, Dolphinscheduler's zookeeper will use it.
+## If exists external zookeeper, and set zookeeper.enable value to false.
+## If zookeeper.enable is false, Dolphinscheduler's zookeeper will use it.
 externalZookeeper:
   zookeeperQuorum: "127.0.0.1:2181"
   zookeeperRoot: "/dolphinscheduler"
@@ -283,21 +283,7 @@ alert:
   ## ConfigMap
   configmap:
     DOLPHINSCHEDULER_OPTS: ""
-    ALERT_PLUGIN_DIR: "/opt/dolphinscheduler/alert/plugin"
-    XLS_FILE_PATH: "/tmp/xls"
-    MAIL_SERVER_HOST: ""
-    MAIL_SERVER_PORT: ""
-    MAIL_SENDER: ""
-    MAIL_USER: ""
-    MAIL_PASSWD: ""
-    MAIL_SMTP_STARTTLS_ENABLE: false
-    MAIL_SMTP_SSL_ENABLE: false
-    MAIL_SMTP_SSL_TRUST: ""
-    ENTERPRISE_WECHAT_ENABLE: false
-    ENTERPRISE_WECHAT_CORP_ID: ""
-    ENTERPRISE_WECHAT_SECRET: ""
-    ENTERPRISE_WECHAT_AGENT_ID: ""
-    ENTERPRISE_WECHAT_USERS: ""
+    ALERT_PLUGIN_DIR: "lib/plugin/alert"
   ## Periodic probe of container liveness. Container will be restarted if the 
probe fails. Cannot be updated.
   ## More info: 
https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
   livenessProbe:

Reply via email to