You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by ki...@apache.org on 2022/09/27 06:32:44 UTC
[incubator-seatunnel] branch dev updated: [Feature] [deploy] Add Helm charts (#2903)
This is an automated email from the ASF dual-hosted git repository.
kirs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git
The following commit(s) were added to refs/heads/dev by this push:
new 8dc1c605e [Feature] [deploy] Add Helm charts (#2903)
8dc1c605e is described below
commit 8dc1c605ecd45273d5550839f8c28038924a789f
Author: Arif GÖRE <56...@users.noreply.github.com>
AuthorDate: Tue Sep 27 09:32:38 2022 +0300
[Feature] [deploy] Add Helm charts (#2903)
* Add Helm charts
* Add license headers
---
deploy/helm/seatunnel_flink/Chart.yaml | 22 +++++++
deploy/helm/seatunnel_flink/README.md | 24 +++++++
deploy/helm/seatunnel_flink/requirements.yaml | 21 ++++++
.../helm/seatunnel_flink/templates/flink-conf.yaml | 23 +++++++
.../seatunnel_flink/templates/seatunnel-flink.yaml | 55 ++++++++++++++++
deploy/helm/seatunnel_flink/values.yaml | 75 ++++++++++++++++++++++
deploy/helm/seatunnel_spark/Chart.yaml | 22 +++++++
deploy/helm/seatunnel_spark/README.md | 16 +++++
.../seatunnel_spark/templates/seatunnel-spark.yaml | 43 +++++++++++++
.../helm/seatunnel_spark/templates/spark-conf.yaml | 24 +++++++
deploy/helm/seatunnel_spark/values.yaml | 59 +++++++++++++++++
11 files changed, 384 insertions(+)
diff --git a/deploy/helm/seatunnel_flink/Chart.yaml b/deploy/helm/seatunnel_flink/Chart.yaml
new file mode 100644
index 000000000..94930711f
--- /dev/null
+++ b/deploy/helm/seatunnel_flink/Chart.yaml
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+apiVersion: v1
+name: seatunnel-flink
+version: 1.0.0
+appVersion: 1.2.2
+description: Helm chart for Apache Seatunnel with Flink.
diff --git a/deploy/helm/seatunnel_flink/README.md b/deploy/helm/seatunnel_flink/README.md
new file mode 100644
index 000000000..0cab48d58
--- /dev/null
+++ b/deploy/helm/seatunnel_flink/README.md
@@ -0,0 +1,24 @@
+# Seatunnel-Spark Setup With Helm
+
+
+## Install
+
+- First, install the certificate manager;
+
+ ```shell
+ kubectl create -f https://github.com/jetstack/cert-manager/releases/download/v1.7.1/cert-manager.yaml
+ ```
+
+- While you are in the `seatunnel_helm/seatunnel_flink` directory, run the following command:
+
+ ```shell
+ helm install seatunnel-flink .
+ ```
+
+- To uninstall it:
+
+ ```shell
+ helm uninstall seatunnel-flink
+ ```
+
+---
\ No newline at end of file
diff --git a/deploy/helm/seatunnel_flink/requirements.yaml b/deploy/helm/seatunnel_flink/requirements.yaml
new file mode 100644
index 000000000..b309b6619
--- /dev/null
+++ b/deploy/helm/seatunnel_flink/requirements.yaml
@@ -0,0 +1,21 @@
+#
+# 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.
+#
+
+dependencies:
+ - name: flink-kubernetes-operator
+ version: 0.1.0
+ repository: https://archive.apache.org/dist/flink/flink-kubernetes-operator-0.1.0/
diff --git a/deploy/helm/seatunnel_flink/templates/flink-conf.yaml b/deploy/helm/seatunnel_flink/templates/flink-conf.yaml
new file mode 100644
index 000000000..5c1d9ea3b
--- /dev/null
+++ b/deploy/helm/seatunnel_flink/templates/flink-conf.yaml
@@ -0,0 +1,23 @@
+#
+# 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.
+#
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ .Values.conf.metadata.name }}
+data:
+ flink.conf: {{ .Values.conf.data.flinkConf | quote }}
diff --git a/deploy/helm/seatunnel_flink/templates/seatunnel-flink.yaml b/deploy/helm/seatunnel_flink/templates/seatunnel-flink.yaml
new file mode 100644
index 000000000..8f88b287b
--- /dev/null
+++ b/deploy/helm/seatunnel_flink/templates/seatunnel-flink.yaml
@@ -0,0 +1,55 @@
+#
+# 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.
+#
+
+apiVersion: flink.apache.org/v1alpha1
+kind: FlinkDeployment
+metadata:
+ namespace: {{ .Values.metadata.namespace }}
+ name: {{ .Values.metadata.name }}
+spec:
+ image: {{ .Values.spec.image }}
+ flinkVersion: v1_14
+ flinkConfiguration:
+ taskmanager.numberOfTaskSlots: {{ .Values.spec.flinkConf.numberOfTaskSlots | quote }}
+ serviceAccount: flink
+ jobManager:
+ replicas: {{ .Values.spec.jobManager.replicas }}
+ resource:
+ memory: {{ .Values.spec.jobManager.resource.memory }}
+ cpu: {{ .Values.spec.jobManager.resource.cpu }}
+ taskManager:
+ resource:
+ memory: {{ .Values.spec.taskManager.resource.memory }}
+ cpu: {{ .Values.spec.taskManager.resource.cpu }}
+ podTemplate:
+ spec:
+ containers:
+ - name: {{ .Values.spec.podTemplate.containers.name }}
+ volumeMounts:
+ - mountPath: {{ .Values.spec.podTemplate.containers.volumeMounts.mountPath }}
+ name: {{ .Values.spec.podTemplate.containers.volumeMounts.name }}
+ volumes:
+ - name: {{ .Values.spec.podTemplate.volumes.name }}
+ configMap:
+ name: {{ .Values.spec.podTemplate.volumes.configMap }}
+ job:
+ jarURI: {{ .Values.spec.job.jarURI }}
+ entryClass: org.apache.seatunnel.core.flink.SeatunnelFlink
+ args: {{ .Values.spec.job.args }}
+ parallelism: {{ .Values.spec.job.parallelism }}
+ upgradeMode: {{ .Values.spec.job.upgradeMode }}
+
diff --git a/deploy/helm/seatunnel_flink/values.yaml b/deploy/helm/seatunnel_flink/values.yaml
new file mode 100644
index 000000000..0a9e3ee6c
--- /dev/null
+++ b/deploy/helm/seatunnel_flink/values.yaml
@@ -0,0 +1,75 @@
+#
+# 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.
+#
+
+metadata:
+ namespace: "default"
+ name: "seatunnel-flink-deployment"
+spec:
+ image: arifgore/seatunnel-flink:2.1.2
+ flinkConf:
+ numberOfTaskSlots: "2"
+ serviceAccount: "flink"
+ jobManager:
+ replicas: "1"
+ resource:
+ memory: "2048m"
+ cpu: "1"
+ taskManager:
+ resource:
+ memory: "2048m"
+ cpu: "2"
+ podTemplate:
+ containers:
+ name: "flink-main-container"
+ volumeMounts:
+ mountPath: "/data"
+ name: "config-volume"
+ volumes:
+ name: "config-volume"
+ configMap: "flink-conf"
+ job:
+ jarURI: "local:///opt/seatunnel/lib/seatunnel-core-flink.jar"
+ args: '["--config", "/data/flink.conf"]'
+ parallelism: "2"
+ upgradeMode: "stateless"
+
+conf:
+ metadata:
+ name: flink-conf
+ data:
+ flinkConf: |
+
+ env {
+ execution.parallelism = 1
+ }
+
+ source {
+ FakeSourceStream {
+ result_table_name = "fake"
+ field_name = "name,age"
+ }
+ }
+
+ transform {
+ sql {
+ sql = "select name,age from fake"
+ }
+ }
+
+ sink {
+ ConsoleSink {}
+ }
diff --git a/deploy/helm/seatunnel_spark/Chart.yaml b/deploy/helm/seatunnel_spark/Chart.yaml
new file mode 100644
index 000000000..62326d865
--- /dev/null
+++ b/deploy/helm/seatunnel_spark/Chart.yaml
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+apiVersion: v1
+name: seatunnel-spark
+version: 1.0.0
+appVersion: 1.2.2
+description: Helm chart for Apache Seatunnel with Spark.
diff --git a/deploy/helm/seatunnel_spark/README.md b/deploy/helm/seatunnel_spark/README.md
new file mode 100644
index 000000000..d9f4225af
--- /dev/null
+++ b/deploy/helm/seatunnel_spark/README.md
@@ -0,0 +1,16 @@
+# Seatunnel-Spark Setup With Helm
+
+## Install
+- While you are in the `seatunnel_helm/seatunnel_spark` directory, run the following command:
+
+ ```shell
+ helm install seatunnel-spark .
+ ```
+
+- To uninstall it:
+
+ ```shell
+ helm uninstall seatunnel-spark
+ ```
+
+---
\ No newline at end of file
diff --git a/deploy/helm/seatunnel_spark/templates/seatunnel-spark.yaml b/deploy/helm/seatunnel_spark/templates/seatunnel-spark.yaml
new file mode 100644
index 000000000..389a7ecf3
--- /dev/null
+++ b/deploy/helm/seatunnel_spark/templates/seatunnel-spark.yaml
@@ -0,0 +1,43 @@
+#
+# 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.
+#
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ namespace: {{ .Values.metadata.namespace }}
+ name: {{ .Values.metadata.name }}
+spec:
+ replicas: {{ .Values.spec.replicas }}
+ selector:
+ matchLabels:
+ app: seatunnel-spark
+ template:
+ metadata:
+ labels:
+ app: seatunnel-spark
+ spec:
+ containers:
+ - name: {{ .Values.spec.template.containers.name }}
+ image: {{ .Values.spec.template.containers.image }}
+ command: ['bash', '-c', {{ .Values.spec.template.containers.command | quote }} ]
+ volumeMounts:
+ - mountPath: {{ .Values.spec.template.containers.volumeMounts.mountPath }}
+ name: {{ .Values.spec.template.containers.volumeMounts.name }}
+ volumes:
+ - name: {{ .Values.spec.template.volumes.name }}
+ configMap:
+ name: {{ .Values.spec.template.volumes.configMap }}
diff --git a/deploy/helm/seatunnel_spark/templates/spark-conf.yaml b/deploy/helm/seatunnel_spark/templates/spark-conf.yaml
new file mode 100644
index 000000000..23b3b0758
--- /dev/null
+++ b/deploy/helm/seatunnel_spark/templates/spark-conf.yaml
@@ -0,0 +1,24 @@
+#
+# 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.
+#
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ .Values.conf.metadata.name }}
+data:
+ spark.conf: {{ .Values.conf.data.sparkConf | quote }}
+
diff --git a/deploy/helm/seatunnel_spark/values.yaml b/deploy/helm/seatunnel_spark/values.yaml
new file mode 100644
index 000000000..73c95a23a
--- /dev/null
+++ b/deploy/helm/seatunnel_spark/values.yaml
@@ -0,0 +1,59 @@
+#
+# 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.
+#
+
+metadata:
+ namespace: 'default'
+ name: 'seatunnel-spark-deployment'
+spec:
+ replicas: '1'
+ template:
+ containers:
+ name: 'seatunnel-spark-container'
+ image: 'arifgore/seatunnel-spark:2.1.2'
+ command: '/opt/seatunnel/bin/start-seatunnel-spark.sh --master local[4] --deploy-mode client --config /data/spark.conf'
+ volumeMounts:
+ mountPath: '/data'
+ name: 'config-volume'
+ volumes:
+ name: 'config-volume'
+ configMap: 'spark-conf'
+conf:
+ metadata:
+ name: "spark-conf"
+ data:
+ sparkConf: |
+ env {
+ spark.app.name = "SeaTunnel",
+ spark.executor.instances = 2
+ spark.executor.cores = 1
+ spark.executor.memory = "1g"
+ spark.streaming.batchDuration = 5
+ }
+ source {
+ fakeStream {
+ content = ["Hello World, SeaTunnel"]
+ }
+ }
+ transform {
+ split {
+ fields = ["msg", "name"]
+ delimiter = ","
+ }
+ }
+ sink {
+ Console {}
+ }