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

ethanfeng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/celeborn.git


The following commit(s) were added to refs/heads/main by this push:
     new 1aca848c3 [HELM] add serviceAccount helm chart
1aca848c3 is described below

commit 1aca848c315d64c1a00f604ea7f645eae868fe06
Author: zhaohehuhu <[email protected]>
AuthorDate: Wed Dec 18 20:06:37 2024 +0800

    [HELM] add serviceAccount helm chart
    
    <!--
    Thanks for sending a pull request!  Here are some tips for you:
      - Make sure the PR title start w/ a JIRA ticket, e.g. '[CELEBORN-XXXX] 
Your PR title ...'.
      - Be sure to keep the PR description updated to reflect all changes.
      - Please write your PR title to summarize what this PR proposes.
      - If possible, provide a concise example to reproduce the issue for a 
faster review.
    -->
    
    ### What changes were proposed in this pull request?
    
    as title
    
    ### Why are the changes needed?
    
    Support custom serviceAccount to control what permissions and resources a 
pod has access to.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No
    
    ### How was this patch tested?
    
     test the template rendering by helm template command line
    
    Closes #3006 from zhaohehuhu/dev-1218.
    
    Authored-by: zhaohehuhu <[email protected]>
    Signed-off-by: mingji <[email protected]>
---
 charts/celeborn/ci/values.yaml                    |  6 ++++++
 charts/celeborn/templates/master/statefulset.yaml |  1 +
 charts/celeborn/templates/serviceaccount.yaml     | 26 +++++++++++++++++++++++
 charts/celeborn/templates/worker/statefulset.yaml |  1 +
 charts/celeborn/values.yaml                       |  6 ++++++
 5 files changed, 40 insertions(+)

diff --git a/charts/celeborn/ci/values.yaml b/charts/celeborn/ci/values.yaml
index 125d3d2b8..81862d4a3 100644
--- a/charts/celeborn/ci/values.yaml
+++ b/charts/celeborn/ci/values.yaml
@@ -134,3 +134,9 @@ podMonitor:
     interval: 5s
     # Specifies port name
     portName: metrics
+
+serviceAccount:
+  # -- Specifies whether to create a service account for Celeborn
+  create: false
+  # -- Specifies the name of the service account
+  name: default
diff --git a/charts/celeborn/templates/master/statefulset.yaml 
b/charts/celeborn/templates/master/statefulset.yaml
index d917dc82a..7d3fe6ecb 100644
--- a/charts/celeborn/templates/master/statefulset.yaml
+++ b/charts/celeborn/templates/master/statefulset.yaml
@@ -39,6 +39,7 @@ spec:
         {{- toYaml . | nindent 8 }}
       {{- end }}
     spec:
+      serviceAccountName:  {{ include "celeborn.serviceAccountName" . }}
       initContainers:
       {{- $dirs := .Values.volumes.master }}
       {{- if eq "hostPath" (index $dirs 0).type }}
diff --git a/charts/celeborn/templates/serviceaccount.yaml 
b/charts/celeborn/templates/serviceaccount.yaml
new file mode 100644
index 000000000..7deb9eae4
--- /dev/null
+++ b/charts/celeborn/templates/serviceaccount.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.serviceAccount.create }}
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: {{ include "celeborn.serviceAccountName" . }}
+  labels:
+    {{- include "celeborn.labels" . | nindent 4 }}
+{{- end }}
+
diff --git a/charts/celeborn/templates/worker/statefulset.yaml 
b/charts/celeborn/templates/worker/statefulset.yaml
index 5313b21eb..f8d102312 100644
--- a/charts/celeborn/templates/worker/statefulset.yaml
+++ b/charts/celeborn/templates/worker/statefulset.yaml
@@ -39,6 +39,7 @@ spec:
         {{- toYaml . | nindent 8 }}
       {{- end }}
     spec:
+      serviceAccountName:  {{ include "celeborn.serviceAccountName" . }}
       initContainers:
       {{- $dirs := .Values.volumes.worker }}
       {{- if eq "hostPath" (index $dirs 0).type }}
diff --git a/charts/celeborn/values.yaml b/charts/celeborn/values.yaml
index 81ac0059a..37c6962c8 100644
--- a/charts/celeborn/values.yaml
+++ b/charts/celeborn/values.yaml
@@ -247,3 +247,9 @@ podMonitor:
     interval: 5s
     # Specifies port name
     portName: metrics
+
+serviceAccount:
+  # -- Specifies whether to create a service account for Celeborn
+  create: false
+  # -- Specifies the name of the service account
+  name: default

Reply via email to