This is an automated email from the ASF dual-hosted git repository. fanjia pushed a commit to branch dev in repository https://gitbox.apache.org/repos/asf/seatunnel.git
The following commit(s) were added to refs/heads/dev by this push: new ae0e6951bc [Improve][deploy] helm chart config improve (#8954) ae0e6951bc is described below commit ae0e6951bccfb06e24be5340794e2da681083ca8 Author: huangkuilin <78372151+prc...@users.noreply.github.com> AuthorDate: Thu Mar 13 20:11:35 2025 +0800 [Improve][deploy] helm chart config improve (#8954) --- .../jvm_client_options} | 27 ++++++------------ .../jvm_master_options} | 33 +++++++++------------- .../jvm_worker_options} | 33 +++++++++------------- deploy/kubernetes/seatunnel/templates/NOTES.txt | 24 +--------------- .../kubernetes/seatunnel/templates/configmap.yaml | 14 +++------ .../templates/deployment-seatunnel-master.yaml | 26 +++++++++-------- .../templates/deployment-seatunnel-worker.yaml | 28 +++++++++--------- deploy/kubernetes/seatunnel/templates/ingress.yaml | 3 ++ .../templates/service-master-headless.yaml | 4 +-- deploy/kubernetes/seatunnel/values.yaml | 24 ++++++++-------- 10 files changed, 86 insertions(+), 130 deletions(-) diff --git a/deploy/kubernetes/seatunnel/templates/service-master-headless.yaml b/deploy/kubernetes/seatunnel/conf/jvm_client_options similarity index 63% copy from deploy/kubernetes/seatunnel/templates/service-master-headless.yaml copy to deploy/kubernetes/seatunnel/conf/jvm_client_options index 63aff3ba75..462e1374c1 100644 --- a/deploy/kubernetes/seatunnel/templates/service-master-headless.yaml +++ b/deploy/kubernetes/seatunnel/conf/jvm_client_options @@ -14,22 +14,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # ---- -# use for access seatunnel from outside system via rest api -apiVersion: v1 -kind: Service -metadata: - name: {{ include "seatunnel.fullname" . }}-master - labels: - {{- include "seatunnel.master.labels" . | nindent 4 }} - namespace: {{ .Values.namespace }} -spec: - clusterIP: "None" - ports: - - name: "master-port" - port: 8080 - targetPort: 8080 - protocol: TCP - selector: - {{- include "seatunnel.master.labels" . | nindent 4 }} ---- + +# JVM Heap +-Xms256m +-Xmx512m + +# JVM Dump +-XX:+HeapDumpOnOutOfMemoryError +-XX:HeapDumpPath=/tmp/seatunnel/dump/zeta-client \ No newline at end of file diff --git a/deploy/kubernetes/seatunnel/templates/service-master-headless.yaml b/deploy/kubernetes/seatunnel/conf/jvm_master_options similarity index 63% copy from deploy/kubernetes/seatunnel/templates/service-master-headless.yaml copy to deploy/kubernetes/seatunnel/conf/jvm_master_options index 63aff3ba75..d435a7d275 100644 --- a/deploy/kubernetes/seatunnel/templates/service-master-headless.yaml +++ b/deploy/kubernetes/seatunnel/conf/jvm_master_options @@ -14,22 +14,17 @@ # See the License for the specific language governing permissions and # limitations under the License. # ---- -# use for access seatunnel from outside system via rest api -apiVersion: v1 -kind: Service -metadata: - name: {{ include "seatunnel.fullname" . }}-master - labels: - {{- include "seatunnel.master.labels" . | nindent 4 }} - namespace: {{ .Values.namespace }} -spec: - clusterIP: "None" - ports: - - name: "master-port" - port: 8080 - targetPort: 8080 - protocol: TCP - selector: - {{- include "seatunnel.master.labels" . | nindent 4 }} ---- + +# JVM Heap +# -Xms2g +# -Xmx2g + +# JVM Dump +-XX:+HeapDumpOnOutOfMemoryError +-XX:HeapDumpPath=/tmp/seatunnel/dump/zeta-server + +# Metaspace +-XX:MaxMetaspaceSize=2g + +# G1GC +-XX:+UseG1GC diff --git a/deploy/kubernetes/seatunnel/templates/service-master-headless.yaml b/deploy/kubernetes/seatunnel/conf/jvm_worker_options similarity index 63% copy from deploy/kubernetes/seatunnel/templates/service-master-headless.yaml copy to deploy/kubernetes/seatunnel/conf/jvm_worker_options index 63aff3ba75..d435a7d275 100644 --- a/deploy/kubernetes/seatunnel/templates/service-master-headless.yaml +++ b/deploy/kubernetes/seatunnel/conf/jvm_worker_options @@ -14,22 +14,17 @@ # See the License for the specific language governing permissions and # limitations under the License. # ---- -# use for access seatunnel from outside system via rest api -apiVersion: v1 -kind: Service -metadata: - name: {{ include "seatunnel.fullname" . }}-master - labels: - {{- include "seatunnel.master.labels" . | nindent 4 }} - namespace: {{ .Values.namespace }} -spec: - clusterIP: "None" - ports: - - name: "master-port" - port: 8080 - targetPort: 8080 - protocol: TCP - selector: - {{- include "seatunnel.master.labels" . | nindent 4 }} ---- + +# JVM Heap +# -Xms2g +# -Xmx2g + +# JVM Dump +-XX:+HeapDumpOnOutOfMemoryError +-XX:HeapDumpPath=/tmp/seatunnel/dump/zeta-server + +# Metaspace +-XX:MaxMetaspaceSize=2g + +# G1GC +-XX:+UseG1GC diff --git a/deploy/kubernetes/seatunnel/templates/NOTES.txt b/deploy/kubernetes/seatunnel/templates/NOTES.txt index d06fe5d3ba..781923c98b 100644 --- a/deploy/kubernetes/seatunnel/templates/NOTES.txt +++ b/deploy/kubernetes/seatunnel/templates/NOTES.txt @@ -26,7 +26,7 @@ Access seatunnel UI URL by: For more restapi please refer to https://seatunnel.apache.org/docs/{{ .Chart.AppVersion }}/seatunnel-engine/rest-api-v2 -{{- else if eq .Values.master.service.type "ClusterIP" }} +{{- else }} kubectl port-forward -n {{ .Release.Namespace }} svc/{{ template "seatunnel.fullname" . }}-master 8080:8080 @@ -34,28 +34,6 @@ Access seatunnel UI URL by: seatunnel restapi URL for system monitoring information: http://127.0.0.1:8080/system-monitoring-information For more restapi please refer to https://seatunnel.apache.org/docs/{{ .Chart.AppVersion }}/seatunnel-engine/rest-api-v2 - - -{{- else if eq .Values.master.service.type "NodePort" }} - - NODE_IP=$(kubectl get no -n {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - NODE_PORT=$(kubectl get svc {{ template "seatunnel.fullname" . }}-master -n {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}") - seatunnel restapi URL for running jobs: http://$NODE_IP:$NODE_PORT/running-jobs - seatunnel restapi URL for system monitoring information: http://$NODE_IP:$NODE_PORT/system-monitoring-information - - For more restapi please refer to https://seatunnel.apache.org/docs/{{ .Chart.AppVersion }}/seatunnel-engine/rest-api-v2 -{{- else if eq .Values.master.service.type "LoadBalancer" }} - - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get svc {{ template "seatunnel.fullname" . }}-master -n {{ .Release.Namespace }} -w' - - SERVICE_IP=$(kubectl get svc {{ template "seatunnel.fullname" . }}-master -n {{ .Release.Namespace }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - echo http://$SERVICE_IP:8080/running-jobs - - seatunnel resetapi URL for running jobs: http://$SERVICE_IP:8080/running-jobs - seatunnel resetapi URL for system monitoring information: http://$SERVICE_IP:8080/system-monitoring-information - - For more restapi please refer to https://seatunnel.apache.org/docs/{{ .Chart.AppVersion }}/seatunnel-engine/rest-api-v2 {{- end }} Or you can just go into master pod, and use local curl command. diff --git a/deploy/kubernetes/seatunnel/templates/configmap.yaml b/deploy/kubernetes/seatunnel/templates/configmap.yaml index 5eface25f6..c5182c4b3a 100644 --- a/deploy/kubernetes/seatunnel/templates/configmap.yaml +++ b/deploy/kubernetes/seatunnel/templates/configmap.yaml @@ -22,14 +22,8 @@ metadata: app.kubernetes.io/name: {{ include "seatunnel.fullname" . }}-configs {{- include "seatunnel.master.labels" . | nindent 4 }} data: - hazelcast-master.yaml: |- - {{ tpl (.Files.Get "conf/hazelcast-master.yaml") $ | nindent 4 }} - hazelcast-worker.yaml: |- - {{ tpl (.Files.Get "conf/hazelcast-worker.yaml") $ | nindent 4 }} - hazelcast-client.yaml: |- - {{ tpl (.Files.Get "conf/hazelcast-client.yaml") $ | nindent 4 }} - seatunnel.yaml: |- - {{ tpl (.Files.Get "conf/seatunnel.yaml") $ | nindent 4 }} - log4j2.properties: |- - {{ tpl (.Files.Get "conf/log4j2.properties") $ | nindent 4 }} + {{- range $path, $_ := .Files.Glob "conf/*" }} + {{- base $path | nindent 2 }}: |- + {{- tpl ($.Files.Get $path) $ | nindent 4 -}} + {{- end }} diff --git a/deploy/kubernetes/seatunnel/templates/deployment-seatunnel-master.yaml b/deploy/kubernetes/seatunnel/templates/deployment-seatunnel-master.yaml index 517fc3ac53..3bbf06cf36 100644 --- a/deploy/kubernetes/seatunnel/templates/deployment-seatunnel-master.yaml +++ b/deploy/kubernetes/seatunnel/templates/deployment-seatunnel-master.yaml @@ -65,7 +65,11 @@ spec: name: "hazelcast-port" - containerPort: 8080 name: "master-port" + {{- if .Values.master.command }} + command: {{ .Values.master.command }} + {{- else }} command: ["/bin/sh","-c","/opt/seatunnel/bin/seatunnel-cluster.sh -r master"] + {{- end }} {{- if .Values.master.resources }} resources: {{- toYaml .Values.master.resources | nindent 12 }} @@ -74,19 +78,17 @@ spec: livenessProbe: {{- toYaml .Values.master.livenessProbe | nindent 12 }} {{- end }} + {{- if .Values.env }} + env: + {{- toYaml .Values.env | nindent 12 }} + {{- end }} volumeMounts: - - mountPath: "/opt/seatunnel/config/hazelcast-master.yaml" - name: seatunnel-configs - subPath: hazelcast-master.yaml - - mountPath: "/opt/seatunnel/config/hazelcast-client.yaml" - name: seatunnel-configs - subPath: hazelcast-client.yaml - - mountPath: "/opt/seatunnel/config/seatunnel.yaml" - name: seatunnel-configs - subPath: seatunnel.yaml - - mountPath: "/opt/seatunnel/config/log4j2.properties" - name: seatunnel-configs - subPath: log4j2.properties + # config mount + {{- range $path, $_ := .Files.Glob "conf/*" }} + - name: seatunnel-configs + mountPath: /opt/seatunnel/config/{{ base $path }} + subPath: {{ base $path }} + {{- end }} volumes: - name: seatunnel-configs configMap: diff --git a/deploy/kubernetes/seatunnel/templates/deployment-seatunnel-worker.yaml b/deploy/kubernetes/seatunnel/templates/deployment-seatunnel-worker.yaml index d56263f908..4c0b7329d0 100644 --- a/deploy/kubernetes/seatunnel/templates/deployment-seatunnel-worker.yaml +++ b/deploy/kubernetes/seatunnel/templates/deployment-seatunnel-worker.yaml @@ -63,7 +63,11 @@ spec: ports: - containerPort: 5801 name: "hazelcast-port" + {{- if .Values.worker.command }} + command: {{ .Values.worker.command }} + {{- else }} command: ["/bin/sh","-c","/opt/seatunnel/bin/seatunnel-cluster.sh -r worker"] + {{- end }} {{- if .Values.worker.resources }} resources: {{- toYaml .Values.worker.resources | nindent 12 }} @@ -72,20 +76,18 @@ spec: livenessProbe: {{- toYaml .Values.worker.livenessProbe | nindent 12 }} {{- end }} + {{- if .Values.env }} + env: + {{- toYaml .Values.env | nindent 12 }} + {{- end }} volumeMounts: - - mountPath: "/opt/seatunnel/config/hazelcast-worker.yaml" - name: seatunnel-configs - subPath: hazelcast-worker.yaml - - mountPath: "/opt/seatunnel/config/hazelcast-client.yaml" - name: seatunnel-configs - subPath: hazelcast-client.yaml - - mountPath: "/opt/seatunnel/config/seatunnel.yaml" - name: seatunnel-configs - subPath: seatunnel.yaml - - mountPath: "/opt/seatunnel/config/log4j2.properties" - name: seatunnel-configs - subPath: log4j2.properties + # config mount + {{- range $path, $_ := .Files.Glob "conf/*" }} + - name: seatunnel-configs + mountPath: /opt/seatunnel/config/{{ base $path }} + subPath: {{ base $path }} + {{- end }} volumes: - name: seatunnel-configs configMap: - name: {{ include "seatunnel.fullname" . }}-configs + name: {{ include "seatunnel.fullname" . }}-configs \ No newline at end of file diff --git a/deploy/kubernetes/seatunnel/templates/ingress.yaml b/deploy/kubernetes/seatunnel/templates/ingress.yaml index 97319a956d..0ccb1e04a3 100644 --- a/deploy/kubernetes/seatunnel/templates/ingress.yaml +++ b/deploy/kubernetes/seatunnel/templates/ingress.yaml @@ -33,6 +33,9 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: + {{- if .Values.ingress.className }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} rules: - host: "{{ .Values.ingress.host }}" http: diff --git a/deploy/kubernetes/seatunnel/templates/service-master-headless.yaml b/deploy/kubernetes/seatunnel/templates/service-master-headless.yaml index 63aff3ba75..29d800d9dc 100644 --- a/deploy/kubernetes/seatunnel/templates/service-master-headless.yaml +++ b/deploy/kubernetes/seatunnel/templates/service-master-headless.yaml @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ---- # use for access seatunnel from outside system via rest api apiVersion: v1 kind: Service @@ -31,5 +30,4 @@ spec: targetPort: 8080 protocol: TCP selector: - {{- include "seatunnel.master.labels" . | nindent 4 }} ---- + {{- include "seatunnel.master.labels" . | nindent 4 }} \ No newline at end of file diff --git a/deploy/kubernetes/seatunnel/values.yaml b/deploy/kubernetes/seatunnel/values.yaml index b5fd60b750..ec91284f5a 100644 --- a/deploy/kubernetes/seatunnel/values.yaml +++ b/deploy/kubernetes/seatunnel/values.yaml @@ -19,16 +19,20 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -timezone: "Asia/Shanghai" - - image: registry: "apache/seatunnel" tag: "" pullPolicy: "IfNotPresent" pullSecret: "" +# The env for pod +env: + - name: TZ + value: Asia/Shanghai + master: + ## The command to start master. + command: [] ## The deployment strategy to use to replace existing pods with new ones. strategy: type: RollingUpdate @@ -67,11 +71,6 @@ master: # cpu: "500m" ## 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 - - ## service config for restApi - service: - type: "ClusterIP" - livenessProbe: tcpSocket: port: hazelcast-port @@ -91,6 +90,8 @@ master: successThreshold: 1 worker: + ## The command to start worker. + command: [] ## The deployment strategy to use to replace existing pods with new ones. strategy: type: RollingUpdate @@ -130,8 +131,6 @@ worker: # cpu: "500m" ## 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: tcpSocket: port: hazelcast-port @@ -152,8 +151,9 @@ worker: ingress: enabled: false - host: "seatunnel.org" - path: "/" + className: "" + host: seatunnel.k8s.local + path: / annotations: {} tls: enabled: false