From dc4a8e8f1ada726785f18366ac90dde094e2c30a Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Tue, 5 Nov 2024 13:10:01 +0800 Subject: [PATCH 01/18] Add Helm chart for deploying Zeppelin on Kubernetes Signed-off-by: Yi Chen --- charts/zeppelin/.helmignore | 23 +++ charts/zeppelin/Chart.yaml | 15 ++ charts/zeppelin/README.md | 52 +++++ charts/zeppelin/README.md.gotmpl | 13 ++ charts/zeppelin/templates/_helpers.tpl | 102 ++++++++++ .../templates/interpreter/_helpers.tpl | 55 ++++++ .../templates/interpreter/configmap.yaml | 186 ++++++++++++++++++ .../zeppelin/templates/interpreter/role.yaml | 36 ++++ .../templates/interpreter/rolebinding.yaml | 29 +++ .../templates/interpreter/serviceaccount.yaml | 30 +++ charts/zeppelin/templates/server/_helpers.tpl | 78 ++++++++ .../zeppelin/templates/server/deployment.yaml | 159 +++++++++++++++ .../templates/server/env-configmap.yaml | 54 +++++ .../zeppelin/templates/server/nginx-conf.yaml | 69 +++++++ charts/zeppelin/templates/server/role.yaml | 48 +++++ .../templates/server/rolebinding.yaml | 33 ++++ charts/zeppelin/templates/server/service.yaml | 33 ++++ .../templates/server/serviceaccount.yaml | 30 +++ charts/zeppelin/values.yaml | 122 ++++++++++++ 19 files changed, 1167 insertions(+) create mode 100644 charts/zeppelin/.helmignore create mode 100644 charts/zeppelin/Chart.yaml create mode 100644 charts/zeppelin/README.md create mode 100644 charts/zeppelin/README.md.gotmpl create mode 100644 charts/zeppelin/templates/_helpers.tpl create mode 100644 charts/zeppelin/templates/interpreter/_helpers.tpl create mode 100644 charts/zeppelin/templates/interpreter/configmap.yaml create mode 100644 charts/zeppelin/templates/interpreter/role.yaml create mode 100644 charts/zeppelin/templates/interpreter/rolebinding.yaml create mode 100644 charts/zeppelin/templates/interpreter/serviceaccount.yaml create mode 100644 charts/zeppelin/templates/server/_helpers.tpl create mode 100644 charts/zeppelin/templates/server/deployment.yaml create mode 100644 charts/zeppelin/templates/server/env-configmap.yaml create mode 100644 charts/zeppelin/templates/server/nginx-conf.yaml create mode 100644 charts/zeppelin/templates/server/role.yaml create mode 100644 charts/zeppelin/templates/server/rolebinding.yaml create mode 100644 charts/zeppelin/templates/server/service.yaml create mode 100644 charts/zeppelin/templates/server/serviceaccount.yaml create mode 100644 charts/zeppelin/values.yaml diff --git a/charts/zeppelin/.helmignore b/charts/zeppelin/.helmignore new file mode 100644 index 00000000000..0e8a0eb36f4 --- /dev/null +++ b/charts/zeppelin/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/zeppelin/Chart.yaml b/charts/zeppelin/Chart.yaml new file mode 100644 index 00000000000..3f129f967d7 --- /dev/null +++ b/charts/zeppelin/Chart.yaml @@ -0,0 +1,15 @@ +apiVersion: v2 + +name: zeppelin + +description: A Helm chart for deploying Apache Zeppelin on Kubernetes. + +type: application + +version: 0.1.0 + +appVersion: 0.11.2 + +maintainers: +- name: ChenYi015 + email: github@chenyicn.net diff --git a/charts/zeppelin/README.md b/charts/zeppelin/README.md new file mode 100644 index 00000000000..b7a69d9e6f3 --- /dev/null +++ b/charts/zeppelin/README.md @@ -0,0 +1,52 @@ +# zeppelin + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.11.2](https://img.shields.io/badge/AppVersion-0.11.2-informational?style=flat-square) + +A Helm chart for deploying Apache Zeppelin on Kubernetes. + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| nameOverride | string | `""` | String to partially override release name. | +| fullnameOverride | string | `""` | String to fully override release name. | +| global.image.registry | string | `"docker.io"` | Image registry. | +| global.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy. | +| global.image.pullSecrets | list | `[]` | Image pull secrets for private image registry. | +| server.image.registry | string | If not set, `global.image.registry` will be used. | Zeppelin server image registry. | +| server.image.repository | string | `"apache/zeppelin"` | Zeppelin server image repository. | +| server.image.tag | string | If not set, the chart appVersion will be used. | Zeppelin image tag. | +| server.serviceAccount.create | bool | `true` | Specifies whether a service account should be created for the Zeppelin server. | +| server.serviceAccount.name | string | `""` | Optional name for the Zeppelin server service account. | +| server.serviceAccount.annotations | object | `{}` | Extra annotations for the Zeppelin server service account. | +| interpreter.image.registry | string | If not set, `global.image.registry` will be used. | Zeppelin interpreter image registry. | +| interpreter.image.repository | string | `"apache/zeppelin-interpreter"` | Zeppelin interpreter image repository. | +| interpreter.image.tag | string | If not set, the chart appVersion will be used. | Zeppelin interpreter image tag. | +| interpreter.serviceAccount.serviceAccount | string | `nil` | | +| interpreter.serviceAccount.create | bool | `true` | Specifies whether a service account should be created for the Zeppelin interpreter. | +| interpreter.serviceAccount.name | string | `""` | Optional name for the Zeppelin interpreter service account. | +| interpreter.serviceAccount.annotations | object | `{}` | Extra annotations for the Zeppelin interpreter service account. | +| spark.image.registry | string | If not set, `global.image.registry` will be used. | Spark image registry. | +| spark.image.repository | string | `"spark"` | Spark image repository. | +| spark.image.tag | string | `"3.5.3"` | Spark image tag. | +| replicas | int | `1` | | +| labels | object | `{}` | Extra labels for controller pods. | +| annotations | object | `{}` | Extra annotations for controller pods. | +| volumes | list | `[]` | Volumes for controller pods. | +| nodeSelector | object | `{}` | Node selector for controller pods. | +| affinity | object | `{}` | Affinity for controller pods. | +| tolerations | list | `[]` | List of node taints to tolerate for controller pods. | +| priorityClassName | string | `""` | Priority class for controller pods. | +| podSecurityContext | object | `{}` | Security context for controller pods. | +| env | list | `[]` | Environment variables for controller containers. | +| envFrom | list | `[]` | Environment variable sources for controller containers. | +| volumeMounts | list | `[]` | Volume mounts for controller containers. | +| resources | object | `{}` | Pod resource requests and limits for controller containers. | +| securityContext | object | `{}` | Security context for controller containers. | +| service.type | string | `"ClusterIP"` | | + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| ChenYi015 | | | diff --git a/charts/zeppelin/README.md.gotmpl b/charts/zeppelin/README.md.gotmpl new file mode 100644 index 00000000000..6b734a1a0ee --- /dev/null +++ b/charts/zeppelin/README.md.gotmpl @@ -0,0 +1,13 @@ +{{ template "chart.header" . }} + +{{ template "chart.deprecationWarning" . }} + +{{ template "chart.badgesSection" . }} + +{{ template "chart.description" . }} + +{{ template "chart.homepageLine" . }} + +{{ template "chart.valuesSection" . }} + +{{ template "chart.maintainersSection" . }} diff --git a/charts/zeppelin/templates/_helpers.tpl b/charts/zeppelin/templates/_helpers.tpl new file mode 100644 index 00000000000..ee18971a6d5 --- /dev/null +++ b/charts/zeppelin/templates/_helpers.tpl @@ -0,0 +1,102 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "zeppelin.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "zeppelin.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "zeppelin.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "zeppelin.labels" -}} +helm.sh/chart: {{ include "zeppelin.chart" . }} +{{ include "zeppelin.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "zeppelin.selectorLabels" -}} +app.kubernetes.io/name: {{ include "zeppelin.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the configmap to use +*/}} +{{- define "zeppelin.configMapName" -}} +{{- include "zeppelin.fullname" . }}-conf +{{- end -}} + +{{/* +Create the name of the configmap to use +*/}} +{{- define "zeppelin.envConfigMapName" -}} +{{- include "zeppelin.fullname" . }}-env +{{- end -}} + +{{/* +Create the name of the nginx configmap to use +*/}} +{{- define "zeppelin.nginxConfigMapName" -}} +{{- include "zeppelin.fullname" . }}-nginx-conf +{{- end -}} + +{{/* +Create the name of the Zeppelin image to use +*/}} +{{- define "zeppelin.server.image" -}} +{{- $imageRegistry := .Values.server.image.registry | default .Values.global.image.registry | default "docker.io" }} +{{- $imageRepository := .Values.server.image.repository | default "apache/zeppelin" }} +{{- $imageTag := .Values.server.image.tag | default "latest" }} +{{- printf "%s/%s:%s" $imageRegistry $imageRepository $imageTag }} +{{- end -}} + +{{/* +Create the name of the Zeppelin interpreter image to use +*/}} +{{- define "zeppelin.interpreter.image" -}} +{{- $imageRegistry := .Values.interpreter.image.registry | default .Values.global.image.registry | default "docker.io" }} +{{- $imageRepository := .Values.interpreter.image.repository | default "apache/zeppelin" }} +{{- $imageTag := .Values.interpreter.image.tag | default "latest" }} +{{- printf "%s/%s:%s" $imageRegistry $imageRepository $imageTag }} +{{- end -}} + +{{/* +Create the name of the Spark image to use +*/}} +{{- define "zeppelin.spark.image" -}} +{{- $imageRegistry := .Values.spark.image.registry | default .Values.global.image.registry | default "docker.io" }} +{{- $imageRepository := .Values.spark.image.repository | default "spark" }} +{{- $imageTag := .Values.spark.image.tag | default "latest" }} +{{- printf "%s/%s:%s" $imageRegistry $imageRepository $imageTag }} +{{- end -}} diff --git a/charts/zeppelin/templates/interpreter/_helpers.tpl b/charts/zeppelin/templates/interpreter/_helpers.tpl new file mode 100644 index 00000000000..4fbb7ed70ca --- /dev/null +++ b/charts/zeppelin/templates/interpreter/_helpers.tpl @@ -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. +*/}} + +{{/* +Create the name of Zeppelin interpreter. +*/}} +{{- define "zeppelin.interpreter.name" -}} +{{- include "zeppelin.fullname" . }}-interpreter +{{- end -}} + +{{/* +Create the name of the service account for Zeppelin interpreter. +*/}} +{{- define "zeppelin.interpreter.serviceAccountName" -}} +{{- if .Values.interpreter.serviceAccount.create }} +{{- default (include "zeppelin.interpreter.name" .) .Values.interpreter.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.interpreter.serviceAccount.name }} +{{- end }} +{{- end -}} + +{{/* +Create the name of the role for Zeppelin interpreter. +*/}} +{{- define "zeppelin.interpreter.roleName" -}} +{{- include "zeppelin.interpreter.serviceAccountName" . }} +{{- end -}} + +{{/* +Create the name of the role binding for Zeppelin interpreter. +*/}} +{{- define "zeppelin.interpreter.roleBindingName" -}} +{{- include "zeppelin.interpreter.serviceAccountName" . }} +{{- end -}} + +{{/* +Create the name of the config map for Zeppelin interpreter. +*/}} +{{- define "zeppelin.interpreter.configMapName" -}} +{{- include "zeppelin.interpreter.name" . }}-conf +{{- end -}} diff --git a/charts/zeppelin/templates/interpreter/configmap.yaml b/charts/zeppelin/templates/interpreter/configmap.yaml new file mode 100644 index 00000000000..628d9871c2a --- /dev/null +++ b/charts/zeppelin/templates/interpreter/configmap.yaml @@ -0,0 +1,186 @@ +{{/* +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: {{ include "zeppelin.interpreter.configMapName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "zeppelin.labels" . | nindent 4 }} +data: + interpreter-spec.yaml: | + apiVersion: v1 + kind: Pod + metadata: + name: {{ "{{" }} zeppelin.k8s.interpreter.pod.name {{ "}}" }} + namespace: {{ "{{" }} zeppelin.k8s.interpreter.namespace {{ "}}" }} + labels: + app: {{ "{{" }} zeppelin.k8s.interpreter.pod.name {{ "}}" }} + interpreterGroupId: {{ "{{" }} zeppelin.k8s.interpreter.group.id {{ "}}" }} + interpreterSettingName: {{ "{{" }} zeppelin.k8s.interpreter.setting.name {{ "}}" }} + user: {{ "{{" }} zeppelin.k8s.interpreter.user {{ "}}" }} + {% if zeppelin.k8s.server.uid is defined %} + ownerReferences: + - apiVersion: v1 + kind: Pod + name: {{ "{{" }} zeppelin.k8s.server.pod.name }} + controller: false + blockOwnerDeletion: false + uid: {{ "{{" }} zeppelin.k8s.server.uid }} + {% endif %} + spec: + serviceAccountName: {{ include "zeppelin.interpreter.serviceAccountName" . }} + {% if zeppelin.k8s.interpreter.group.name == "spark" %} + automountServiceAccountToken: true + {% else %} + automountServiceAccountToken: false + {% endif %} + restartPolicy: Never + terminationGracePeriodSeconds: 30 + containers: + - name: {{ "{{" }} zeppelin.k8s.interpreter.container.name {{ "}}" }} + image: {{ "{{" }} zeppelin.k8s.interpreter.container.image {{ "}}" }} + {% if zeppelin.k8s.interpreter.container.imagePullPolicy is defined %} + imagePullPolicy: {{ "{{" }} zeppelin.k8s.interpreter.container.imagePullPolicy {{ "}}" }} + {% endif %} + args: + - "$(ZEPPELIN_HOME)/bin/interpreter.sh" + - "-d" + - "$(ZEPPELIN_HOME)/interpreter/{{ "{{" }} zeppelin.k8s.interpreter.group.name {{ "}}" }}" + - "-r" + - "{{ "{{" }} zeppelin.k8s.interpreter.rpc.portRange {{ "}}" }}" + - "-c" + - "{{ "{{" }} zeppelin.k8s.server.rpc.service {{ "}}" }}" + - "-p" + - "{{ "{{" }} zeppelin.k8s.server.rpc.portRange {{ "}}" }}" + - "-i" + - "{{ "{{" }} zeppelin.k8s.interpreter.group.id {{ "}}" }}" + - "-l" + - "{{ "{{" }} zeppelin.k8s.interpreter.localRepo {{ "}}" }}/{{ "{{" }} zeppelin.k8s.interpreter.setting.name {{ "}}" }}" + - "-g" + - "{{ "{{" }} zeppelin.k8s.interpreter.setting.name {{ "}}" }}" + env: + {% for key, value in zeppelin.k8s.envs.items() %} + - name: {{ "{{" }} key {{ "}}" }} + value: {{ "{{" }} value {{ "}}" }} + {% endfor %} + {% if zeppelin.k8s.interpreter.cores is defined and zeppelin.k8s.interpreter.memory is defined %} + resources: + requests: + memory: "{{ "{{" }} zeppelin.k8s.interpreter.memory {{ "}}" }}" + cpu: "{{ "{{" }} zeppelin.k8s.interpreter.cores {{ "}}" }}" + {# limits.memory is not set because of a potential OOM-Killer. https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits #} + limits: + cpu: "{{ "{{" }} zeppelin.k8s.interpreter.cores {{ "}}" }}" + {% if zeppelin.k8s.interpreter.gpu.type is defined and zeppelin.k8s.interpreter.gpu.nums is defined %} + {{ "{{" }} zeppelin.k8s.interpreter.gpu.type {{ "}}" }}: " {{ "{{" }} zeppelin.k8s.interpreter.gpu.nums {{ "}}" }}" + {% endif %} + {% else %} + {% if zeppelin.k8s.interpreter.gpu.type is defined and zeppelin.k8s.interpreter.gpu.nums is defined %} + resources: + limits: + {{ "{{" }} zeppelin.k8s.interpreter.gpu.type {{ "}}" }}: " {{ "{{" }} zeppelin.k8s.interpreter.gpu.nums {{ "}}" }}" + {% endif %} + {% endif %} + {% if zeppelin.k8s.interpreter.group.name == "spark" %} + volumeMounts: + - name: spark-home + mountPath: /spark + initContainers: + - name: spark-home-init + image: {{ "{{" }} zeppelin.k8s.spark.container.image {{ "}}" }} + {% if zeppelin.k8s.spark.container.imagePullPolicy is defined %} + imagePullPolicy: {{ "{{" }} zeppelin.k8s.spark.container.imagePullPolicy {{ "}}" }} + {% endif %} + command: ["sh", "-c", "cp -r /opt/spark/* /spark/"] + volumeMounts: + - name: spark-home + mountPath: /spark + {% if zeppelin.k8s.interpreter.imagePullSecrets is defined %} + imagePullSecrets: + {% for secret in zeppelin.k8s.interpreter.imagePullSecrets.split(',') %} + - name: {{ "{{" }} secret {{ "}}" }} + {% endfor %} + {% endif %} + volumes: + - name: spark-home + emptyDir: {} + {% endif %} + + --- + apiVersion: v1 + kind: Service + metadata: + name: {{ "{{" }} zeppelin.k8s.interpreter.pod.name {{ "}}" }} + namespace: {{ "{{" }} zeppelin.k8s.interpreter.namespace {{ "}}" }} + {% if zeppelin.k8s.server.uid is defined %} + ownerReferences: + - apiVersion: v1 + controller: false + blockOwnerDeletion: false + kind: Pod + name: {{ "{{" }} zeppelin.k8s.server.pod.name {{ "}}" }} + uid: {{ "{{" }} zeppelin.k8s.server.uid {{ "}}" }} + {% endif %} + spec: + clusterIP: None + ports: + - name: intp + port: 12321 + {% if zeppelin.k8s.interpreter.group.name == "spark" %} + - name: spark-driver + port: 22321 + - name: spark-blockmanager + port: 22322 + - name: spark-ui + port: 4040 + {% endif %} + selector: + app: {{ "{{" }} zeppelin.k8s.interpreter.pod.name {{ "}}" }} + {% if zeppelin.k8s.interpreter.group.name == "spark" %} + {% if zeppelin.k8s.spark.useIngress is defined and zeppelin.k8s.spark.useIngress == "true" %} + --- + # create ingress of spark UI + apiVersion: networking.k8s.io/v1 + kind: Ingress + metadata: + name: spark-ui-{{ "{{" }} zeppelin.k8s.interpreter.pod.name {{ "}}" }} + namespace: {{ "{{" }} zeppelin.k8s.interpreter.namespace {{ "}}" }} + {% if zeppelin.k8s.server.uid is defined %} + ownerReferences: + - apiVersion: v1 + controller: false + blockOwnerDeletion: false + kind: Pod + name: {{ "{{" }} zeppelin.k8s.server.pod.name {{ "}}" }} + uid: {{ "{{" }} zeppelin.k8s.server.uid {{ "}}" }} + {% endif %} + spec: + rules: + - host: {{ "{{" }} zeppelin.k8s.spark.ingress.host {{ "}}" }} + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: {{ "{{" }} zeppelin.k8s.interpreter.pod.name {{ "}}" }} + port: + number: 4040 + {% endif %} + {% endif %} diff --git a/charts/zeppelin/templates/interpreter/role.yaml b/charts/zeppelin/templates/interpreter/role.yaml new file mode 100644 index 00000000000..69ff9220f95 --- /dev/null +++ b/charts/zeppelin/templates/interpreter/role.yaml @@ -0,0 +1,36 @@ +{{/* +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: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ include "zeppelin.interpreter.roleName" . }} + namespace: {{ .Release.Namespace }} +rules: +- apiGroups: + - "" + resources: + - pods + - configmaps + - services + verbs: + - get + - list + - watch + - create + - update + - delete \ No newline at end of file diff --git a/charts/zeppelin/templates/interpreter/rolebinding.yaml b/charts/zeppelin/templates/interpreter/rolebinding.yaml new file mode 100644 index 00000000000..b9d23d7d66d --- /dev/null +++ b/charts/zeppelin/templates/interpreter/rolebinding.yaml @@ -0,0 +1,29 @@ +{{/* +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: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ include "zeppelin.interpreter.roleBindingName" . }} + namespace: {{ .Release.Namespace }} +subjects: +- kind: ServiceAccount + name: {{ include "zeppelin.interpreter.serviceAccountName" . }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ include "zeppelin.interpreter.roleName" . }} \ No newline at end of file diff --git a/charts/zeppelin/templates/interpreter/serviceaccount.yaml b/charts/zeppelin/templates/interpreter/serviceaccount.yaml new file mode 100644 index 00000000000..08efae88dfd --- /dev/null +++ b/charts/zeppelin/templates/interpreter/serviceaccount.yaml @@ -0,0 +1,30 @@ +{{/* +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 .Values.interpreter.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "zeppelin.interpreter.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "zeppelin.labels" . | nindent 4 }} + {{- with .Values.interpreter.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/zeppelin/templates/server/_helpers.tpl b/charts/zeppelin/templates/server/_helpers.tpl new file mode 100644 index 00000000000..8651aa15496 --- /dev/null +++ b/charts/zeppelin/templates/server/_helpers.tpl @@ -0,0 +1,78 @@ +{{/* +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. +*/}} + +{{/* +Create the name of Zeppelin server. +*/}} +{{- define "zeppelin.server.name" -}} +{{- include "zeppelin.fullname" . }}-server +{{- end -}} + +{{/* +Common labels for Zeppelin server. +*/}} +{{- define "zeppelin.server.labels" -}} +{{ include "zeppelin.labels" . }} +app.kubernetes.io/component: zeppelin-server +{{- end }} + +{{/* +Selector labels for Zeppelin server. +*/}} +{{- define "zeppelin.server.selectorLabels" -}} +{{ include "zeppelin.selectorLabels" . }} +app.kubernetes.io/component: zeppelin-server +{{- end }} + +{{/* +Create the name of the service account for Zeppelin server. +*/}} +{{- define "zeppelin.server.serviceAccountName" -}} +{{- if .Values.server.serviceAccount.create }} +{{- default (include "zeppelin.server.name" .) .Values.server.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.server.serviceAccount.name }} +{{- end }} +{{- end }} + +{{/* +Create the name of the role for Zeppelin server. +*/}} +{{- define "zeppelin.server.roleName" -}} +{{- include "zeppelin.server.serviceAccountName" . }} +{{- end -}} + +{{/* +Create the name of the role binding for Zeppelin server. +*/}} +{{- define "zeppelin.server.roleBindingName" -}} +{{- include "zeppelin.server.serviceAccountName" . }} +{{- end -}} + +{{/* +Create the name of the deployment for Zeppelin server. +*/}} +{{- define "zeppelin.server.deploymentName" -}} +{{- include "zeppelin.server.name" . }} +{{- end -}} + +{{/* +Create the name of the service for Zeppelin server. +*/}} +{{- define "zeppelin.server.serviceName" -}} +{{ include "zeppelin.server.name" . }}-svc +{{- end -}} diff --git a/charts/zeppelin/templates/server/deployment.yaml b/charts/zeppelin/templates/server/deployment.yaml new file mode 100644 index 00000000000..53062f10555 --- /dev/null +++ b/charts/zeppelin/templates/server/deployment.yaml @@ -0,0 +1,159 @@ +# +# 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: + name: {{ include "zeppelin.server.deploymentName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "zeppelin.server.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicas }} + selector: + matchLabels: + {{- include "zeppelin.server.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "zeppelin.server.selectorLabels" . | nindent 8 }} + {{- with .Values.annotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + containers: + - name: zeppelin-server + image: {{ include "zeppelin.server.image" . }} + {{- with .Values.global.image.pullPolicy }} + imagePullPolicy: {{ . }} + {{- end }} + command: + - sh + - -c + - $(ZEPPELIN_HOME)/bin/zeppelin.sh + env: + - name: POD_UID + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.uid + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + {{- with .Values.env }} + {{- toYaml . | nindent 8 }} + {{- end }} + envFrom: + - configMapRef: + name: {{ include "zeppelin.envConfigMapName" . }} + volumeMounts: + - name: zeppelin-interpreter-conf + mountPath: /opt/zeppelin/k8s/interpreter + ports: + - name: http + containerPort: 8080 + - name: https + containerPort: 8443 + - name: rpc + containerPort: 12320 + lifecycle: + preStop: + exec: + # SIGTERM triggers a quick exit; gracefully terminate instead + command: + - sh + - -c + - "ps -ef | grep org.apache.zeppelin.server.ZeppelinServer | grep -v grep | awk '{print $2}' | xargs kill" + {{- with .Values.resources }} + resources: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.securityContext }} + securityContext: + {{- toYaml . | nindent 12 }} + {{- end }} + - name: zeppelin-server-gateway + image: nginx:1.14.0 + env: + - name: SERVICE_DOMAIN + valueFrom: + configMapKeyRef: + name: {{ include "zeppelin.envConfigMapName" . }} + key: SERVICE_DOMAIN + command: + - bin/sh + - -c + args: + - cp -f /tmp/conf/nginx.conf /etc/nginx/nginx.conf; + sed -i -e "s/SERVICE_DOMAIN/$SERVICE_DOMAIN/g" /etc/nginx/nginx.conf; + sed -i -e "s/NAMESPACE/$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)/g" /etc/nginx/nginx.conf; + cat /etc/nginx/nginx.conf; + /usr/sbin/nginx + volumeMounts: + - name: nginx-conf + mountPath: /tmp/conf + lifecycle: + preStop: + exec: + command: + - /usr/sbin/nginx + - -s + - quit + - name: dnsmasq + image: janeczku/go-dnsmasq:release-1.0.5 + args: + - --listen + - 127.0.0.1:53 + - --default-resolver + - --append-search-domains + - --hostsfile=/etc/hosts + - --verbose + volumes: + - name: zeppelin-interpreter-conf + configMap: + name: {{ include "zeppelin.interpreter.configMapName" . }} + optional: false + - name: nginx-conf + configMap: + name: {{ include "zeppelin.nginxConfigMapName" . }} + items: + - key: nginx.conf + path: nginx.conf + {{- with .Values.global.image.pullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "zeppelin.server.serviceAccountName" . }} + {{- with .Values.podSecurityContext }} + securityContext: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/zeppelin/templates/server/env-configmap.yaml b/charts/zeppelin/templates/server/env-configmap.yaml new file mode 100644 index 00000000000..fcca19f6010 --- /dev/null +++ b/charts/zeppelin/templates/server/env-configmap.yaml @@ -0,0 +1,54 @@ +{{/* +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: {{ include "zeppelin.envConfigMapName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "zeppelin.labels" . | nindent 4 }} +data: + # 'serviceDomain' is a Domain name to use for accessing Zeppelin UI. + # Should point IP address of 'zeppelin-server' service. + # + # Wildcard subdomain need to be point the same IP address to access service inside of Pod (such as SparkUI). + # i.e. if service domain is 'local.zeppelin-project.org', DNS configuration should make 'local.zeppelin-project.org' and '*.local.zeppelin-project.org' point the same address. + # + # Default value is 'local.zeppelin-project.org' while it points 127.0.0.1 and `kubectl port-forward zeppelin-server` will give localhost to connects. + # If you have your ingress controller configured to connect to `zeppelin-server` service and have a domain name for it (with wildcard subdomain point the same address), you can replace serviceDomain field with your own domain. + SERVICE_DOMAIN: local.zeppelin-project.org:8080 + + ZEPPELIN_PORT: "8080" + + ZEPPELIN_K8S_SPARK_CONTAINER_IMAGE: {{ include "zeppelin.spark.image" . }} + + ZEPPELIN_K8S_CONTAINER_IMAGE: {{ include "zeppelin.interpreter.image" . }} + + ZEPPELIN_K8S_TEMPLATE_DIR: /opt/zeppelin/k8s + + ZEPPELIN_K8S_SERVICE_NAME: {{ include "zeppelin.server.serviceName" . }} + + ZEPPELIN_HOME: /opt/zeppelin + + ZEPPELIN_SERVER_RPC_PORTRANGE: 12320:12320 + + # default value of 'master' property for spark interpreter. + SPARK_MASTER: k8s://https://kubernetes.default.svc + + # default value of 'SPARK_HOME' property for spark interpreter. + SPARK_HOME: /spark diff --git a/charts/zeppelin/templates/server/nginx-conf.yaml b/charts/zeppelin/templates/server/nginx-conf.yaml new file mode 100644 index 00000000000..997a1c9188b --- /dev/null +++ b/charts/zeppelin/templates/server/nginx-conf.yaml @@ -0,0 +1,69 @@ +{{/* +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: {{ include "zeppelin.nginxConfigMapName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "zeppelin.labels" . | nindent 4 }} +data: + nginx.conf: | + daemon off; + worker_processes auto; + events { + worker_connections 1024; + } + http { + map $http_upgrade $connection_upgrade { + default upgrade; + '' close; + } + + # first server block will be default. Proxy zeppelin server. + server { + listen 80; + location / { + proxy_pass http://localhost:8080; + proxy_set_header Host $host; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_redirect http://localhost $scheme://SERVICE_DOMAIN; + } + } + + # match request domain [port]-[service].[serviceDomain] + # proxy extra service such as spark-ui + server { + listen 80; + server_name "~(?[0-9]+)-(?[^.]*)\.(.*)"; + location / { + resolver 127.0.0.1:53 ipv6=off; + proxy_pass http://$svc_name.NAMESPACE.svc:$svc_port; + proxy_set_header Host $host; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_redirect http://localhost $scheme://SERVICE_DOMAIN; + + # redirect rule for spark ui. 302 redirect response misses port number of service domain + proxy_redirect ~(http:[/]+[0-9]+[-][^-]+[-][^.]+)[^/]+(\/jobs.*) $1.SERVICE_DOMAIN$2; + } + } + } diff --git a/charts/zeppelin/templates/server/role.yaml b/charts/zeppelin/templates/server/role.yaml new file mode 100644 index 00000000000..1e69cd98820 --- /dev/null +++ b/charts/zeppelin/templates/server/role.yaml @@ -0,0 +1,48 @@ +{{/* +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 .Values.server.serviceAccount.create -}} +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: {{ include "zeppelin.server.roleName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "zeppelin.server.labels" . | nindent 4 }} +rules: +- apiGroups: + - "" + resources: + - pods + - configmaps + - services + verbs: + - get + - list + - watch + - create + - update + - patch + - delete +- apiGroups: + - networking.k8s.io + resources: + - ingresses + verbs: + - create + - delete +{{- end }} diff --git a/charts/zeppelin/templates/server/rolebinding.yaml b/charts/zeppelin/templates/server/rolebinding.yaml new file mode 100644 index 00000000000..895867cce5e --- /dev/null +++ b/charts/zeppelin/templates/server/rolebinding.yaml @@ -0,0 +1,33 @@ +{{/* +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 .Values.server.serviceAccount.create -}} +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: {{ include "zeppelin.server.roleBindingName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "zeppelin.labels" . | nindent 4 }} +subjects: +- kind: ServiceAccount + name: {{ include "zeppelin.server.serviceAccountName" . }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ include "zeppelin.server.roleName" . }} +{{- end }} diff --git a/charts/zeppelin/templates/server/service.yaml b/charts/zeppelin/templates/server/service.yaml new file mode 100644 index 00000000000..5dd2afc515e --- /dev/null +++ b/charts/zeppelin/templates/server/service.yaml @@ -0,0 +1,33 @@ +{{/* +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: Service +metadata: + name: {{ include "zeppelin.server.serviceName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "zeppelin.server.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - name: http + port: 8080 + - name: rpc + port: 12320 + selector: + {{- include "zeppelin.server.selectorLabels" . | nindent 4 }} diff --git a/charts/zeppelin/templates/server/serviceaccount.yaml b/charts/zeppelin/templates/server/serviceaccount.yaml new file mode 100644 index 00000000000..de7d4ec3766 --- /dev/null +++ b/charts/zeppelin/templates/server/serviceaccount.yaml @@ -0,0 +1,30 @@ +{{/* +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 .Values.server.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "zeppelin.server.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "zeppelin.server.labels" . | nindent 4 }} + {{- with .Values.server.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/zeppelin/values.yaml b/charts/zeppelin/values.yaml new file mode 100644 index 00000000000..467c2365d0e --- /dev/null +++ b/charts/zeppelin/values.yaml @@ -0,0 +1,122 @@ +# Default values for zeppelin. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# -- String to partially override release name. +nameOverride: "" + +# -- String to fully override release name. +fullnameOverride: "" + +global: + image: + # -- Image registry. + registry: docker.io + # -- Image pull policy. + pullPolicy: IfNotPresent + # -- Image pull secrets for private image registry. + pullSecrets: [] + # - name: + +server: + image: + # -- Zeppelin server image registry. + # @default -- If not set, `global.image.registry` will be used. + registry: "" + # -- Zeppelin server image repository. + repository: apache/zeppelin + # -- Zeppelin image tag. + # @default -- If not set, the chart appVersion will be used. + tag: "" + + serviceAccount: + # -- Specifies whether a service account should be created for the Zeppelin server. + create: true + # -- Optional name for the Zeppelin server service account. + name: "" + # -- Extra annotations for the Zeppelin server service account. + annotations: {} + +interpreter: + image: + # -- Zeppelin interpreter image registry. + # @default -- If not set, `global.image.registry` will be used. + registry: "" + # -- Zeppelin interpreter image repository. + repository: apache/zeppelin-interpreter + # -- Zeppelin interpreter image tag. + # @default -- If not set, the chart appVersion will be used. + tag: "" + + serviceAccount: + serviceAccount: + # -- Specifies whether a service account should be created for the Zeppelin interpreter. + create: true + # -- Optional name for the Zeppelin interpreter service account. + name: "" + # -- Extra annotations for the Zeppelin interpreter service account. + annotations: {} + +spark: + image: + # -- Spark image registry. + # @default -- If not set, `global.image.registry` will be used. + registry: "" + # -- Spark image repository. + repository: spark + # -- Spark image tag. + tag: 3.5.3 + +replicas: 1 + +# -- Extra labels for controller pods. +labels: {} + # key1: value1 + # key2: value2 + +# -- Extra annotations for controller pods. +annotations: {} + # key1: value1 + # key2: value2 + +# -- Volumes for controller pods. +volumes: [] + +# -- Node selector for controller pods. +nodeSelector: {} + +# -- Affinity for controller pods. +affinity: {} + +# -- List of node taints to tolerate for controller pods. +tolerations: [] + +# -- Priority class for controller pods. +priorityClassName: "" + +# -- Security context for controller pods. +podSecurityContext: {} + +# -- Environment variables for controller containers. +env: [] + +# -- Environment variable sources for controller containers. +envFrom: [] + +# -- Volume mounts for controller containers. +volumeMounts: [] + +# -- Pod resource requests and limits for controller containers. +resources: {} + # limits: + # cpu: 100m + # memory: 300Mi + # requests: + # cpu: 100m + # memory: 300Mi + +# -- Security context for controller containers. +securityContext: {} + +service: + type: ClusterIP From be34c5bfc4623d25220e4c968b20ee114d104e8a Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Tue, 5 Nov 2024 14:11:53 +0800 Subject: [PATCH 02/18] Update Helm chart README Signed-off-by: Yi Chen --- charts/zeppelin/README.md | 28 ++++++++++++++-------------- charts/zeppelin/values.yaml | 27 ++++++++++++++------------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/charts/zeppelin/README.md b/charts/zeppelin/README.md index b7a69d9e6f3..244b9a91f4e 100644 --- a/charts/zeppelin/README.md +++ b/charts/zeppelin/README.md @@ -30,20 +30,20 @@ A Helm chart for deploying Apache Zeppelin on Kubernetes. | spark.image.repository | string | `"spark"` | Spark image repository. | | spark.image.tag | string | `"3.5.3"` | Spark image tag. | | replicas | int | `1` | | -| labels | object | `{}` | Extra labels for controller pods. | -| annotations | object | `{}` | Extra annotations for controller pods. | -| volumes | list | `[]` | Volumes for controller pods. | -| nodeSelector | object | `{}` | Node selector for controller pods. | -| affinity | object | `{}` | Affinity for controller pods. | -| tolerations | list | `[]` | List of node taints to tolerate for controller pods. | -| priorityClassName | string | `""` | Priority class for controller pods. | -| podSecurityContext | object | `{}` | Security context for controller pods. | -| env | list | `[]` | Environment variables for controller containers. | -| envFrom | list | `[]` | Environment variable sources for controller containers. | -| volumeMounts | list | `[]` | Volume mounts for controller containers. | -| resources | object | `{}` | Pod resource requests and limits for controller containers. | -| securityContext | object | `{}` | Security context for controller containers. | -| service.type | string | `"ClusterIP"` | | +| labels | object | `{}` | Extra labels for Zeppelin server pods. | +| annotations | object | `{}` | Extra annotations for Zeppelin server pods. | +| volumes | list | `[]` | Volumes for Zeppelin server pods. | +| nodeSelector | object | `{}` | Node selector for Zeppelin server pods. | +| affinity | object | `{}` | Affinity for Zeppelin server pods. | +| tolerations | list | `[]` | List of node taints to tolerate for Zeppelin server pods. | +| priorityClassName | string | `""` | Priority class for Zeppelin server pods. | +| podSecurityContext | object | `{}` | Security context for Zeppelin server pods. | +| env | list | `[]` | Environment variables for Zeppelin server containers. | +| envFrom | list | `[]` | Environment variable sources for Zeppelin server containers. | +| volumeMounts | list | `[]` | Volume mounts for Zeppelin server containers. | +| resources | object | `{}` | Resource requests and limits for Zeppelin server containers. | +| securityContext | object | `{}` | Security context for Zeppelin server containers. | +| service.type | string | `"ClusterIP"` | Service type for Zeppelin server. | ## Maintainers diff --git a/charts/zeppelin/values.yaml b/charts/zeppelin/values.yaml index 467c2365d0e..852a0027213 100644 --- a/charts/zeppelin/values.yaml +++ b/charts/zeppelin/values.yaml @@ -69,44 +69,44 @@ spark: replicas: 1 -# -- Extra labels for controller pods. +# -- Extra labels for Zeppelin server pods. labels: {} # key1: value1 # key2: value2 -# -- Extra annotations for controller pods. +# -- Extra annotations for Zeppelin server pods. annotations: {} # key1: value1 # key2: value2 -# -- Volumes for controller pods. +# -- Volumes for Zeppelin server pods. volumes: [] -# -- Node selector for controller pods. +# -- Node selector for Zeppelin server pods. nodeSelector: {} -# -- Affinity for controller pods. +# -- Affinity for Zeppelin server pods. affinity: {} -# -- List of node taints to tolerate for controller pods. +# -- List of node taints to tolerate for Zeppelin server pods. tolerations: [] -# -- Priority class for controller pods. +# -- Priority class for Zeppelin server pods. priorityClassName: "" -# -- Security context for controller pods. +# -- Security context for Zeppelin server pods. podSecurityContext: {} -# -- Environment variables for controller containers. +# -- Environment variables for Zeppelin server containers. env: [] -# -- Environment variable sources for controller containers. +# -- Environment variable sources for Zeppelin server containers. envFrom: [] -# -- Volume mounts for controller containers. +# -- Volume mounts for Zeppelin server containers. volumeMounts: [] -# -- Pod resource requests and limits for controller containers. +# -- Resource requests and limits for Zeppelin server containers. resources: {} # limits: # cpu: 100m @@ -115,8 +115,9 @@ resources: {} # cpu: 100m # memory: 300Mi -# -- Security context for controller containers. +# -- Security context for Zeppelin server containers. securityContext: {} service: + # -- Service type for Zeppelin server. type: ClusterIP From 37d0ce9342c69228c06b6c838522e0ef69f01954 Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Tue, 5 Nov 2024 18:48:46 +0800 Subject: [PATCH 03/18] Add support for configuring Zeppelin Signed-off-by: Yi Chen --- charts/zeppelin/README.md | 1 + .../zeppelin/templates/server/configmap.yaml | 182 ++++++++++++++++++ .../zeppelin/templates/server/deployment.yaml | 6 + charts/zeppelin/values.yaml | 14 +- 4 files changed, 200 insertions(+), 3 deletions(-) create mode 100644 charts/zeppelin/templates/server/configmap.yaml diff --git a/charts/zeppelin/README.md b/charts/zeppelin/README.md index 244b9a91f4e..5cd80c07a2e 100644 --- a/charts/zeppelin/README.md +++ b/charts/zeppelin/README.md @@ -29,6 +29,7 @@ A Helm chart for deploying Apache Zeppelin on Kubernetes. | spark.image.registry | string | If not set, `global.image.registry` will be used. | Spark image registry. | | spark.image.repository | string | `"spark"` | Spark image repository. | | spark.image.tag | string | `"3.5.3"` | Spark image tag. | +| zeppelinConf | object | `{"zeppelin.server.addr":"127.0.0.1","zeppelin.server.port":8080}` | Zeppelin configurations. | | replicas | int | `1` | | | labels | object | `{}` | Extra labels for Zeppelin server pods. | | annotations | object | `{}` | Extra annotations for Zeppelin server pods. | diff --git a/charts/zeppelin/templates/server/configmap.yaml b/charts/zeppelin/templates/server/configmap.yaml new file mode 100644 index 00000000000..7af708420a9 --- /dev/null +++ b/charts/zeppelin/templates/server/configmap.yaml @@ -0,0 +1,182 @@ +{{/* +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: {{ include "zeppelin.configMapName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "zeppelin.labels" . | nindent 4 }} +data: + zeppelin-site.xml: | + + + + + {{- range $key, $value := .Values.zeppelin.conf }} + + {{ $key }} + {{ $value }} + + {{- end }} + + + log4j.properties: | + # + # 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. + # + + log4j.rootLogger = INFO, dailyfile + + log4j.appender.stdout = org.apache.log4j.ConsoleAppender + log4j.appender.stdout.layout = org.apache.log4j.PatternLayout + log4j.appender.stdout.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n + + log4j.appender.dailyfile.DatePattern=.yyyy-MM-dd + log4j.appender.dailyfile = org.apache.log4j.DailyRollingFileAppender + log4j.appender.dailyfile.File = ${zeppelin.log.file} + log4j.appender.dailyfile.layout = org.apache.log4j.PatternLayout + log4j.appender.dailyfile.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n + + log4j2.properties: | + # This affects logging for both user code and Flink + rootLogger.level = INFO + rootLogger.appenderRef.file.ref = MainAppender + + # Uncomment this if you want to _only_ change Flink's logging + #logger.flink.name = org.apache.flink + #logger.flink.level = INFO + + # The following lines keep the log level of common libraries/connectors on + # log level INFO. The root logger does not override this. You have to manually + # change the log levels here. + logger.akka.name = akka + logger.akka.level = INFO + logger.kafka.name= org.apache.kafka + logger.kafka.level = INFO + logger.hadoop.name = org.apache.hadoop + logger.hadoop.level = INFO + logger.zookeeper.name = org.apache.zookeeper + logger.zookeeper.level = INFO + + # Log all infos in the given file + appender.main.name = MainAppender + appender.main.type = File + appender.main.append = false + appender.main.fileName = ${sys:zeppelin.log.file} + appender.main.layout.type = PatternLayout + appender.main.layout.pattern = %d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %-60c %x - %m%n + + # Suppress the irrelevant (wrong) warnings from the Netty channel handler + logger.netty.name = org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline + logger.netty.level = OFF + + interpreter-list: | + # 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. + # + # + # [name] [maven artifact] [description] + + alluxio org.apache.zeppelin:zeppelin-alluxio:0.11.2 Alluxio interpreter + angular org.apache.zeppelin:zeppelin-angular:0.11.2 HTML and AngularJS view rendering + bigquery org.apache.zeppelin:zeppelin-bigquery:0.11.2 BigQuery interpreter + cassandra org.apache.zeppelin:zeppelin-cassandra:0.11.2 Cassandra interpreter + elasticsearch org.apache.zeppelin:zeppelin-elasticsearch:0.11.2 Elasticsearch interpreter + file org.apache.zeppelin:zeppelin-file:0.11.2 HDFS file interpreter + flink org.apache.zeppelin:zeppelin-flink:0.11.2 Flink interpreter + groovy org.apache.zeppelin:zeppelin-groovy:0.11.2 Groovy interpreter + hbase org.apache.zeppelin:zeppelin-hbase:0.11.2 Hbase interpreter + java org.apache.zeppelin:zeppelin-java:0.11.2 Java interpreter + jdbc org.apache.zeppelin:zeppelin-jdbc:0.11.2 Jdbc interpreter + livy org.apache.zeppelin:zeppelin-livy:0.11.2 Livy interpreter + md org.apache.zeppelin:zeppelin-markdown:0.11.2 Markdown support + neo4j org.apache.zeppelin:zeppelin-neo4j:0.11.2 Neo4j interpreter + python org.apache.zeppelin:zeppelin-python:0.11.2 Python interpreter + shell org.apache.zeppelin:zeppelin-shell:0.11.2 Shell command + sparql org.apache.zeppelin:zeppelin-sparql:0.11.2 Sparql interpreter + submarine org.apache.zeppelin:zeppelin-submarine:0.11.2 Submarine interpreter + + configurations.xsl: | + + + + + + + + + + + + + + + + + + + + +
namevaluedescription
+ + +
+
diff --git a/charts/zeppelin/templates/server/deployment.yaml b/charts/zeppelin/templates/server/deployment.yaml index 53062f10555..92fe16ff2b6 100644 --- a/charts/zeppelin/templates/server/deployment.yaml +++ b/charts/zeppelin/templates/server/deployment.yaml @@ -64,6 +64,8 @@ spec: - configMapRef: name: {{ include "zeppelin.envConfigMapName" . }} volumeMounts: + - name: zeppelin-conf + mountPath: /opt/zeppelin/conf - name: zeppelin-interpreter-conf mountPath: /opt/zeppelin/k8s/interpreter ports: @@ -126,6 +128,10 @@ spec: - --hostsfile=/etc/hosts - --verbose volumes: + - name: zeppelin-conf + configMap: + name: {{ include "zeppelin.configMapName" . }} + optional: false - name: zeppelin-interpreter-conf configMap: name: {{ include "zeppelin.interpreter.configMapName" . }} diff --git a/charts/zeppelin/values.yaml b/charts/zeppelin/values.yaml index 852a0027213..9e5a95f56ca 100644 --- a/charts/zeppelin/values.yaml +++ b/charts/zeppelin/values.yaml @@ -10,11 +10,11 @@ fullnameOverride: "" global: image: - # -- Image registry. + # -- Global image registry. registry: docker.io - # -- Image pull policy. + # -- Global image pull policy. pullPolicy: IfNotPresent - # -- Image pull secrets for private image registry. + # -- Global image pull secrets for private image registry. pullSecrets: [] # - name: @@ -67,6 +67,14 @@ spark: # -- Spark image tag. tag: 3.5.3 +zeppelin: + # -- Zeppelin configurations. + conf: + # Zeppelin server binding address. + zeppelin.server.addr: 127.0.0.1 + # Zeppelin server port. + zeppelin.server.port: 8080 + replicas: 1 # -- Extra labels for Zeppelin server pods. From 20ec7f3921e08512826b6ae4a57181e00483cee5 Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Tue, 12 Nov 2024 17:43:21 +0800 Subject: [PATCH 04/18] Update Signed-off-by: Yi Chen --- .../templates/interpreter/_helpers.tpl | 7 ++++ .../templates/interpreter/configmap.yaml | 11 ++++-- .../interpreter/spark-configmap.yaml | 38 +++++++++++++++++++ .../zeppelin/templates/server/deployment.yaml | 4 -- .../{configmap.yaml => zeppelin-conf.yaml} | 0 .../{env-configmap.yaml => zeppelin-env.yaml} | 0 charts/zeppelin/values.yaml | 8 +--- 7 files changed, 55 insertions(+), 13 deletions(-) create mode 100644 charts/zeppelin/templates/interpreter/spark-configmap.yaml rename charts/zeppelin/templates/server/{configmap.yaml => zeppelin-conf.yaml} (100%) rename charts/zeppelin/templates/server/{env-configmap.yaml => zeppelin-env.yaml} (100%) diff --git a/charts/zeppelin/templates/interpreter/_helpers.tpl b/charts/zeppelin/templates/interpreter/_helpers.tpl index 4fbb7ed70ca..ff36006586d 100644 --- a/charts/zeppelin/templates/interpreter/_helpers.tpl +++ b/charts/zeppelin/templates/interpreter/_helpers.tpl @@ -53,3 +53,10 @@ Create the name of the config map for Zeppelin interpreter. {{- define "zeppelin.interpreter.configMapName" -}} {{- include "zeppelin.interpreter.name" . }}-conf {{- end -}} + +{{/* +Create the name of the config map for Zeppelin interpreter. +*/}} +{{- define "zeppelin.interpreter.spark.configMapName" -}} +{{- include "zeppelin.interpreter.name" . }}-spark-conf +{{- end -}} diff --git a/charts/zeppelin/templates/interpreter/configmap.yaml b/charts/zeppelin/templates/interpreter/configmap.yaml index 628d9871c2a..e62ee416116 100644 --- a/charts/zeppelin/templates/interpreter/configmap.yaml +++ b/charts/zeppelin/templates/interpreter/configmap.yaml @@ -55,9 +55,9 @@ data: containers: - name: {{ "{{" }} zeppelin.k8s.interpreter.container.name {{ "}}" }} image: {{ "{{" }} zeppelin.k8s.interpreter.container.image {{ "}}" }} - {% if zeppelin.k8s.interpreter.container.imagePullPolicy is defined %} - imagePullPolicy: {{ "{{" }} zeppelin.k8s.interpreter.container.imagePullPolicy {{ "}}" }} - {% endif %} + {{- with .Values.global.image.pullPolicy }} + imagePullPolicy: {{ . }} + {{- end }} args: - "$(ZEPPELIN_HOME)/bin/interpreter.sh" - "-d" @@ -101,6 +101,8 @@ data: volumeMounts: - name: spark-home mountPath: /spark + - name: spark-pod-template + mountPath: /etc/spark initContainers: - name: spark-home-init image: {{ "{{" }} zeppelin.k8s.spark.container.image {{ "}}" }} @@ -120,6 +122,9 @@ data: volumes: - name: spark-home emptyDir: {} + - name: spark-pod-template + configMap: + name: {{ include "zeppelin.interpreter.spark.configMapName" . }} {% endif %} --- diff --git a/charts/zeppelin/templates/interpreter/spark-configmap.yaml b/charts/zeppelin/templates/interpreter/spark-configmap.yaml new file mode 100644 index 00000000000..b8da539d1e1 --- /dev/null +++ b/charts/zeppelin/templates/interpreter/spark-configmap.yaml @@ -0,0 +1,38 @@ +{{/* +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: {{ include "zeppelin.interpreter.spark.configMapName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "zeppelin.labels" . | nindent 4 }} +data: + pod-template.yaml: | + apiVersion: v1 + kind: PodTemplate + metadata: + name: spark-pod-template + template: + spec: + {{- with .Values.nodeSelector }} + nodeSelector: {{ . }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: {{ . }} + {{- end }} diff --git a/charts/zeppelin/templates/server/deployment.yaml b/charts/zeppelin/templates/server/deployment.yaml index 92fe16ff2b6..13f9d7bd4c1 100644 --- a/charts/zeppelin/templates/server/deployment.yaml +++ b/charts/zeppelin/templates/server/deployment.yaml @@ -23,7 +23,6 @@ metadata: labels: {{- include "zeppelin.server.labels" . | nindent 4 }} spec: - replicas: {{ .Values.replicas }} selector: matchLabels: {{- include "zeppelin.server.selectorLabels" . | nindent 6 }} @@ -78,7 +77,6 @@ spec: lifecycle: preStop: exec: - # SIGTERM triggers a quick exit; gracefully terminate instead command: - sh - -c @@ -131,11 +129,9 @@ spec: - name: zeppelin-conf configMap: name: {{ include "zeppelin.configMapName" . }} - optional: false - name: zeppelin-interpreter-conf configMap: name: {{ include "zeppelin.interpreter.configMapName" . }} - optional: false - name: nginx-conf configMap: name: {{ include "zeppelin.nginxConfigMapName" . }} diff --git a/charts/zeppelin/templates/server/configmap.yaml b/charts/zeppelin/templates/server/zeppelin-conf.yaml similarity index 100% rename from charts/zeppelin/templates/server/configmap.yaml rename to charts/zeppelin/templates/server/zeppelin-conf.yaml diff --git a/charts/zeppelin/templates/server/env-configmap.yaml b/charts/zeppelin/templates/server/zeppelin-env.yaml similarity index 100% rename from charts/zeppelin/templates/server/env-configmap.yaml rename to charts/zeppelin/templates/server/zeppelin-env.yaml diff --git a/charts/zeppelin/values.yaml b/charts/zeppelin/values.yaml index 9e5a95f56ca..2eb35dd4bfc 100644 --- a/charts/zeppelin/values.yaml +++ b/charts/zeppelin/values.yaml @@ -69,13 +69,9 @@ spark: zeppelin: # -- Zeppelin configurations. + # For detailed information, please refer: https://zeppelin.apache.org/docs/latest/setup/operation/configuration.html. conf: - # Zeppelin server binding address. - zeppelin.server.addr: 127.0.0.1 - # Zeppelin server port. - zeppelin.server.port: 8080 - -replicas: 1 + # spark.kubernetes.driver.podTemplateFile: local:///driver.yml # -- Extra labels for Zeppelin server pods. labels: {} From df75a1620aaf7c412f98c2b930433af03a23b9ad Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Tue, 12 Nov 2024 19:26:25 +0800 Subject: [PATCH 05/18] Remove zeppelin server gateway Signed-off-by: Yi Chen --- .../zeppelin/templates/server/deployment.yaml | 27 -------- .../zeppelin/templates/server/nginx-conf.yaml | 69 ------------------- 2 files changed, 96 deletions(-) delete mode 100644 charts/zeppelin/templates/server/nginx-conf.yaml diff --git a/charts/zeppelin/templates/server/deployment.yaml b/charts/zeppelin/templates/server/deployment.yaml index 13f9d7bd4c1..2c93ce118a5 100644 --- a/charts/zeppelin/templates/server/deployment.yaml +++ b/charts/zeppelin/templates/server/deployment.yaml @@ -89,33 +89,6 @@ spec: securityContext: {{- toYaml . | nindent 12 }} {{- end }} - - name: zeppelin-server-gateway - image: nginx:1.14.0 - env: - - name: SERVICE_DOMAIN - valueFrom: - configMapKeyRef: - name: {{ include "zeppelin.envConfigMapName" . }} - key: SERVICE_DOMAIN - command: - - bin/sh - - -c - args: - - cp -f /tmp/conf/nginx.conf /etc/nginx/nginx.conf; - sed -i -e "s/SERVICE_DOMAIN/$SERVICE_DOMAIN/g" /etc/nginx/nginx.conf; - sed -i -e "s/NAMESPACE/$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)/g" /etc/nginx/nginx.conf; - cat /etc/nginx/nginx.conf; - /usr/sbin/nginx - volumeMounts: - - name: nginx-conf - mountPath: /tmp/conf - lifecycle: - preStop: - exec: - command: - - /usr/sbin/nginx - - -s - - quit - name: dnsmasq image: janeczku/go-dnsmasq:release-1.0.5 args: diff --git a/charts/zeppelin/templates/server/nginx-conf.yaml b/charts/zeppelin/templates/server/nginx-conf.yaml deleted file mode 100644 index 997a1c9188b..00000000000 --- a/charts/zeppelin/templates/server/nginx-conf.yaml +++ /dev/null @@ -1,69 +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. -*/}} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "zeppelin.nginxConfigMapName" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "zeppelin.labels" . | nindent 4 }} -data: - nginx.conf: | - daemon off; - worker_processes auto; - events { - worker_connections 1024; - } - http { - map $http_upgrade $connection_upgrade { - default upgrade; - '' close; - } - - # first server block will be default. Proxy zeppelin server. - server { - listen 80; - location / { - proxy_pass http://localhost:8080; - proxy_set_header Host $host; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $connection_upgrade; - proxy_redirect http://localhost $scheme://SERVICE_DOMAIN; - } - } - - # match request domain [port]-[service].[serviceDomain] - # proxy extra service such as spark-ui - server { - listen 80; - server_name "~(?[0-9]+)-(?[^.]*)\.(.*)"; - location / { - resolver 127.0.0.1:53 ipv6=off; - proxy_pass http://$svc_name.NAMESPACE.svc:$svc_port; - proxy_set_header Host $host; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $connection_upgrade; - proxy_redirect http://localhost $scheme://SERVICE_DOMAIN; - - # redirect rule for spark ui. 302 redirect response misses port number of service domain - proxy_redirect ~(http:[/]+[0-9]+[-][^-]+[-][^.]+)[^/]+(\/jobs.*) $1.SERVICE_DOMAIN$2; - } - } - } From a88ac10f0c267980f636dee272229d92bc6ab283 Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Tue, 12 Nov 2024 19:23:28 +0800 Subject: [PATCH 06/18] Remove dnsmasq Signed-off-by: Yi Chen --- .../zeppelin/templates/server/deployment.yaml | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/charts/zeppelin/templates/server/deployment.yaml b/charts/zeppelin/templates/server/deployment.yaml index 2c93ce118a5..a7c94dd2e1d 100644 --- a/charts/zeppelin/templates/server/deployment.yaml +++ b/charts/zeppelin/templates/server/deployment.yaml @@ -89,28 +89,6 @@ spec: securityContext: {{- toYaml . | nindent 12 }} {{- end }} - - name: dnsmasq - image: janeczku/go-dnsmasq:release-1.0.5 - args: - - --listen - - 127.0.0.1:53 - - --default-resolver - - --append-search-domains - - --hostsfile=/etc/hosts - - --verbose - volumes: - - name: zeppelin-conf - configMap: - name: {{ include "zeppelin.configMapName" . }} - - name: zeppelin-interpreter-conf - configMap: - name: {{ include "zeppelin.interpreter.configMapName" . }} - - name: nginx-conf - configMap: - name: {{ include "zeppelin.nginxConfigMapName" . }} - items: - - key: nginx.conf - path: nginx.conf {{- with .Values.global.image.pullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} From e4bced5f7fe5a471f45b050960ccd7fe7b86c2ce Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Wed, 13 Nov 2024 14:57:27 +0800 Subject: [PATCH 07/18] Update license comments Signed-off-by: Yi Chen --- .../templates/interpreter/_helpers.tpl | 4 +-- .../templates/interpreter/configmap.yaml | 4 +-- .../zeppelin/templates/interpreter/role.yaml | 4 +-- .../templates/interpreter/rolebinding.yaml | 4 +-- .../templates/interpreter/serviceaccount.yaml | 4 +-- .../interpreter/spark-configmap.yaml | 4 +-- charts/zeppelin/templates/server/_helpers.tpl | 4 +-- .../zeppelin/templates/server/deployment.yaml | 32 +++++++++---------- charts/zeppelin/templates/server/role.yaml | 4 +-- .../templates/server/rolebinding.yaml | 4 +-- charts/zeppelin/templates/server/service.yaml | 4 +-- .../templates/server/serviceaccount.yaml | 4 +-- .../templates/server/zeppelin-conf.yaml | 4 +-- .../templates/server/zeppelin-env.yaml | 4 +-- 14 files changed, 42 insertions(+), 42 deletions(-) diff --git a/charts/zeppelin/templates/interpreter/_helpers.tpl b/charts/zeppelin/templates/interpreter/_helpers.tpl index ff36006586d..87fafdbc3ec 100644 --- a/charts/zeppelin/templates/interpreter/_helpers.tpl +++ b/charts/zeppelin/templates/interpreter/_helpers.tpl @@ -1,4 +1,4 @@ -{{/* +{{- /* 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. @@ -13,7 +13,7 @@ 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. -*/}} +*/ -}} {{/* Create the name of Zeppelin interpreter. diff --git a/charts/zeppelin/templates/interpreter/configmap.yaml b/charts/zeppelin/templates/interpreter/configmap.yaml index e62ee416116..dc14476820f 100644 --- a/charts/zeppelin/templates/interpreter/configmap.yaml +++ b/charts/zeppelin/templates/interpreter/configmap.yaml @@ -1,4 +1,4 @@ -{{/* +{{- /* 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. @@ -13,7 +13,7 @@ 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 diff --git a/charts/zeppelin/templates/interpreter/role.yaml b/charts/zeppelin/templates/interpreter/role.yaml index 69ff9220f95..9d2cea46c1e 100644 --- a/charts/zeppelin/templates/interpreter/role.yaml +++ b/charts/zeppelin/templates/interpreter/role.yaml @@ -1,4 +1,4 @@ -{{/* +{{- /* 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. @@ -13,7 +13,7 @@ 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: rbac.authorization.k8s.io/v1 kind: Role diff --git a/charts/zeppelin/templates/interpreter/rolebinding.yaml b/charts/zeppelin/templates/interpreter/rolebinding.yaml index b9d23d7d66d..68f8561feda 100644 --- a/charts/zeppelin/templates/interpreter/rolebinding.yaml +++ b/charts/zeppelin/templates/interpreter/rolebinding.yaml @@ -1,4 +1,4 @@ -{{/* +{{- /* 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. @@ -13,7 +13,7 @@ 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: rbac.authorization.k8s.io/v1 kind: RoleBinding diff --git a/charts/zeppelin/templates/interpreter/serviceaccount.yaml b/charts/zeppelin/templates/interpreter/serviceaccount.yaml index 08efae88dfd..bdfdaa9cc8a 100644 --- a/charts/zeppelin/templates/interpreter/serviceaccount.yaml +++ b/charts/zeppelin/templates/interpreter/serviceaccount.yaml @@ -1,4 +1,4 @@ -{{/* +{{- /* 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. @@ -13,7 +13,7 @@ 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 .Values.interpreter.serviceAccount.create -}} apiVersion: v1 diff --git a/charts/zeppelin/templates/interpreter/spark-configmap.yaml b/charts/zeppelin/templates/interpreter/spark-configmap.yaml index b8da539d1e1..de0dbedf2ba 100644 --- a/charts/zeppelin/templates/interpreter/spark-configmap.yaml +++ b/charts/zeppelin/templates/interpreter/spark-configmap.yaml @@ -1,4 +1,4 @@ -{{/* +{{- /* 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. @@ -13,7 +13,7 @@ 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 diff --git a/charts/zeppelin/templates/server/_helpers.tpl b/charts/zeppelin/templates/server/_helpers.tpl index 8651aa15496..27023cf2e4e 100644 --- a/charts/zeppelin/templates/server/_helpers.tpl +++ b/charts/zeppelin/templates/server/_helpers.tpl @@ -1,4 +1,4 @@ -{{/* +{{- /* 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. @@ -13,7 +13,7 @@ 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. -*/}} +*/ -}} {{/* Create the name of Zeppelin server. diff --git a/charts/zeppelin/templates/server/deployment.yaml b/charts/zeppelin/templates/server/deployment.yaml index a7c94dd2e1d..f2c942aa978 100644 --- a/charts/zeppelin/templates/server/deployment.yaml +++ b/charts/zeppelin/templates/server/deployment.yaml @@ -1,19 +1,19 @@ -# -# 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. -# +{{- /* +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 diff --git a/charts/zeppelin/templates/server/role.yaml b/charts/zeppelin/templates/server/role.yaml index 1e69cd98820..a20199ca482 100644 --- a/charts/zeppelin/templates/server/role.yaml +++ b/charts/zeppelin/templates/server/role.yaml @@ -1,4 +1,4 @@ -{{/* +{{- /* 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. @@ -13,7 +13,7 @@ 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 .Values.server.serviceAccount.create -}} kind: Role diff --git a/charts/zeppelin/templates/server/rolebinding.yaml b/charts/zeppelin/templates/server/rolebinding.yaml index 895867cce5e..3ca08346ccf 100644 --- a/charts/zeppelin/templates/server/rolebinding.yaml +++ b/charts/zeppelin/templates/server/rolebinding.yaml @@ -1,4 +1,4 @@ -{{/* +{{- /* 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. @@ -13,7 +13,7 @@ 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 .Values.server.serviceAccount.create -}} kind: RoleBinding diff --git a/charts/zeppelin/templates/server/service.yaml b/charts/zeppelin/templates/server/service.yaml index 5dd2afc515e..704910c432d 100644 --- a/charts/zeppelin/templates/server/service.yaml +++ b/charts/zeppelin/templates/server/service.yaml @@ -1,4 +1,4 @@ -{{/* +{{- /* 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. @@ -13,7 +13,7 @@ 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: Service diff --git a/charts/zeppelin/templates/server/serviceaccount.yaml b/charts/zeppelin/templates/server/serviceaccount.yaml index de7d4ec3766..f37bdcaa35f 100644 --- a/charts/zeppelin/templates/server/serviceaccount.yaml +++ b/charts/zeppelin/templates/server/serviceaccount.yaml @@ -1,4 +1,4 @@ -{{/* +{{- /* 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. @@ -13,7 +13,7 @@ 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 .Values.server.serviceAccount.create -}} apiVersion: v1 diff --git a/charts/zeppelin/templates/server/zeppelin-conf.yaml b/charts/zeppelin/templates/server/zeppelin-conf.yaml index 7af708420a9..e2a4adf35ff 100644 --- a/charts/zeppelin/templates/server/zeppelin-conf.yaml +++ b/charts/zeppelin/templates/server/zeppelin-conf.yaml @@ -1,4 +1,4 @@ -{{/* +{{- /* 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. @@ -13,7 +13,7 @@ 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 diff --git a/charts/zeppelin/templates/server/zeppelin-env.yaml b/charts/zeppelin/templates/server/zeppelin-env.yaml index fcca19f6010..b85aee3d571 100644 --- a/charts/zeppelin/templates/server/zeppelin-env.yaml +++ b/charts/zeppelin/templates/server/zeppelin-env.yaml @@ -1,4 +1,4 @@ -{{/* +{{- /* 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. @@ -13,7 +13,7 @@ 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 From cee2547fa0fefbebd0254b29b45f9255281d90cb Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Wed, 13 Nov 2024 15:02:29 +0800 Subject: [PATCH 08/18] Update zeppelin server deployment when configuration changes Signed-off-by: Yi Chen --- charts/zeppelin/templates/server/deployment.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/zeppelin/templates/server/deployment.yaml b/charts/zeppelin/templates/server/deployment.yaml index f2c942aa978..55cb176bab7 100644 --- a/charts/zeppelin/templates/server/deployment.yaml +++ b/charts/zeppelin/templates/server/deployment.yaml @@ -22,6 +22,10 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "zeppelin.server.labels" . | nindent 4 }} + annotations: + zeppelin.apache.org/zeppelin-conf-hash: {{ include (print $.Template.BasePath "/server/zeppelin-conf.yaml") . | sha256sum }} + zeppelin.apache.org/zeppelin-env-hash: {{ include (print $.Template.BasePath "/server/zeppelin-env.yaml") . | sha256sum }} + zeppelin.apache.org/zeppelin-interpreter-spec-hash: {{ include (print $.Template.BasePath "/interpreter/configmap.yaml") . | sha256sum }} spec: selector: matchLabels: From 5bd0dfc2ebe365baf56b08a3eb81226abe4e9bea Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Wed, 13 Nov 2024 15:12:05 +0800 Subject: [PATCH 09/18] Mount conf files via subPath Signed-off-by: Yi Chen --- .../zeppelin/templates/server/deployment.yaml | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/charts/zeppelin/templates/server/deployment.yaml b/charts/zeppelin/templates/server/deployment.yaml index 55cb176bab7..bac918ab5d9 100644 --- a/charts/zeppelin/templates/server/deployment.yaml +++ b/charts/zeppelin/templates/server/deployment.yaml @@ -68,9 +68,23 @@ spec: name: {{ include "zeppelin.envConfigMapName" . }} volumeMounts: - name: zeppelin-conf - mountPath: /opt/zeppelin/conf + mountPath: /opt/zeppelin/conf/zeppelin-site.xml + subPath: zeppelin-site.xml + - name: zeppelin-conf + mountPath: /opt/zeppelin/conf/log4j.properties + subPath: log4j.properties + - name: zeppelin-conf + mountPath: /opt/zeppelin/conf/log4j2.properties + subPath: log4j2.properties + - name: zeppelin-conf + mountPath: /opt/zeppelin/conf/interpreter-list + subPath: interpreter-list + - name: zeppelin-conf + mountPath: /opt/zeppelin/conf/configurations.xsl + subPath: configurations.xsl - name: zeppelin-interpreter-conf - mountPath: /opt/zeppelin/k8s/interpreter + mountPath: /opt/zeppelin/k8s/interpreter/interpreter-spec.yaml + subPath: interpreter-spec.yaml ports: - name: http containerPort: 8080 @@ -97,6 +111,27 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + volumes: + - name: zeppelin-conf + configMap: + name: {{ include "zeppelin.configMapName" . }} + items: + - key: zeppelin-site.xml + path: zeppelin-site.xml + - key: log4j.properties + path: log4j.properties + - key: log4j2.properties + path: log4j2.properties + - key: interpreter-list + path: interpreter-list + - key: configurations.xsl + path: configurations.xsl + - name: zeppelin-interpreter-conf + configMap: + name: {{ include "zeppelin.interpreter.configMapName" . }} + items: + - key: interpreter-spec.yaml + path: interpreter-spec.yaml {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} From 0fa943604fdd87f980077180e701480f2a6e9411 Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Wed, 13 Nov 2024 16:58:09 +0800 Subject: [PATCH 10/18] Update Signed-off-by: Yi Chen --- charts/zeppelin/README.md | 59 +++-- charts/zeppelin/files/conf/configuration.xsl | 41 ++++ charts/zeppelin/files/conf/interpreter-list | 37 +++ charts/zeppelin/files/conf/log4j.properties | 28 +++ charts/zeppelin/files/conf/log4j2.properties | 49 ++++ charts/zeppelin/templates/_helpers.tpl | 51 ---- .../templates/interpreter/_helpers.tpl | 17 +- .../templates/interpreter/configmap.yaml | 177 ++++++++------ .../interpreter/spark-configmap.yaml | 38 --- .../templates/interpreter/spark/_helpers.tpl | 40 ++++ .../interpreter/spark/configmap.yaml | 91 ++++++++ charts/zeppelin/templates/server/_helpers.tpl | 17 ++ .../zeppelin/templates/server/configmap.yaml | 71 ++++++ .../zeppelin/templates/server/deployment.yaml | 67 +++--- .../templates/server/zeppelin-conf.yaml | 182 --------------- .../templates/server/zeppelin-env.yaml | 54 ----- charts/zeppelin/values.yaml | 218 ++++++++++++------ 17 files changed, 725 insertions(+), 512 deletions(-) create mode 100644 charts/zeppelin/files/conf/configuration.xsl create mode 100644 charts/zeppelin/files/conf/interpreter-list create mode 100644 charts/zeppelin/files/conf/log4j.properties create mode 100644 charts/zeppelin/files/conf/log4j2.properties delete mode 100644 charts/zeppelin/templates/interpreter/spark-configmap.yaml create mode 100644 charts/zeppelin/templates/interpreter/spark/_helpers.tpl create mode 100644 charts/zeppelin/templates/interpreter/spark/configmap.yaml create mode 100644 charts/zeppelin/templates/server/configmap.yaml delete mode 100644 charts/zeppelin/templates/server/zeppelin-conf.yaml delete mode 100644 charts/zeppelin/templates/server/zeppelin-env.yaml diff --git a/charts/zeppelin/README.md b/charts/zeppelin/README.md index 5cd80c07a2e..e04bab84252 100644 --- a/charts/zeppelin/README.md +++ b/charts/zeppelin/README.md @@ -10,40 +10,57 @@ A Helm chart for deploying Apache Zeppelin on Kubernetes. |-----|------|---------|-------------| | nameOverride | string | `""` | String to partially override release name. | | fullnameOverride | string | `""` | String to fully override release name. | -| global.image.registry | string | `"docker.io"` | Image registry. | -| global.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy. | -| global.image.pullSecrets | list | `[]` | Image pull secrets for private image registry. | +| global.image.registry | string | `"docker.io"` | Global image registry. | +| global.image.pullPolicy | string | `"IfNotPresent"` | Global image pull policy. | +| global.image.pullSecrets | list | `[]` | Global image pull secrets for private image registry. | | server.image.registry | string | If not set, `global.image.registry` will be used. | Zeppelin server image registry. | | server.image.repository | string | `"apache/zeppelin"` | Zeppelin server image repository. | | server.image.tag | string | If not set, the chart appVersion will be used. | Zeppelin image tag. | +| server.image.pullPolicy | string | `"IfNotPresent"` | Zeppelin server image pull policy. | +| server.image.pullSecrets | list | `[]` | Zeppelin server image pull secrets for private image registry. | +| server.conf | object | `{}` | Zeppelin configurations. For detailed information, please refer: https://zeppelin.apache.org/docs/latest/setup/operation/configuration.html. | +| server.labels | object | `{}` | Extra labels for Zeppelin server pods. | +| server.annotations | object | `{}` | Extra annotations for Zeppelin server pods. | +| server.volumes | list | `[]` | Volumes for Zeppelin server pods. | +| server.nodeSelector | object | `{}` | Node selector for Zeppelin server pods. | +| server.affinity | object | `{}` | Affinity for Zeppelin server pods. | +| server.tolerations | list | `[]` | List of node taints to tolerate for Zeppelin server pods. | +| server.priorityClassName | string | `""` | Priority class for Zeppelin server pods. | +| server.podSecurityContext | object | `{}` | Security context for Zeppelin server pods. | +| server.env | list | `[{"name":"ZEPPELIN_HOME","value":"/opt/zeppelin"},{"name":"SPARK_HOME","value":"/opt/spark"},{"name":"SERVICE_DOMAIN","value":"local.zeppelin-project.org:8080"},{"name":"ZEPPELIN_PORT","value":"8080"},{"name":"ZEPPELIN_SERVER_RPC_PORTRANGE","value":"12320:12320"},{"name":"ZEPPELIN_K8S_TEMPLATE_DIR","value":"/opt/zeppelin/k8s"}]` | Environment variables for Zeppelin server containers. | +| server.envFrom | list | `[]` | Environment variable sources for Zeppelin server containers. | +| server.volumeMounts | list | `[]` | Volume mounts for Zeppelin server containers. | +| server.resources | object | `{}` | Resource requests and limits for Zeppelin server containers. | +| server.securityContext | object | `{"runAsGroup":0,"runAsNonRoot":true,"runAsUser":1000}` | Security context for Zeppelin server containers. | | server.serviceAccount.create | bool | `true` | Specifies whether a service account should be created for the Zeppelin server. | | server.serviceAccount.name | string | `""` | Optional name for the Zeppelin server service account. | | server.serviceAccount.annotations | object | `{}` | Extra annotations for the Zeppelin server service account. | | interpreter.image.registry | string | If not set, `global.image.registry` will be used. | Zeppelin interpreter image registry. | | interpreter.image.repository | string | `"apache/zeppelin-interpreter"` | Zeppelin interpreter image repository. | | interpreter.image.tag | string | If not set, the chart appVersion will be used. | Zeppelin interpreter image tag. | +| interpreter.image.pullPolicy | string | `"IfNotPresent"` | Zeppelin interpreter image pull policy. | +| interpreter.image.pullSecrets | list | `[]` | Zeppelin interpreter image pull secrets for private image registry. | +| interpreter.spark.image.registry | string | If not set, `global.image.registry` will be used. | Spark image registry. | +| interpreter.spark.image.repository | string | `"spark"` | Spark image repository. | +| interpreter.spark.image.tag | string | `"3.5.3"` | Spark image tag. | +| interpreter.spark.conf | object | `{"spark.kubernetes.driver.podTemplateFile":"file:///opt/spark/conf/driver-pod-template.yaml","spark.kubernetes.executor.podTemplateFile":"file:///opt/spark/conf/executor-pod-template.yaml"}` | Spark configurations. | +| interpreter.labels | object | `{}` | Extra labels for Zeppelin interpreter pods. | +| interpreter.annotations | object | `{}` | Extra annotations for Zeppelin interpreter pods. | +| interpreter.volumes | list | `[]` | Volumes for Zeppelin interpreter pods. | +| interpreter.nodeSelector | object | `{}` | Node selector for Zeppelin interpreter pods. | +| interpreter.affinity | object | `{}` | Affinity for Zeppelin interpreter pods. | +| interpreter.tolerations | list | `[]` | List of node taints to tolerate for Zeppelin interpreter pods. | +| interpreter.priorityClassName | string | `""` | Priority class for Zeppelin interpreter pods. | +| interpreter.podSecurityContext | object | `{}` | Security context for Zeppelin interpreter pods. | +| interpreter.env | list | `[{"name":"ZEPPELIN_HOME","value":"/opt/zeppelin"},{"name":"SPARK_HOME","value":"/opt/spark"},{"name":"SPARK_CONF_DIR","value":"/opt/spark/conf"}]` | Environment variables for Zeppelin interpreter containers. | +| interpreter.envFrom | list | `[]` | Environment variable sources for Zeppelin interpreter containers. | +| interpreter.volumeMounts | list | `[]` | Volume mounts for Zeppelin interpreter containers. | +| interpreter.resources | object | `{}` | Resource requests and limits for Zeppelin interpreter containers. | +| interpreter.securityContext | object | `{"runAsGroup":0,"runAsNonRoot":true,"runAsUser":1000}` | Security context for Zeppelin interpreter containers. | | interpreter.serviceAccount.serviceAccount | string | `nil` | | | interpreter.serviceAccount.create | bool | `true` | Specifies whether a service account should be created for the Zeppelin interpreter. | | interpreter.serviceAccount.name | string | `""` | Optional name for the Zeppelin interpreter service account. | | interpreter.serviceAccount.annotations | object | `{}` | Extra annotations for the Zeppelin interpreter service account. | -| spark.image.registry | string | If not set, `global.image.registry` will be used. | Spark image registry. | -| spark.image.repository | string | `"spark"` | Spark image repository. | -| spark.image.tag | string | `"3.5.3"` | Spark image tag. | -| zeppelinConf | object | `{"zeppelin.server.addr":"127.0.0.1","zeppelin.server.port":8080}` | Zeppelin configurations. | -| replicas | int | `1` | | -| labels | object | `{}` | Extra labels for Zeppelin server pods. | -| annotations | object | `{}` | Extra annotations for Zeppelin server pods. | -| volumes | list | `[]` | Volumes for Zeppelin server pods. | -| nodeSelector | object | `{}` | Node selector for Zeppelin server pods. | -| affinity | object | `{}` | Affinity for Zeppelin server pods. | -| tolerations | list | `[]` | List of node taints to tolerate for Zeppelin server pods. | -| priorityClassName | string | `""` | Priority class for Zeppelin server pods. | -| podSecurityContext | object | `{}` | Security context for Zeppelin server pods. | -| env | list | `[]` | Environment variables for Zeppelin server containers. | -| envFrom | list | `[]` | Environment variable sources for Zeppelin server containers. | -| volumeMounts | list | `[]` | Volume mounts for Zeppelin server containers. | -| resources | object | `{}` | Resource requests and limits for Zeppelin server containers. | -| securityContext | object | `{}` | Security context for Zeppelin server containers. | | service.type | string | `"ClusterIP"` | Service type for Zeppelin server. | ## Maintainers diff --git a/charts/zeppelin/files/conf/configuration.xsl b/charts/zeppelin/files/conf/configuration.xsl new file mode 100644 index 00000000000..e2d68370ad3 --- /dev/null +++ b/charts/zeppelin/files/conf/configuration.xsl @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + +
namevaluedescription
+ + +
+
diff --git a/charts/zeppelin/files/conf/interpreter-list b/charts/zeppelin/files/conf/interpreter-list new file mode 100644 index 00000000000..9b9b8a42898 --- /dev/null +++ b/charts/zeppelin/files/conf/interpreter-list @@ -0,0 +1,37 @@ +# 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. +# +# +# [name] [maven artifact] [description] + +alluxio org.apache.zeppelin:zeppelin-alluxio:0.11.2 Alluxio interpreter +angular org.apache.zeppelin:zeppelin-angular:0.11.2 HTML and AngularJS view rendering +bigquery org.apache.zeppelin:zeppelin-bigquery:0.11.2 BigQuery interpreter +cassandra org.apache.zeppelin:zeppelin-cassandra:0.11.2 Cassandra interpreter +elasticsearch org.apache.zeppelin:zeppelin-elasticsearch:0.11.2 Elasticsearch interpreter +file org.apache.zeppelin:zeppelin-file:0.11.2 HDFS file interpreter +flink org.apache.zeppelin:zeppelin-flink:0.11.2 Flink interpreter +groovy org.apache.zeppelin:zeppelin-groovy:0.11.2 Groovy interpreter +hbase org.apache.zeppelin:zeppelin-hbase:0.11.2 Hbase interpreter +java org.apache.zeppelin:zeppelin-java:0.11.2 Java interpreter +jdbc org.apache.zeppelin:zeppelin-jdbc:0.11.2 Jdbc interpreter +livy org.apache.zeppelin:zeppelin-livy:0.11.2 Livy interpreter +md org.apache.zeppelin:zeppelin-markdown:0.11.2 Markdown support +neo4j org.apache.zeppelin:zeppelin-neo4j:0.11.2 Neo4j interpreter +python org.apache.zeppelin:zeppelin-python:0.11.2 Python interpreter +shell org.apache.zeppelin:zeppelin-shell:0.11.2 Shell command +sparql org.apache.zeppelin:zeppelin-sparql:0.11.2 Sparql interpreter +submarine org.apache.zeppelin:zeppelin-submarine:0.11.2 Submarine interpreter diff --git a/charts/zeppelin/files/conf/log4j.properties b/charts/zeppelin/files/conf/log4j.properties new file mode 100644 index 00000000000..5e900ba0387 --- /dev/null +++ b/charts/zeppelin/files/conf/log4j.properties @@ -0,0 +1,28 @@ +# +# 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. +# + +log4j.rootLogger = INFO, stdout, dailyfile + +log4j.appender.stdout = org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout = org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n + +log4j.appender.dailyfile.DatePattern=.yyyy-MM-dd +log4j.appender.dailyfile = org.apache.log4j.DailyRollingFileAppender +log4j.appender.dailyfile.File = ${zeppelin.log.file} +log4j.appender.dailyfile.layout = org.apache.log4j.PatternLayout +log4j.appender.dailyfile.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n diff --git a/charts/zeppelin/files/conf/log4j2.properties b/charts/zeppelin/files/conf/log4j2.properties new file mode 100644 index 00000000000..8b5f4e0c231 --- /dev/null +++ b/charts/zeppelin/files/conf/log4j2.properties @@ -0,0 +1,49 @@ +# +# 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. +# + +# This affects logging for both user code and Flink +rootLogger.level = INFO +rootLogger.appenderRef.file.ref = MainAppender + +# Uncomment this if you want to _only_ change Flink's logging +#logger.flink.name = org.apache.flink +#logger.flink.level = INFO + +# The following lines keep the log level of common libraries/connectors on +# log level INFO. The root logger does not override this. You have to manually +# change the log levels here. +logger.akka.name = akka +logger.akka.level = INFO +logger.kafka.name= org.apache.kafka +logger.kafka.level = INFO +logger.hadoop.name = org.apache.hadoop +logger.hadoop.level = INFO +logger.zookeeper.name = org.apache.zookeeper +logger.zookeeper.level = INFO + +# Log all infos in the given file +appender.main.name = MainAppender +appender.main.type = File +appender.main.append = false +appender.main.fileName = ${sys:zeppelin.log.file} +appender.main.layout.type = PatternLayout +appender.main.layout.pattern = %d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %-60c %x - %m%n + +# Suppress the irrelevant (wrong) warnings from the Netty channel handler +logger.netty.name = org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline +logger.netty.level = OFF diff --git a/charts/zeppelin/templates/_helpers.tpl b/charts/zeppelin/templates/_helpers.tpl index ee18971a6d5..83be4f92049 100644 --- a/charts/zeppelin/templates/_helpers.tpl +++ b/charts/zeppelin/templates/_helpers.tpl @@ -49,54 +49,3 @@ Selector labels app.kubernetes.io/name: {{ include "zeppelin.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} - -{{/* -Create the name of the configmap to use -*/}} -{{- define "zeppelin.configMapName" -}} -{{- include "zeppelin.fullname" . }}-conf -{{- end -}} - -{{/* -Create the name of the configmap to use -*/}} -{{- define "zeppelin.envConfigMapName" -}} -{{- include "zeppelin.fullname" . }}-env -{{- end -}} - -{{/* -Create the name of the nginx configmap to use -*/}} -{{- define "zeppelin.nginxConfigMapName" -}} -{{- include "zeppelin.fullname" . }}-nginx-conf -{{- end -}} - -{{/* -Create the name of the Zeppelin image to use -*/}} -{{- define "zeppelin.server.image" -}} -{{- $imageRegistry := .Values.server.image.registry | default .Values.global.image.registry | default "docker.io" }} -{{- $imageRepository := .Values.server.image.repository | default "apache/zeppelin" }} -{{- $imageTag := .Values.server.image.tag | default "latest" }} -{{- printf "%s/%s:%s" $imageRegistry $imageRepository $imageTag }} -{{- end -}} - -{{/* -Create the name of the Zeppelin interpreter image to use -*/}} -{{- define "zeppelin.interpreter.image" -}} -{{- $imageRegistry := .Values.interpreter.image.registry | default .Values.global.image.registry | default "docker.io" }} -{{- $imageRepository := .Values.interpreter.image.repository | default "apache/zeppelin" }} -{{- $imageTag := .Values.interpreter.image.tag | default "latest" }} -{{- printf "%s/%s:%s" $imageRegistry $imageRepository $imageTag }} -{{- end -}} - -{{/* -Create the name of the Spark image to use -*/}} -{{- define "zeppelin.spark.image" -}} -{{- $imageRegistry := .Values.spark.image.registry | default .Values.global.image.registry | default "docker.io" }} -{{- $imageRepository := .Values.spark.image.repository | default "spark" }} -{{- $imageTag := .Values.spark.image.tag | default "latest" }} -{{- printf "%s/%s:%s" $imageRegistry $imageRepository $imageTag }} -{{- end -}} diff --git a/charts/zeppelin/templates/interpreter/_helpers.tpl b/charts/zeppelin/templates/interpreter/_helpers.tpl index 87fafdbc3ec..accabd52345 100644 --- a/charts/zeppelin/templates/interpreter/_helpers.tpl +++ b/charts/zeppelin/templates/interpreter/_helpers.tpl @@ -22,6 +22,14 @@ Create the name of Zeppelin interpreter. {{- include "zeppelin.fullname" . }}-interpreter {{- end -}} +{{/* +Common labels for Zeppelin server. +*/}} +{{- define "zeppelin.interpreter.labels" -}} +{{ include "zeppelin.labels" . }} +app.kubernetes.io/component: zeppelin-interpreter +{{- end }} + {{/* Create the name of the service account for Zeppelin interpreter. */}} @@ -55,8 +63,11 @@ Create the name of the config map for Zeppelin interpreter. {{- end -}} {{/* -Create the name of the config map for Zeppelin interpreter. +Create the name of the Zeppelin interpreter image to use */}} -{{- define "zeppelin.interpreter.spark.configMapName" -}} -{{- include "zeppelin.interpreter.name" . }}-spark-conf +{{- define "zeppelin.interpreter.image" -}} +{{- $imageRegistry := .Values.interpreter.image.registry | default .Values.global.image.registry | default "docker.io" }} +{{- $imageRepository := .Values.interpreter.image.repository | default "apache/zeppelin" }} +{{- $imageTag := .Values.interpreter.image.tag | default "latest" }} +{{- printf "%s/%s:%s" $imageRegistry $imageRepository $imageTag }} {{- end -}} diff --git a/charts/zeppelin/templates/interpreter/configmap.yaml b/charts/zeppelin/templates/interpreter/configmap.yaml index dc14476820f..2af0f015f17 100644 --- a/charts/zeppelin/templates/interpreter/configmap.yaml +++ b/charts/zeppelin/templates/interpreter/configmap.yaml @@ -30,6 +30,7 @@ data: name: {{ "{{" }} zeppelin.k8s.interpreter.pod.name {{ "}}" }} namespace: {{ "{{" }} zeppelin.k8s.interpreter.namespace {{ "}}" }} labels: + {{- include "zeppelin.interpreter.labels" . | nindent 8 }} app: {{ "{{" }} zeppelin.k8s.interpreter.pod.name {{ "}}" }} interpreterGroupId: {{ "{{" }} zeppelin.k8s.interpreter.group.id {{ "}}" }} interpreterSettingName: {{ "{{" }} zeppelin.k8s.interpreter.setting.name {{ "}}" }} @@ -44,88 +45,125 @@ data: uid: {{ "{{" }} zeppelin.k8s.server.uid }} {% endif %} spec: - serviceAccountName: {{ include "zeppelin.interpreter.serviceAccountName" . }} {% if zeppelin.k8s.interpreter.group.name == "spark" %} - automountServiceAccountToken: true - {% else %} - automountServiceAccountToken: false + initContainers: + - name: spark-home-init + image: {{ include "zeppelin.interpreter.spark.image" . }} + imagePullPolicy: {{ .Values.interpreter.image.pullPolicy | default .Values.global.image.pullPolicy | default "IfNotPresent" }} + command: + - sh + - -c + - cp -r /opt/spark/* /spark/ + volumeMounts: + - name: spark + mountPath: /spark {% endif %} - restartPolicy: Never - terminationGracePeriodSeconds: 30 containers: - - name: {{ "{{" }} zeppelin.k8s.interpreter.container.name {{ "}}" }} - image: {{ "{{" }} zeppelin.k8s.interpreter.container.image {{ "}}" }} - {{- with .Values.global.image.pullPolicy }} - imagePullPolicy: {{ . }} - {{- end }} + - name: zeppelin-interpreter + image: {{ include "zeppelin.interpreter.image" . }} + imagePullPolicy: {{ .Values.interpreter.image.pullPolicy | default .Values.global.image.pullPolicy | default "IfNotPresent" }} args: - - "$(ZEPPELIN_HOME)/bin/interpreter.sh" - - "-d" - - "$(ZEPPELIN_HOME)/interpreter/{{ "{{" }} zeppelin.k8s.interpreter.group.name {{ "}}" }}" - - "-r" - - "{{ "{{" }} zeppelin.k8s.interpreter.rpc.portRange {{ "}}" }}" - - "-c" - - "{{ "{{" }} zeppelin.k8s.server.rpc.service {{ "}}" }}" - - "-p" - - "{{ "{{" }} zeppelin.k8s.server.rpc.portRange {{ "}}" }}" - - "-i" - - "{{ "{{" }} zeppelin.k8s.interpreter.group.id {{ "}}" }}" - - "-l" - - "{{ "{{" }} zeppelin.k8s.interpreter.localRepo {{ "}}" }}/{{ "{{" }} zeppelin.k8s.interpreter.setting.name {{ "}}" }}" - - "-g" - - "{{ "{{" }} zeppelin.k8s.interpreter.setting.name {{ "}}" }}" + - $(ZEPPELIN_HOME)/bin/interpreter.sh + - -d + - $(ZEPPELIN_HOME)/interpreter/{{ "{{" }} zeppelin.k8s.interpreter.group.name {{ "}}" }} + - -r + - {{ "{{" }} zeppelin.k8s.interpreter.rpc.portRange {{ "}}" }} + - -c + - {{ "{{" }} zeppelin.k8s.server.rpc.service {{ "}}" }} + - -p + - {{ "{{" }} zeppelin.k8s.server.rpc.portRange {{ "}}" }} + - -i + - {{ "{{" }} zeppelin.k8s.interpreter.group.id {{ "}}" }} + - -l + - {{ "{{" }} zeppelin.k8s.interpreter.localRepo {{ "}}" }}/{{ "{{" }} zeppelin.k8s.interpreter.setting.name {{ "}}" }} + - -g + - {{ "{{" }} zeppelin.k8s.interpreter.setting.name {{ "}}" }} env: - {% for key, value in zeppelin.k8s.envs.items() %} + {% for key, value in zeppelin.k8s.envs.items() %} - name: {{ "{{" }} key {{ "}}" }} value: {{ "{{" }} value {{ "}}" }} - {% endfor %} - {% if zeppelin.k8s.interpreter.cores is defined and zeppelin.k8s.interpreter.memory is defined %} + {% endfor %} + {{- with .Values.interpreter.env }} + {{- toYaml . | nindent 8 }} + {{- end }} + {% if zeppelin.k8s.interpreter.cores is defined and zeppelin.k8s.interpreter.memory is defined %} resources: requests: memory: "{{ "{{" }} zeppelin.k8s.interpreter.memory {{ "}}" }}" cpu: "{{ "{{" }} zeppelin.k8s.interpreter.cores {{ "}}" }}" - {# limits.memory is not set because of a potential OOM-Killer. https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits #} limits: cpu: "{{ "{{" }} zeppelin.k8s.interpreter.cores {{ "}}" }}" {% if zeppelin.k8s.interpreter.gpu.type is defined and zeppelin.k8s.interpreter.gpu.nums is defined %} - {{ "{{" }} zeppelin.k8s.interpreter.gpu.type {{ "}}" }}: " {{ "{{" }} zeppelin.k8s.interpreter.gpu.nums {{ "}}" }}" + {{ "{{" }} zeppelin.k8s.interpreter.gpu.type {{ "}}" }}: " {{ "{{" }} zeppelin.k8s.interpreter.gpu.nums {{ "}}" }}" {% endif %} - {% else %} - {% if zeppelin.k8s.interpreter.gpu.type is defined and zeppelin.k8s.interpreter.gpu.nums is defined %} + {% else %} + {% if zeppelin.k8s.interpreter.gpu.type is defined and zeppelin.k8s.interpreter.gpu.nums is defined %} resources: limits: - {{ "{{" }} zeppelin.k8s.interpreter.gpu.type {{ "}}" }}: " {{ "{{" }} zeppelin.k8s.interpreter.gpu.nums {{ "}}" }}" - {% endif %} - {% endif %} - {% if zeppelin.k8s.interpreter.group.name == "spark" %} - volumeMounts: - - name: spark-home - mountPath: /spark - - name: spark-pod-template - mountPath: /etc/spark - initContainers: - - name: spark-home-init - image: {{ "{{" }} zeppelin.k8s.spark.container.image {{ "}}" }} - {% if zeppelin.k8s.spark.container.imagePullPolicy is defined %} - imagePullPolicy: {{ "{{" }} zeppelin.k8s.spark.container.imagePullPolicy {{ "}}" }} + {{ "{{" }} zeppelin.k8s.interpreter.gpu.type {{ "}}" }}: " {{ "{{" }} zeppelin.k8s.interpreter.gpu.nums {{ "}}" }}" + {% endif %} {% endif %} - command: ["sh", "-c", "cp -r /opt/spark/* /spark/"] volumeMounts: - - name: spark-home - mountPath: /spark - {% if zeppelin.k8s.interpreter.imagePullSecrets is defined %} + {% if zeppelin.k8s.interpreter.group.name == "spark" %} + - name: spark + mountPath: /opt/spark + - name: spark-conf + subPath: spark-defaults.conf + mountPath: /opt/spark/conf/spark-defaults.conf + - name: spark-conf + subPath: driver-pod-template.yaml + mountPath: /opt/spark/conf/driver-pod-template.yaml + - name: spark-conf + subPath: executor-pod-template.yaml + mountPath: /opt/spark/conf/executor-pod-template.yaml + {% endif %} + {{- with .Values.interpreter.volumeMounts }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.global.image.pullSecrets }} imagePullSecrets: - {% for secret in zeppelin.k8s.interpreter.imagePullSecrets.split(',') %} - - name: {{ "{{" }} secret {{ "}}" }} - {% endfor %} - {% endif %} + {{- toYaml . | nindent 6 }} + {{- end }} volumes: - - name: spark-home + {% if zeppelin.k8s.interpreter.group.name == "spark" %} + - name: spark emptyDir: {} - - name: spark-pod-template + - name: spark-conf configMap: name: {{ include "zeppelin.interpreter.spark.configMapName" . }} + items: + - key: spark-defaults.conf + path: spark-defaults.conf + - key: driver-pod-template.yaml + path: driver-pod-template.yaml + - key: executor-pod-template.yaml + path: executor-pod-template.yaml + {% endif %} + {{- with .Values.interpreter.volumes }} + {{- toYaml . | nindent 6 }} + {{- end }} + {{- with .Values.interpreter.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.interpreter.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.interpreter.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "zeppelin.interpreter.serviceAccountName" . }} + {% if zeppelin.k8s.interpreter.group.name == "spark" %} + automountServiceAccountToken: true + {% else %} + automountServiceAccountToken: false {% endif %} + {{- with .Values.interpreter.podSecurityContext }} + securityContext: + {{- toYaml . | nindent 8 }} + {{- end }} --- apiVersion: v1 @@ -145,22 +183,23 @@ data: spec: clusterIP: None ports: - - name: intp - port: 12321 - {% if zeppelin.k8s.interpreter.group.name == "spark" %} - - name: spark-driver - port: 22321 - - name: spark-blockmanager - port: 22322 - - name: spark-ui - port: 4040 - {% endif %} + - name: intp + port: 12321 + {% if zeppelin.k8s.interpreter.group.name == "spark" %} + - name: spark-driver + port: 22321 + - name: spark-blockmanager + port: 22322 + - name: spark-ui + port: 4040 + {% endif %} selector: + {{- include "zeppelin.interpreter.labels" . | nindent 8 }} app: {{ "{{" }} zeppelin.k8s.interpreter.pod.name {{ "}}" }} + {% if zeppelin.k8s.interpreter.group.name == "spark" %} {% if zeppelin.k8s.spark.useIngress is defined and zeppelin.k8s.spark.useIngress == "true" %} --- - # create ingress of spark UI apiVersion: networking.k8s.io/v1 kind: Ingress metadata: @@ -181,7 +220,7 @@ data: http: paths: - pathType: Prefix - path: "/" + path: / backend: service: name: {{ "{{" }} zeppelin.k8s.interpreter.pod.name {{ "}}" }} diff --git a/charts/zeppelin/templates/interpreter/spark-configmap.yaml b/charts/zeppelin/templates/interpreter/spark-configmap.yaml deleted file mode 100644 index de0dbedf2ba..00000000000 --- a/charts/zeppelin/templates/interpreter/spark-configmap.yaml +++ /dev/null @@ -1,38 +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. -*/ -}} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "zeppelin.interpreter.spark.configMapName" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "zeppelin.labels" . | nindent 4 }} -data: - pod-template.yaml: | - apiVersion: v1 - kind: PodTemplate - metadata: - name: spark-pod-template - template: - spec: - {{- with .Values.nodeSelector }} - nodeSelector: {{ . }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: {{ . }} - {{- end }} diff --git a/charts/zeppelin/templates/interpreter/spark/_helpers.tpl b/charts/zeppelin/templates/interpreter/spark/_helpers.tpl new file mode 100644 index 00000000000..9ff9aaa5f70 --- /dev/null +++ b/charts/zeppelin/templates/interpreter/spark/_helpers.tpl @@ -0,0 +1,40 @@ +{{- /* +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. +*/ -}} + +{{/* +Create the name of Zeppelin Spark interpreter. +*/}} +{{- define "zeppelin.interpreter.spark.name" -}} +{{- include "zeppelin.interpreter.name" . }}-spark +{{- end -}} + +{{/* +Create the name of the config map for Zeppelin Spark interpreter. +*/}} +{{- define "zeppelin.interpreter.spark.configMapName" -}} +{{- include "zeppelin.interpreter.spark.name" . }}-conf +{{- end -}} + +{{/* +Create the name of the Spark image to use +*/}} +{{- define "zeppelin.interpreter.spark.image" -}} +{{- $imageRegistry := .Values.interpreter.spark.image.registry | default .Values.global.image.registry | default "docker.io" }} +{{- $imageRepository := .Values.interpreter.spark.image.repository | default "spark" }} +{{- $imageTag := .Values.interpreter.spark.image.tag | default "latest" }} +{{- printf "%s/%s:%s" $imageRegistry $imageRepository $imageTag }} +{{- end -}} diff --git a/charts/zeppelin/templates/interpreter/spark/configmap.yaml b/charts/zeppelin/templates/interpreter/spark/configmap.yaml new file mode 100644 index 00000000000..7596aea0963 --- /dev/null +++ b/charts/zeppelin/templates/interpreter/spark/configmap.yaml @@ -0,0 +1,91 @@ +{{- /* +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: {{ include "zeppelin.interpreter.spark.configMapName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "zeppelin.labels" . | nindent 4 }} +data: + spark-defaults.conf: | + # + # 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. + # + + # Default system properties included when running spark-submit. + # This is useful for setting default environmental settings. + + {{- range $key, $value := .Values.interpreter.spark.conf }} + {{ $key }} {{ $value }} + {{- end }} + + driver-pod-template.yaml: | + spec: + containers: + - name: spark-kubernetes-driver + {{- with .Values.interpreter.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.interpreter.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.interpreter.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.interpreter.podSecurityContext }} + securityContext: + {{- toYaml . | nindent 8 }} + {{- end }} + + executor-pod-template.yaml: | + spec: + containers: + - name: spark-kubernetes-executor + {{- with .Values.interpreter.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.interpreter.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.interpreter.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.interpreter.podSecurityContext }} + securityContext: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/zeppelin/templates/server/_helpers.tpl b/charts/zeppelin/templates/server/_helpers.tpl index 27023cf2e4e..ed0373bf574 100644 --- a/charts/zeppelin/templates/server/_helpers.tpl +++ b/charts/zeppelin/templates/server/_helpers.tpl @@ -63,6 +63,23 @@ Create the name of the role binding for Zeppelin server. {{- include "zeppelin.server.serviceAccountName" . }} {{- end -}} +{{/* +Create the name of the configmap for Zeppelin server. +*/}} +{{- define "zeppelin.server.configMapName" -}} +{{- include "zeppelin.server.name" . }}-conf +{{- end -}} + +{{/* +Create the name of the Zeppelin image to use +*/}} +{{- define "zeppelin.server.image" -}} +{{- $imageRegistry := .Values.server.image.registry | default .Values.global.image.registry | default "docker.io" }} +{{- $imageRepository := .Values.server.image.repository | default "apache/zeppelin" }} +{{- $imageTag := .Values.server.image.tag | default "latest" }} +{{- printf "%s/%s:%s" $imageRegistry $imageRepository $imageTag }} +{{- end -}} + {{/* Create the name of the deployment for Zeppelin server. */}} diff --git a/charts/zeppelin/templates/server/configmap.yaml b/charts/zeppelin/templates/server/configmap.yaml new file mode 100644 index 00000000000..446c8a2d3f8 --- /dev/null +++ b/charts/zeppelin/templates/server/configmap.yaml @@ -0,0 +1,71 @@ +{{- /* +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: {{ include "zeppelin.server.configMapName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "zeppelin.server.labels" . | nindent 4 }} +data: + zeppelin-env.sh: | + #!/bin/bash + # + # 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. + # + + export SPARK_MASTER=k8s://https://kubernetes.default.svc + export ZEPPELIN_K8S_SERVICE_NAME={{ include "zeppelin.server.serviceName" . }} + + zeppelin-site.xml: | + + + + + {{- range $key, $value := .Values.server.conf }} + + {{ $key }} + {{ $value }} + + {{- end }} + + + log4j.properties: | + {{- .Files.Get "files/conf/log4j.properties" | nindent 4 }} + + log4j2.properties: | + {{- .Files.Get "files/conf/log4j2.properties" | nindent 4 }} + + interpreter-list: | + {{- .Files.Get "files/conf/interpreter-list" | nindent 4 }} + + configuration.xsl: | + {{- .Files.Get "files/conf/configuration.xsl" | nindent 4 }} diff --git a/charts/zeppelin/templates/server/deployment.yaml b/charts/zeppelin/templates/server/deployment.yaml index bac918ab5d9..1b8d75054a6 100644 --- a/charts/zeppelin/templates/server/deployment.yaml +++ b/charts/zeppelin/templates/server/deployment.yaml @@ -22,10 +22,6 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "zeppelin.server.labels" . | nindent 4 }} - annotations: - zeppelin.apache.org/zeppelin-conf-hash: {{ include (print $.Template.BasePath "/server/zeppelin-conf.yaml") . | sha256sum }} - zeppelin.apache.org/zeppelin-env-hash: {{ include (print $.Template.BasePath "/server/zeppelin-env.yaml") . | sha256sum }} - zeppelin.apache.org/zeppelin-interpreter-spec-hash: {{ include (print $.Template.BasePath "/interpreter/configmap.yaml") . | sha256sum }} spec: selector: matchLabels: @@ -34,8 +30,11 @@ spec: metadata: labels: {{- include "zeppelin.server.selectorLabels" . | nindent 8 }} - {{- with .Values.annotations }} annotations: + zeppelin.apache.org/zeppelin-server-conf-hash: {{ include (print .Template.BasePath "/server/configmap.yaml") . | sha256sum }} + zeppelin.apache.org/zeppelin-interpreter-conf-hash: {{ include (print .Template.BasePath "/interpreter/configmap.yaml") . | sha256sum }} + zeppelin.apache.org/zeppelin-interpreter-spark-conf-hash: {{ include (print .Template.BasePath "/interpreter/spark/configmap.yaml") . | sha256sum }} + {{- with .Values.server.annotations }} {{- toYaml . | nindent 8 }} {{- end }} spec: @@ -50,41 +49,48 @@ spec: - -c - $(ZEPPELIN_HOME)/bin/zeppelin.sh env: - - name: POD_UID + - name: POD_NAME valueFrom: fieldRef: apiVersion: v1 - fieldPath: metadata.uid - - name: POD_NAME + fieldPath: metadata.name + - name: POD_UID valueFrom: fieldRef: apiVersion: v1 - fieldPath: metadata.name - {{- with .Values.env }} + fieldPath: metadata.uid + {{- with .Values.server.env }} {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.server.envFrom }} envFrom: - - configMapRef: - name: {{ include "zeppelin.envConfigMapName" . }} + {{- toYaml . | nindent 8 }} + {{- end }} volumeMounts: - name: zeppelin-conf - mountPath: /opt/zeppelin/conf/zeppelin-site.xml + subPath: zeppelin-env.sh + mountPath: /opt/zeppelin/conf/zeppelin-env.sh + - name: zeppelin-conf subPath: zeppelin-site.xml + mountPath: /opt/zeppelin/conf/zeppelin-site.xml - name: zeppelin-conf - mountPath: /opt/zeppelin/conf/log4j.properties subPath: log4j.properties + mountPath: /opt/zeppelin/conf/log4j.properties - name: zeppelin-conf - mountPath: /opt/zeppelin/conf/log4j2.properties subPath: log4j2.properties + mountPath: /opt/zeppelin/conf/log4j2.properties - name: zeppelin-conf - mountPath: /opt/zeppelin/conf/interpreter-list subPath: interpreter-list + mountPath: /opt/zeppelin/conf/interpreter-list - name: zeppelin-conf - mountPath: /opt/zeppelin/conf/configurations.xsl - subPath: configurations.xsl + subPath: configuration.xsl + mountPath: /opt/zeppelin/conf/configuration.xsl - name: zeppelin-interpreter-conf - mountPath: /opt/zeppelin/k8s/interpreter/interpreter-spec.yaml subPath: interpreter-spec.yaml + mountPath: /opt/zeppelin/k8s/interpreter/100-interpreter-spec.yaml + {{- with .Values.server.volumeMounts }} + {{- toYaml . | nindent 8 }} + {{- end }} ports: - name: http containerPort: 8080 @@ -99,11 +105,11 @@ spec: - sh - -c - "ps -ef | grep org.apache.zeppelin.server.ZeppelinServer | grep -v grep | awk '{print $2}' | xargs kill" - {{- with .Values.resources }} + {{- with .Values.server.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.securityContext }} + {{- with .Values.server.securityContext }} securityContext: {{- toYaml . | nindent 12 }} {{- end }} @@ -114,8 +120,10 @@ spec: volumes: - name: zeppelin-conf configMap: - name: {{ include "zeppelin.configMapName" . }} + name: {{ include "zeppelin.server.configMapName" . }} items: + - key: zeppelin-env.sh + path: zeppelin-env.sh - key: zeppelin-site.xml path: zeppelin-site.xml - key: log4j.properties @@ -124,28 +132,31 @@ spec: path: log4j2.properties - key: interpreter-list path: interpreter-list - - key: configurations.xsl - path: configurations.xsl + - key: configuration.xsl + path: configuration.xsl - name: zeppelin-interpreter-conf configMap: name: {{ include "zeppelin.interpreter.configMapName" . }} items: - key: interpreter-spec.yaml path: interpreter-spec.yaml - {{- with .Values.nodeSelector }} + {{- with .Values.server.volumes }} + {{- toYaml . | nindent 6 }} + {{- end }} + {{- with .Values.server.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} + {{- with .Values.server.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.tolerations }} + {{- with .Values.server.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "zeppelin.server.serviceAccountName" . }} - {{- with .Values.podSecurityContext }} + {{- with .Values.server.podSecurityContext }} securityContext: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/zeppelin/templates/server/zeppelin-conf.yaml b/charts/zeppelin/templates/server/zeppelin-conf.yaml deleted file mode 100644 index e2a4adf35ff..00000000000 --- a/charts/zeppelin/templates/server/zeppelin-conf.yaml +++ /dev/null @@ -1,182 +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. -*/ -}} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "zeppelin.configMapName" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "zeppelin.labels" . | nindent 4 }} -data: - zeppelin-site.xml: | - - - - - {{- range $key, $value := .Values.zeppelin.conf }} - - {{ $key }} - {{ $value }} - - {{- end }} - - - log4j.properties: | - # - # 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. - # - - log4j.rootLogger = INFO, dailyfile - - log4j.appender.stdout = org.apache.log4j.ConsoleAppender - log4j.appender.stdout.layout = org.apache.log4j.PatternLayout - log4j.appender.stdout.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n - - log4j.appender.dailyfile.DatePattern=.yyyy-MM-dd - log4j.appender.dailyfile = org.apache.log4j.DailyRollingFileAppender - log4j.appender.dailyfile.File = ${zeppelin.log.file} - log4j.appender.dailyfile.layout = org.apache.log4j.PatternLayout - log4j.appender.dailyfile.layout.ConversionPattern=%5p [%d] ({%t} %F[%M]:%L) - %m%n - - log4j2.properties: | - # This affects logging for both user code and Flink - rootLogger.level = INFO - rootLogger.appenderRef.file.ref = MainAppender - - # Uncomment this if you want to _only_ change Flink's logging - #logger.flink.name = org.apache.flink - #logger.flink.level = INFO - - # The following lines keep the log level of common libraries/connectors on - # log level INFO. The root logger does not override this. You have to manually - # change the log levels here. - logger.akka.name = akka - logger.akka.level = INFO - logger.kafka.name= org.apache.kafka - logger.kafka.level = INFO - logger.hadoop.name = org.apache.hadoop - logger.hadoop.level = INFO - logger.zookeeper.name = org.apache.zookeeper - logger.zookeeper.level = INFO - - # Log all infos in the given file - appender.main.name = MainAppender - appender.main.type = File - appender.main.append = false - appender.main.fileName = ${sys:zeppelin.log.file} - appender.main.layout.type = PatternLayout - appender.main.layout.pattern = %d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %-60c %x - %m%n - - # Suppress the irrelevant (wrong) warnings from the Netty channel handler - logger.netty.name = org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline - logger.netty.level = OFF - - interpreter-list: | - # 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. - # - # - # [name] [maven artifact] [description] - - alluxio org.apache.zeppelin:zeppelin-alluxio:0.11.2 Alluxio interpreter - angular org.apache.zeppelin:zeppelin-angular:0.11.2 HTML and AngularJS view rendering - bigquery org.apache.zeppelin:zeppelin-bigquery:0.11.2 BigQuery interpreter - cassandra org.apache.zeppelin:zeppelin-cassandra:0.11.2 Cassandra interpreter - elasticsearch org.apache.zeppelin:zeppelin-elasticsearch:0.11.2 Elasticsearch interpreter - file org.apache.zeppelin:zeppelin-file:0.11.2 HDFS file interpreter - flink org.apache.zeppelin:zeppelin-flink:0.11.2 Flink interpreter - groovy org.apache.zeppelin:zeppelin-groovy:0.11.2 Groovy interpreter - hbase org.apache.zeppelin:zeppelin-hbase:0.11.2 Hbase interpreter - java org.apache.zeppelin:zeppelin-java:0.11.2 Java interpreter - jdbc org.apache.zeppelin:zeppelin-jdbc:0.11.2 Jdbc interpreter - livy org.apache.zeppelin:zeppelin-livy:0.11.2 Livy interpreter - md org.apache.zeppelin:zeppelin-markdown:0.11.2 Markdown support - neo4j org.apache.zeppelin:zeppelin-neo4j:0.11.2 Neo4j interpreter - python org.apache.zeppelin:zeppelin-python:0.11.2 Python interpreter - shell org.apache.zeppelin:zeppelin-shell:0.11.2 Shell command - sparql org.apache.zeppelin:zeppelin-sparql:0.11.2 Sparql interpreter - submarine org.apache.zeppelin:zeppelin-submarine:0.11.2 Submarine interpreter - - configurations.xsl: | - - - - - - - - - - - - - - - - - - - - -
namevaluedescription
- - -
-
diff --git a/charts/zeppelin/templates/server/zeppelin-env.yaml b/charts/zeppelin/templates/server/zeppelin-env.yaml deleted file mode 100644 index b85aee3d571..00000000000 --- a/charts/zeppelin/templates/server/zeppelin-env.yaml +++ /dev/null @@ -1,54 +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. -*/ -}} - -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "zeppelin.envConfigMapName" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "zeppelin.labels" . | nindent 4 }} -data: - # 'serviceDomain' is a Domain name to use for accessing Zeppelin UI. - # Should point IP address of 'zeppelin-server' service. - # - # Wildcard subdomain need to be point the same IP address to access service inside of Pod (such as SparkUI). - # i.e. if service domain is 'local.zeppelin-project.org', DNS configuration should make 'local.zeppelin-project.org' and '*.local.zeppelin-project.org' point the same address. - # - # Default value is 'local.zeppelin-project.org' while it points 127.0.0.1 and `kubectl port-forward zeppelin-server` will give localhost to connects. - # If you have your ingress controller configured to connect to `zeppelin-server` service and have a domain name for it (with wildcard subdomain point the same address), you can replace serviceDomain field with your own domain. - SERVICE_DOMAIN: local.zeppelin-project.org:8080 - - ZEPPELIN_PORT: "8080" - - ZEPPELIN_K8S_SPARK_CONTAINER_IMAGE: {{ include "zeppelin.spark.image" . }} - - ZEPPELIN_K8S_CONTAINER_IMAGE: {{ include "zeppelin.interpreter.image" . }} - - ZEPPELIN_K8S_TEMPLATE_DIR: /opt/zeppelin/k8s - - ZEPPELIN_K8S_SERVICE_NAME: {{ include "zeppelin.server.serviceName" . }} - - ZEPPELIN_HOME: /opt/zeppelin - - ZEPPELIN_SERVER_RPC_PORTRANGE: 12320:12320 - - # default value of 'master' property for spark interpreter. - SPARK_MASTER: k8s://https://kubernetes.default.svc - - # default value of 'SPARK_HOME' property for spark interpreter. - SPARK_HOME: /spark diff --git a/charts/zeppelin/values.yaml b/charts/zeppelin/values.yaml index 2eb35dd4bfc..7a276f69d68 100644 --- a/charts/zeppelin/values.yaml +++ b/charts/zeppelin/values.yaml @@ -28,6 +28,79 @@ server: # -- Zeppelin image tag. # @default -- If not set, the chart appVersion will be used. tag: "" + # -- Zeppelin server image pull policy. + pullPolicy: IfNotPresent + # -- Zeppelin server image pull secrets for private image registry. + pullSecrets: [] + # - name: + + # -- Zeppelin configurations. + # For detailed information, please refer: https://zeppelin.apache.org/docs/latest/setup/operation/configuration.html. + conf: {} + + # -- Extra labels for Zeppelin server pods. + labels: {} + # key1: value1 + # key2: value2 + + # -- Extra annotations for Zeppelin server pods. + annotations: {} + # key1: value1 + # key2: value2 + + # -- Volumes for Zeppelin server pods. + volumes: [] + + # -- Node selector for Zeppelin server pods. + nodeSelector: {} + + # -- Affinity for Zeppelin server pods. + affinity: {} + + # -- List of node taints to tolerate for Zeppelin server pods. + tolerations: [] + + # -- Priority class for Zeppelin server pods. + priorityClassName: "" + + # -- Security context for Zeppelin server pods. + podSecurityContext: {} + + # -- Environment variables for Zeppelin server containers. + env: + - name: ZEPPELIN_HOME + value: /opt/zeppelin + - name: SPARK_HOME + value: /opt/spark + - name: SERVICE_DOMAIN + value: local.zeppelin-project.org:8080 + - name: ZEPPELIN_PORT + value: "8080" + - name: ZEPPELIN_SERVER_RPC_PORTRANGE + value: 12320:12320 + - name: ZEPPELIN_K8S_TEMPLATE_DIR + value: /opt/zeppelin/k8s + + # -- Environment variable sources for Zeppelin server containers. + envFrom: [] + + # -- Volume mounts for Zeppelin server containers. + volumeMounts: [] + + # -- Resource requests and limits for Zeppelin server containers. + resources: {} + # limits: + # cpu: 100m + # memory: 300Mi + # requests: + # cpu: 100m + # memory: 300Mi + + # -- Security context for Zeppelin server containers. + securityContext: + runAsNonRoot: true + runAsUser: 1000 + runAsGroup: 0 serviceAccount: # -- Specifies whether a service account should be created for the Zeppelin server. @@ -47,7 +120,85 @@ interpreter: # -- Zeppelin interpreter image tag. # @default -- If not set, the chart appVersion will be used. tag: "" - + # -- Zeppelin interpreter image pull policy. + pullPolicy: IfNotPresent + # -- Zeppelin interpreter image pull secrets for private image registry. + pullSecrets: [] + # - name: + + spark: + image: + # -- Spark image registry. + # @default -- If not set, `global.image.registry` will be used. + registry: "" + # -- Spark image repository. + repository: spark + # -- Spark image tag. + tag: 3.5.3 + + # -- Spark configurations. + conf: + spark.kubernetes.driver.podTemplateFile: file:///opt/spark/conf/driver-pod-template.yaml + spark.kubernetes.executor.podTemplateFile: file:///opt/spark/conf/executor-pod-template.yaml + + # -- Extra labels for Zeppelin interpreter pods. + labels: {} + # key1: value1 + # key2: value2 + + # -- Extra annotations for Zeppelin interpreter pods. + annotations: {} + # key1: value1 + # key2: value2 + + # -- Volumes for Zeppelin interpreter pods. + volumes: [] + + # -- Node selector for Zeppelin interpreter pods. + nodeSelector: {} + + # -- Affinity for Zeppelin interpreter pods. + affinity: {} + + # -- List of node taints to tolerate for Zeppelin interpreter pods. + tolerations: [] + + # -- Priority class for Zeppelin interpreter pods. + priorityClassName: "" + + # -- Security context for Zeppelin interpreter pods. + podSecurityContext: {} + + # -- Environment variables for Zeppelin interpreter containers. + env: + - name: ZEPPELIN_HOME + value: /opt/zeppelin + - name: SPARK_HOME + value: /opt/spark + - name: SPARK_CONF_DIR + value: /opt/spark/conf + + # -- Environment variable sources for Zeppelin interpreter containers. + envFrom: [] + + # -- Volume mounts for Zeppelin interpreter containers. + volumeMounts: [] + + # -- Resource requests and limits for Zeppelin interpreter containers. + resources: {} + # limits: + # cpu: 100m + # memory: 300Mi + # requests: + # cpu: 100m + # memory: 300Mi + + # -- Security context for Zeppelin interpreter containers. + securityContext: + runAsNonRoot: true + runAsUser: 1000 + runAsGroup: 0 + serviceAccount: serviceAccount: # -- Specifies whether a service account should be created for the Zeppelin interpreter. @@ -57,71 +208,6 @@ interpreter: # -- Extra annotations for the Zeppelin interpreter service account. annotations: {} -spark: - image: - # -- Spark image registry. - # @default -- If not set, `global.image.registry` will be used. - registry: "" - # -- Spark image repository. - repository: spark - # -- Spark image tag. - tag: 3.5.3 - -zeppelin: - # -- Zeppelin configurations. - # For detailed information, please refer: https://zeppelin.apache.org/docs/latest/setup/operation/configuration.html. - conf: - # spark.kubernetes.driver.podTemplateFile: local:///driver.yml - -# -- Extra labels for Zeppelin server pods. -labels: {} - # key1: value1 - # key2: value2 - -# -- Extra annotations for Zeppelin server pods. -annotations: {} - # key1: value1 - # key2: value2 - -# -- Volumes for Zeppelin server pods. -volumes: [] - -# -- Node selector for Zeppelin server pods. -nodeSelector: {} - -# -- Affinity for Zeppelin server pods. -affinity: {} - -# -- List of node taints to tolerate for Zeppelin server pods. -tolerations: [] - -# -- Priority class for Zeppelin server pods. -priorityClassName: "" - -# -- Security context for Zeppelin server pods. -podSecurityContext: {} - -# -- Environment variables for Zeppelin server containers. -env: [] - -# -- Environment variable sources for Zeppelin server containers. -envFrom: [] - -# -- Volume mounts for Zeppelin server containers. -volumeMounts: [] - -# -- Resource requests and limits for Zeppelin server containers. -resources: {} - # limits: - # cpu: 100m - # memory: 300Mi - # requests: - # cpu: 100m - # memory: 300Mi - -# -- Security context for Zeppelin server containers. -securityContext: {} - service: # -- Service type for Zeppelin server. type: ClusterIP From b6de489149c4eb59823a7f94f84b4b1adecaadb5 Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Thu, 14 Nov 2024 11:05:06 +0800 Subject: [PATCH 11/18] Update Signed-off-by: Yi Chen --- charts/zeppelin/.helmignore | 17 ++++ charts/zeppelin/README.md | 8 +- charts/zeppelin/templates/_helpers.tpl | 17 ++++ charts/zeppelin/templates/server/_helpers.tpl | 7 ++ .../zeppelin/templates/server/configmap.yaml | 1 + charts/zeppelin/templates/server/ingress.yaml | 77 +++++++++++++++++++ charts/zeppelin/templates/server/service.yaml | 5 +- charts/zeppelin/values.yaml | 48 +++++++++++- 8 files changed, 173 insertions(+), 7 deletions(-) create mode 100644 charts/zeppelin/templates/server/ingress.yaml diff --git a/charts/zeppelin/.helmignore b/charts/zeppelin/.helmignore index 0e8a0eb36f4..5d56da2c3d9 100644 --- a/charts/zeppelin/.helmignore +++ b/charts/zeppelin/.helmignore @@ -1,3 +1,20 @@ +# +# 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. +# + # Patterns to ignore when building packages. # This supports shell glob matching, relative path matching, and # negation (prefixed with !). Only one pattern per line. diff --git a/charts/zeppelin/README.md b/charts/zeppelin/README.md index e04bab84252..d652407c312 100644 --- a/charts/zeppelin/README.md +++ b/charts/zeppelin/README.md @@ -35,6 +35,13 @@ A Helm chart for deploying Apache Zeppelin on Kubernetes. | server.serviceAccount.create | bool | `true` | Specifies whether a service account should be created for the Zeppelin server. | | server.serviceAccount.name | string | `""` | Optional name for the Zeppelin server service account. | | server.serviceAccount.annotations | object | `{}` | Extra annotations for the Zeppelin server service account. | +| server.service.type | string | `"ClusterIP"` | Service type for Zeppelin server. | +| server.service.port | int | `8080` | Service port for Zeppelin server. | +| server.ingress.enable | bool | `false` | Enable ingress for Zeppelin server. | +| server.ingress.className | string | `""` | Ingress class name for Zeppelin server ingress. | +| server.ingress.annotations | object | `{}` | Annotations for the Zeppelin server ingress. | +| server.ingress.hosts | list | `[{"host":"local.zeppelin-project.org","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}]` | Hosts for Zeppelin server ingress. | +| server.ingress.tls | list | `[]` | TLS configuration for Zeppelin server ingress. | | interpreter.image.registry | string | If not set, `global.image.registry` will be used. | Zeppelin interpreter image registry. | | interpreter.image.repository | string | `"apache/zeppelin-interpreter"` | Zeppelin interpreter image repository. | | interpreter.image.tag | string | If not set, the chart appVersion will be used. | Zeppelin interpreter image tag. | @@ -61,7 +68,6 @@ A Helm chart for deploying Apache Zeppelin on Kubernetes. | interpreter.serviceAccount.create | bool | `true` | Specifies whether a service account should be created for the Zeppelin interpreter. | | interpreter.serviceAccount.name | string | `""` | Optional name for the Zeppelin interpreter service account. | | interpreter.serviceAccount.annotations | object | `{}` | Extra annotations for the Zeppelin interpreter service account. | -| service.type | string | `"ClusterIP"` | Service type for Zeppelin server. | ## Maintainers diff --git a/charts/zeppelin/templates/_helpers.tpl b/charts/zeppelin/templates/_helpers.tpl index 83be4f92049..a1361b9b20e 100644 --- a/charts/zeppelin/templates/_helpers.tpl +++ b/charts/zeppelin/templates/_helpers.tpl @@ -1,3 +1,20 @@ +{{- /* +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. +*/ -}} + {{/* Expand the name of the chart. */}} diff --git a/charts/zeppelin/templates/server/_helpers.tpl b/charts/zeppelin/templates/server/_helpers.tpl index ed0373bf574..fbf0ac29111 100644 --- a/charts/zeppelin/templates/server/_helpers.tpl +++ b/charts/zeppelin/templates/server/_helpers.tpl @@ -93,3 +93,10 @@ Create the name of the service for Zeppelin server. {{- define "zeppelin.server.serviceName" -}} {{ include "zeppelin.server.name" . }}-svc {{- end -}} + +{{/* +Create the name of the ingress for Zeppelin server. +*/}} +{{- define "zeppelin.server.ingressName" -}} +{{ include "zeppelin.server.name" . }}-ingress +{{- end -}} diff --git a/charts/zeppelin/templates/server/configmap.yaml b/charts/zeppelin/templates/server/configmap.yaml index 446c8a2d3f8..5220d9a96d1 100644 --- a/charts/zeppelin/templates/server/configmap.yaml +++ b/charts/zeppelin/templates/server/configmap.yaml @@ -44,6 +44,7 @@ data: export SPARK_MASTER=k8s://https://kubernetes.default.svc export ZEPPELIN_K8S_SERVICE_NAME={{ include "zeppelin.server.serviceName" . }} + export ZEPPELIN_K8S_SPARK_CONTAINER_IMAGE={{ include "zeppelin.interpreter.spark.image" . }} zeppelin-site.xml: | diff --git a/charts/zeppelin/templates/server/ingress.yaml b/charts/zeppelin/templates/server/ingress.yaml new file mode 100644 index 00000000000..5bffdadde19 --- /dev/null +++ b/charts/zeppelin/templates/server/ingress.yaml @@ -0,0 +1,77 @@ +{{- /* +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 .Values.server.ingress.enable }} +{{- if and .Values.server.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.server.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.server.ingress.annotations "kubernetes.io/ingress.class" .Values.server.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ include "zeppelin.server.ingressName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "zeppelin.server.labels" . | nindent 4 }} + {{- with .Values.server.ingress.annotations }} + annotations: + {{- toToml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.server.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.server.ingress.className }} + {{- end }} + {{- if .Values.server.ingress.tls }} + tls: + {{- range .Values.server.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.server.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ include "zeppelin.server.serviceName" $ }} + port: + number: {{ $.Values.server.service.port }} + {{- else }} + serviceName: {{ include "zeppelin.server.serviceName" $ }} + servicePort: {{ $.Values.server.service.port }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/zeppelin/templates/server/service.yaml b/charts/zeppelin/templates/server/service.yaml index 704910c432d..4e1c12c1e03 100644 --- a/charts/zeppelin/templates/server/service.yaml +++ b/charts/zeppelin/templates/server/service.yaml @@ -23,10 +23,11 @@ metadata: labels: {{- include "zeppelin.server.labels" . | nindent 4 }} spec: - type: {{ .Values.service.type }} + type: {{ .Values.server.service.type }} ports: - name: http - port: 8080 + port: {{ .Values.server.service.port }} + targetPort: 8080 - name: rpc port: 12320 selector: diff --git a/charts/zeppelin/values.yaml b/charts/zeppelin/values.yaml index 7a276f69d68..d5d083cc9ad 100644 --- a/charts/zeppelin/values.yaml +++ b/charts/zeppelin/values.yaml @@ -1,3 +1,20 @@ +# +# 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. +# + # Default values for zeppelin. # This is a YAML-formatted file. # Declare variables to be passed into your templates. @@ -110,6 +127,33 @@ server: # -- Extra annotations for the Zeppelin server service account. annotations: {} + service: + # -- Service type for Zeppelin server. + type: ClusterIP + # -- Service port for Zeppelin server. + port: 8080 + + ingress: + # -- Enable ingress for Zeppelin server. + enable: false + # -- Ingress class name for Zeppelin server ingress. + className: "" + # -- Annotations for the Zeppelin server ingress. + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + # -- Hosts for Zeppelin server ingress. + hosts: + - host: local.zeppelin-project.org + paths: + - path: / + pathType: ImplementationSpecific + # -- TLS configuration for Zeppelin server ingress. + tls: [] + # - secretName: zeppelin-server-tls + # hosts: + # - local.zeppelin-project.org + interpreter: image: # -- Zeppelin interpreter image registry. @@ -207,7 +251,3 @@ interpreter: name: "" # -- Extra annotations for the Zeppelin interpreter service account. annotations: {} - -service: - # -- Service type for Zeppelin server. - type: ClusterIP From 43f5be8def69ef9f89c7c3772e91d74081623d51 Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Thu, 14 Nov 2024 16:17:17 +0800 Subject: [PATCH 12/18] Update Signed-off-by: Yi Chen --- charts/zeppelin/templates/server/ingress.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/zeppelin/templates/server/ingress.yaml b/charts/zeppelin/templates/server/ingress.yaml index 5bffdadde19..bc241cfef34 100644 --- a/charts/zeppelin/templates/server/ingress.yaml +++ b/charts/zeppelin/templates/server/ingress.yaml @@ -36,7 +36,7 @@ metadata: {{- include "zeppelin.server.labels" . | nindent 4 }} {{- with .Values.server.ingress.annotations }} annotations: - {{- toToml . | nindent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} spec: {{- if and .Values.server.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} From bc85537c0efd9c7134d80a516877d08abf2118c9 Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Fri, 15 Nov 2024 13:06:10 +0800 Subject: [PATCH 13/18] Add more options for configuring Spark executor pods Signed-off-by: Yi Chen --- charts/zeppelin/README.md | 4 +++ .../templates/interpreter/configmap.yaml | 4 +++ .../interpreter/spark/configmap.yaml | 32 +++++++++++++++++++ charts/zeppelin/values.yaml | 12 +++++++ 4 files changed, 52 insertions(+) diff --git a/charts/zeppelin/README.md b/charts/zeppelin/README.md index d652407c312..e1895408973 100644 --- a/charts/zeppelin/README.md +++ b/charts/zeppelin/README.md @@ -51,6 +51,10 @@ A Helm chart for deploying Apache Zeppelin on Kubernetes. | interpreter.spark.image.repository | string | `"spark"` | Spark image repository. | | interpreter.spark.image.tag | string | `"3.5.3"` | Spark image tag. | | interpreter.spark.conf | object | `{"spark.kubernetes.driver.podTemplateFile":"file:///opt/spark/conf/driver-pod-template.yaml","spark.kubernetes.executor.podTemplateFile":"file:///opt/spark/conf/executor-pod-template.yaml"}` | Spark configurations. | +| interpreter.spark.volumes | list | `[]` | Volumes for Spark executor pods. | +| interpreter.spark.env | list | `[]` | Environment variables for Spark executor containers. | +| interpreter.spark.envFrom | list | `[]` | Environment variable sources for Spark executor containers. | +| interpreter.spark.volumeMounts | list | `[]` | Volume mounts for Zeppelin interpreter containers. | | interpreter.labels | object | `{}` | Extra labels for Zeppelin interpreter pods. | | interpreter.annotations | object | `{}` | Extra annotations for Zeppelin interpreter pods. | | interpreter.volumes | list | `[]` | Volumes for Zeppelin interpreter pods. | diff --git a/charts/zeppelin/templates/interpreter/configmap.yaml b/charts/zeppelin/templates/interpreter/configmap.yaml index 2af0f015f17..df007e3291e 100644 --- a/charts/zeppelin/templates/interpreter/configmap.yaml +++ b/charts/zeppelin/templates/interpreter/configmap.yaml @@ -120,6 +120,10 @@ data: {{- with .Values.interpreter.volumeMounts }} {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.interpreter.securityContext }} + securityContext: + {{- toYaml . | nindent 10 }} + {{- end }} {{- with .Values.global.image.pullSecrets }} imagePullSecrets: {{- toYaml . | nindent 6 }} diff --git a/charts/zeppelin/templates/interpreter/spark/configmap.yaml b/charts/zeppelin/templates/interpreter/spark/configmap.yaml index 7596aea0963..1f02bfdceda 100644 --- a/charts/zeppelin/templates/interpreter/spark/configmap.yaml +++ b/charts/zeppelin/templates/interpreter/spark/configmap.yaml @@ -52,6 +52,22 @@ data: spec: containers: - name: spark-kubernetes-driver + {{- with .Values.interpreter.spark.env }} + env: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.interpreter.spark.envFrom }} + envFrom: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.interpreter.spark.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.interpreter.spark.volumes }} + volumes: + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.interpreter.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} @@ -73,6 +89,22 @@ data: spec: containers: - name: spark-kubernetes-executor + {{- with .Values.interpreter.spark.env }} + env: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.interpreter.spark.envFrom }} + envFrom: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.interpreter.spark.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.interpreter.spark.volumes }} + volumes: + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.interpreter.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/zeppelin/values.yaml b/charts/zeppelin/values.yaml index d5d083cc9ad..3c1cab93c8a 100644 --- a/charts/zeppelin/values.yaml +++ b/charts/zeppelin/values.yaml @@ -185,6 +185,18 @@ interpreter: spark.kubernetes.driver.podTemplateFile: file:///opt/spark/conf/driver-pod-template.yaml spark.kubernetes.executor.podTemplateFile: file:///opt/spark/conf/executor-pod-template.yaml + # -- Volumes for Spark executor pods. + volumes: [] + + # -- Environment variables for Spark executor containers. + env: [] + + # -- Environment variable sources for Spark executor containers. + envFrom: [] + + # -- Volume mounts for Zeppelin interpreter containers. + volumeMounts: [] + # -- Extra labels for Zeppelin interpreter pods. labels: {} # key1: value1 From a69de89a71387878fdb821a1e37b18f938335378 Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Tue, 19 Nov 2024 19:41:51 +0800 Subject: [PATCH 14/18] fix: interpreter envFrom does not work Signed-off-by: Yi Chen --- charts/zeppelin/templates/interpreter/configmap.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/zeppelin/templates/interpreter/configmap.yaml b/charts/zeppelin/templates/interpreter/configmap.yaml index df007e3291e..c4009a6d993 100644 --- a/charts/zeppelin/templates/interpreter/configmap.yaml +++ b/charts/zeppelin/templates/interpreter/configmap.yaml @@ -86,6 +86,10 @@ data: {{- with .Values.interpreter.env }} {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.interpreter.envFrom }} + envFrom: + {{- toYaml . | nindent 8 }} + {{- end }} {% if zeppelin.k8s.interpreter.cores is defined and zeppelin.k8s.interpreter.memory is defined %} resources: requests: From 640d91b7f843d5d468ab38be5dd7858b811cf38e Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Thu, 21 Nov 2024 19:51:43 +0800 Subject: [PATCH 15/18] feat: add support for configuring Spark pod labels and annotations Signed-off-by: Yi Chen --- .../templates/interpreter/spark/configmap.yaml | 18 ++++++++++++++++++ charts/zeppelin/values.yaml | 14 ++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/charts/zeppelin/templates/interpreter/spark/configmap.yaml b/charts/zeppelin/templates/interpreter/spark/configmap.yaml index 1f02bfdceda..c73af578ca1 100644 --- a/charts/zeppelin/templates/interpreter/spark/configmap.yaml +++ b/charts/zeppelin/templates/interpreter/spark/configmap.yaml @@ -49,6 +49,15 @@ data: {{- end }} driver-pod-template.yaml: | + metadata: + {{- with .Values.interpreter.spark.labels }} + labels: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.interpreter.spark.annotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: containers: - name: spark-kubernetes-driver @@ -86,6 +95,15 @@ data: {{- end }} executor-pod-template.yaml: | + metadata: + {{- with .Values.interpreter.spark.labels }} + labels: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.interpreter.spark.annotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: containers: - name: spark-kubernetes-executor diff --git a/charts/zeppelin/values.yaml b/charts/zeppelin/values.yaml index 3c1cab93c8a..0363fd92ae0 100644 --- a/charts/zeppelin/values.yaml +++ b/charts/zeppelin/values.yaml @@ -185,16 +185,22 @@ interpreter: spark.kubernetes.driver.podTemplateFile: file:///opt/spark/conf/driver-pod-template.yaml spark.kubernetes.executor.podTemplateFile: file:///opt/spark/conf/executor-pod-template.yaml - # -- Volumes for Spark executor pods. + # -- Extra labels for Spark pods. + labels: {} + + # -- Extra annotations for Spark pods. + annotations: {} + + # -- Volumes for Spark pods. volumes: [] - # -- Environment variables for Spark executor containers. + # -- Environment variables for Spark containers. env: [] - # -- Environment variable sources for Spark executor containers. + # -- Environment variable sources for Spark containers. envFrom: [] - # -- Volume mounts for Zeppelin interpreter containers. + # -- Volume mounts for Spark containers. volumeMounts: [] # -- Extra labels for Zeppelin interpreter pods. From 0ce9d5e2c0c90ee87c95e5804147c771993ba488 Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Thu, 21 Nov 2024 20:00:23 +0800 Subject: [PATCH 16/18] Update helm chart README Signed-off-by: Yi Chen --- charts/zeppelin/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/charts/zeppelin/README.md b/charts/zeppelin/README.md index e1895408973..44f5e1eef48 100644 --- a/charts/zeppelin/README.md +++ b/charts/zeppelin/README.md @@ -51,10 +51,12 @@ A Helm chart for deploying Apache Zeppelin on Kubernetes. | interpreter.spark.image.repository | string | `"spark"` | Spark image repository. | | interpreter.spark.image.tag | string | `"3.5.3"` | Spark image tag. | | interpreter.spark.conf | object | `{"spark.kubernetes.driver.podTemplateFile":"file:///opt/spark/conf/driver-pod-template.yaml","spark.kubernetes.executor.podTemplateFile":"file:///opt/spark/conf/executor-pod-template.yaml"}` | Spark configurations. | -| interpreter.spark.volumes | list | `[]` | Volumes for Spark executor pods. | -| interpreter.spark.env | list | `[]` | Environment variables for Spark executor containers. | -| interpreter.spark.envFrom | list | `[]` | Environment variable sources for Spark executor containers. | -| interpreter.spark.volumeMounts | list | `[]` | Volume mounts for Zeppelin interpreter containers. | +| interpreter.spark.labels | object | `{}` | Extra labels for Spark pods. | +| interpreter.spark.annotations | object | `{}` | Extra annotations for Spark pods. | +| interpreter.spark.volumes | list | `[]` | Volumes for Spark pods. | +| interpreter.spark.env | list | `[]` | Environment variables for Spark containers. | +| interpreter.spark.envFrom | list | `[]` | Environment variable sources for Spark containers. | +| interpreter.spark.volumeMounts | list | `[]` | Volume mounts for Spark containers. | | interpreter.labels | object | `{}` | Extra labels for Zeppelin interpreter pods. | | interpreter.annotations | object | `{}` | Extra annotations for Zeppelin interpreter pods. | | interpreter.volumes | list | `[]` | Volumes for Zeppelin interpreter pods. | From 57bf5781c5259f4f8c7332906e9c4b3cd98cb8e9 Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Fri, 29 Nov 2024 15:34:04 +0800 Subject: [PATCH 17/18] Add pod deletecollection permission to interpreter role Signed-off-by: Yi Chen --- charts/zeppelin/templates/interpreter/role.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/charts/zeppelin/templates/interpreter/role.yaml b/charts/zeppelin/templates/interpreter/role.yaml index 9d2cea46c1e..57712217976 100644 --- a/charts/zeppelin/templates/interpreter/role.yaml +++ b/charts/zeppelin/templates/interpreter/role.yaml @@ -25,6 +25,17 @@ rules: - "" resources: - pods + verbs: + - get + - list + - watch + - create + - update + - delete + - deletecollection +- apiGroups: + - "" + resources: - configmaps - services verbs: From beea9837983b16e50e1be9ca56c49d828148ffeb Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Fri, 20 Dec 2024 21:23:18 +0800 Subject: [PATCH 18/18] Add license Signed-off-by: Yi Chen --- charts/zeppelin/Chart.yaml | 17 +++++++++++++++++ charts/zeppelin/README.md.gotmpl | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/charts/zeppelin/Chart.yaml b/charts/zeppelin/Chart.yaml index 3f129f967d7..867aa809ee3 100644 --- a/charts/zeppelin/Chart.yaml +++ b/charts/zeppelin/Chart.yaml @@ -1,3 +1,20 @@ +# +# 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: v2 name: zeppelin diff --git a/charts/zeppelin/README.md.gotmpl b/charts/zeppelin/README.md.gotmpl index 6b734a1a0ee..0417bb2afdf 100644 --- a/charts/zeppelin/README.md.gotmpl +++ b/charts/zeppelin/README.md.gotmpl @@ -1,3 +1,20 @@ +{{- /* +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. +*/ -}} + {{ template "chart.header" . }} {{ template "chart.deprecationWarning" . }}