ChenYi015 commented on code in PR #2499:
URL: https://github.com/apache/celeborn/pull/2499#discussion_r1597346093
##########
charts/celeborn/templates/worker/statefulset.yaml:
##########
@@ -0,0 +1,149 @@
+{{- /*
+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: StatefulSet
+metadata:
+ name: {{ include "celeborn.workerStatefulSetName" . }}
+ labels:
+ {{- include "celeborn.labels" . | nindent 4 }}
+ app.kubernetes.io/role: worker
+spec:
+ serviceName: {{ include "celeborn.workerServiceName" . }}
+ selector:
+ matchLabels:
+ {{- include "celeborn.selectorLabels" . | nindent 6 }}
+ app.kubernetes.io/role: worker
+ template:
+ metadata:
+ labels:
+ {{- include "celeborn.selectorLabels" . | nindent 8 }}
+ app.kubernetes.io/role: worker
+ app.kubernetes.io/tag: {{ .Values.image.tag | quote }}
+ {{- with .Values.podAnnotations }}
+ annotations:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ spec:
+ initContainers:
+ {{- $dirs := .Values.volumes.worker }}
+ {{- if eq "hostPath" (index $dirs 0).type }}
+ - name: chown-{{ $.Release.Name }}-worker-volume
+ image: alpine:3.18
+ {{- with .Values.image.pullPolicy }}
+ imagePullPolicy: {{ . }}
+ {{- end }}
+ command:
+ - chown
+ - {{ .Values.securityContext.runAsUser | default 10006 }}:{{
.Values.securityContext.runAsGroup | default 10006 }}
+ {{- range $dir := $dirs }}
+ - {{ $dir.mountPath }}
+ {{- end}}
+ volumeMounts:
+ {{- range $index, $dir := $dirs }}
+ - name: {{ $.Release.Name }}-worker-vol-{{ $index }}
+ mountPath: {{ $dir.mountPath }}
+ {{- end}}
+ {{- with .Values.resources.worker }}
+ resources:
+ {{- toYaml . | nindent 10 }}
+ {{- end }}
+ securityContext:
+ runAsUser: 0
+ {{- end }}
+ containers:
+ - name: {{ .Chart.Name }}
+ image: {{ include "celeborn.image" . }}
+ {{- with .Values.image.pullPolicy }}
+ imagePullPolicy: {{ . }}
+ {{- end }}
+ command:
+ - /usr/bin/tini
+ - --
+ - /bin/sh
+ - -c
+ {{- $namespace := .Release.Namespace }}
+ - "until {{ range until (.Values.masterReplicas |int) }}nslookup {{
$.Release.Name }}-master-{{ . }}.{{ $.Release.Name }}-master-svc.{{ $namespace
}}.svc.{{ $.Values.cluster.name }}.local && {{ end }}true; do echo waiting for
master; sleep 2; done && exec /opt/celeborn/sbin/start-worker.sh"
+ ports:
+ - containerPort: {{ get .Values.celeborn "celeborn.worker.http.port" |
default 9096 }}
+ name: metrics
+ protocol: TCP
+ env:
+ {{- range $key, $val := .Values.environments }}
+ - name: {{ $key }}
+ value: {{ $val | quote }}
+ {{- end}}
+ volumeMounts:
+ - mountPath: /opt/celeborn/conf
+ name: {{ include "celeborn.fullname" . }}-volume
+ readOnly: true
+ {{- range $index, $volume := .Values.volumes.worker }}
+ - name: {{ $.Release.Name }}-worker-vol-{{ $index }}
+ mountPath: {{ .mountPath }}
+ {{- end }}
+ {{- with .Values.resources.worker }}
+ resources:
+ {{- toYaml . | nindent 10 }}
+ {{- end }}
+ {{- with .Values.image.pullSecrets }}
+ imagePullSecrets:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ volumes:
+ - name: {{ include "celeborn.fullname" . }}-volume
+ configMap:
+ name: {{ include "celeborn.configMapName" . }}
+ {{- range $index, $volume := .Values.volumes.worker }}
+ - name: {{ $.Release.Name }}-worker-vol-{{ $index }}
+ {{- if eq "emptyDir" $volume.type }}
+ emptyDir:
+ sizeLimit: {{ $volume.capacity }}
+ {{- else if eq "hostPath" $volume.type }}
+ hostPath:
+ path: {{ $volume.hostPath | default $volume.mountPath }}/worker
+ type: DirectoryOrCreate
+ {{- else }}
+ {{ fail "Currently, Celeborn chart only supports 'emptyDir' and
'hostPath' volume types" }}
+ {{- end }}
+ {{- end }}
+ {{- with .Values.nodeSelector }}
+ nodeSelector:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.tolerations }}
+ tolerations:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.affinity.worker }}
+ affinity:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- if or .Values.priorityClass.worker.name
.Values.priorityClass.worker.create }}
+ priorityClassName: {{ .Values.priorityClass.worker.name | default
(include "celeborn.masterPriorityClassName" .) }}
Review Comment:
> "celeborn.workerPriorityClassName"
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]