diff --git a/charts/celeborn/templates/master-priorityclass.yaml b/charts/celeborn/templates/master-priorityclass.yaml new file mode 100644 index 000000000..753fc00b9 --- /dev/null +++ b/charts/celeborn/templates/master-priorityclass.yaml @@ -0,0 +1,31 @@ +# +# 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.priorityClass.master.create }} +apiVersion: scheduling.k8s.io/v1 +kind: PriorityClass +metadata: + name: {{ .Values.priorityClass.master.name | default (printf "%s-master-priority" (.Release.Name)) }} + labels: + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + {{- include "celeborn.labels" . | nindent 4 }} +value: {{ .Values.priorityClass.master.value }} +{{- end }} diff --git a/charts/celeborn/templates/master-statefulset.yaml b/charts/celeborn/templates/master-statefulset.yaml index 7b83aab67..a69cb83f2 100644 --- a/charts/celeborn/templates/master-statefulset.yaml +++ b/charts/celeborn/templates/master-statefulset.yaml @@ -67,6 +67,9 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- if or .Values.priorityClass.master.name .Values.priorityClass.master.create }} + priorityClassName: {{ .Values.priorityClass.master.name | default (printf "%s-master-priority" (.Release.Name)) }} + {{- end }} {{- with .Values.securityContext }} securityContext: {{- toYaml . | nindent 8 }} @@ -120,7 +123,7 @@ spec: - name: {{ $key }} value: {{ $val | quote }} {{- end}} - terminationGracePeriodSeconds: 30 + terminationGracePeriodSeconds: 30 volumes: - configMap: name: {{ .Release.Name }}-conf diff --git a/charts/celeborn/templates/worker-priorityclass.yaml b/charts/celeborn/templates/worker-priorityclass.yaml new file mode 100644 index 000000000..371f04628 --- /dev/null +++ b/charts/celeborn/templates/worker-priorityclass.yaml @@ -0,0 +1,31 @@ +# +# 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.priorityClass.worker.create }} +apiVersion: scheduling.k8s.io/v1 +kind: PriorityClass +metadata: + name: {{ .Values.priorityClass.worker.name | default (printf "%s-worker-priority" (.Release.Name)) }} + labels: + helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + {{- include "celeborn.labels" . | nindent 4 }} +value: {{ .Values.priorityClass.worker.value }} +{{- end }} diff --git a/charts/celeborn/templates/worker-statefulset.yaml b/charts/celeborn/templates/worker-statefulset.yaml index 7b9f0ad53..19df75577 100644 --- a/charts/celeborn/templates/worker-statefulset.yaml +++ b/charts/celeborn/templates/worker-statefulset.yaml @@ -67,6 +67,9 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- if or .Values.priorityClass.worker.name .Values.priorityClass.worker.create }} + priorityClassName: {{ .Values.priorityClass.worker.name | default (printf "%s-worker-priority" (.Release.Name)) }} + {{- end }} {{- with .Values.securityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/celeborn/values.yaml b/charts/celeborn/values.yaml index 2d754f58a..fe295f84b 100644 --- a/charts/celeborn/values.yaml +++ b/charts/celeborn/values.yaml @@ -138,6 +138,22 @@ resources: {} # cpu: 100m # memory: 128Mi +# priorityClass used for Celeborn pods +priorityClass: + master: + # Specifies whether a priorityClass should be created + create: false + # Specifies priorityClass name to be used (created if `create: true`) + name: ~ + # half of system-cluster-critical by default + value: 1000000000 + + worker: + create: false + name: ~ + # celeborn master minus 1000 + value: 999999000 + podAnnotations: {} affinity: