[CELEBORN-969][HELM] Allow user set priorityClass used by celeborn pods
### What changes were proposed in this pull request? Allow user set priorityClass used by celeborn pods ### Why are the changes needed? Allow user set a proper priorityClass to avoid unwanted evict happens. ### Does this PR introduce _any_ user-facing change? No, default values change nothing. ### How was this patch tested? Run test locally before make a pull request `helm template test charts/celeborn > new_rendered.yaml` && `diff old_rendered.yaml new_rendered.yaml` Closes #1902 from camper42/priority-class. Authored-by: camper42 <camper.xlii@gmail.com> Signed-off-by: zky.zhoukeyong <zky.zhoukeyong@alibaba-inc.com>
This commit is contained in:
parent
0bf42013f0
commit
3c8d89ca99
31
charts/celeborn/templates/master-priorityclass.yaml
Normal file
31
charts/celeborn/templates/master-priorityclass.yaml
Normal file
@ -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 }}
|
||||
@ -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
|
||||
|
||||
31
charts/celeborn/templates/worker-priorityclass.yaml
Normal file
31
charts/celeborn/templates/worker-priorityclass.yaml
Normal file
@ -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 }}
|
||||
@ -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 }}
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user