This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 57672fe5f [KYUUBI #5058] [HELM] Allow the user to set the 
priorityClass used by Kyuubi server Pod
57672fe5f is described below

commit 57672fe5fe1ab7f8bfbb46d5b78f6107e5e256e4
Author: camper42 <[email protected]>
AuthorDate: Mon Jul 17 18:10:13 2023 +0800

    [KYUUBI #5058] [HELM] Allow the user to set the priorityClass used by 
Kyuubi server Pod
    
    ### _Why are the changes needed?_
    
    This PR allows the user to set the priorityClass used by kyuubi server.
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including 
negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run 
test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests)
 locally before make a pull request
    
    Closes #5058 from camper42/priority.
    
    Closes #5058
    
    aa5a9bfe4 [camper42] remove redundant comment
    6785270f5 [camper42] remove description field in kyuubi-priorityclass
    b8c225524 [camper42] feat(chart): Allows the user to set the priorityClass 
used by kyuubi.
    
    Authored-by: camper42 <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
---
 charts/kyuubi/templates/kyuubi-deployment.yaml    |  3 +++
 charts/kyuubi/templates/kyuubi-priorityclass.yaml | 26 +++++++++++++++++++++++
 charts/kyuubi/values.yaml                         |  9 ++++++++
 3 files changed, 38 insertions(+)

diff --git a/charts/kyuubi/templates/kyuubi-deployment.yaml 
b/charts/kyuubi/templates/kyuubi-deployment.yaml
index 79d49a653..a81ec01e9 100644
--- a/charts/kyuubi/templates/kyuubi-deployment.yaml
+++ b/charts/kyuubi/templates/kyuubi-deployment.yaml
@@ -39,6 +39,9 @@ spec:
       {{- if or .Values.serviceAccount.name .Values.serviceAccount.create }}
       serviceAccountName: {{ .Values.serviceAccount.name | default 
.Release.Name }}
       {{- end }}
+      {{- if or .Values.priorityClass.name .Values.priorityClass.create }}
+      priorityClassName: {{ .Values.priorityClass.name | default .Release.Name 
}}
+      {{- end }}
       {{- with .Values.initContainers }}
       initContainers: {{- tpl (toYaml .) $ | nindent 8 }}
       {{- end }}
diff --git a/charts/kyuubi/templates/kyuubi-priorityclass.yaml 
b/charts/kyuubi/templates/kyuubi-priorityclass.yaml
new file mode 100644
index 000000000..c756108ae
--- /dev/null
+++ b/charts/kyuubi/templates/kyuubi-priorityclass.yaml
@@ -0,0 +1,26 @@
+{{/*
+  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.create }}
+apiVersion: scheduling.k8s.io/v1
+kind: PriorityClass
+metadata:
+  name: {{ .Values.priorityClass.name | default .Release.Name }}
+  labels:
+    {{- include "kyuubi.labels" . | nindent 4 }}
+value: {{ .Values.priorityClass.value }}
+{{- end }}
diff --git a/charts/kyuubi/values.yaml b/charts/kyuubi/values.yaml
index 446026fb7..f239e18a3 100644
--- a/charts/kyuubi/values.yaml
+++ b/charts/kyuubi/values.yaml
@@ -36,6 +36,15 @@ serviceAccount:
   # Specifies ServiceAccount name to be used (created if `create: true`)
   name: ~
 
+# priorityClass used for Kyuubi server pod
+priorityClass:
+  # 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
+
 # Role-based access control
 rbac:
   # Specifies whether RBAC resources should be created

Reply via email to