Files

84 lines
2.5 KiB
YAML

{{- /*
Copyright 2025 The Kubeflow authors.
Licensed 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
https://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.hook.upgradeCrd -}}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "spark-operator.hook.job.name" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "spark-operator.hook.labels" . | nindent 4 }}
annotations:
helm.sh/hook: pre-install,pre-upgrade
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
helm.sh/hook-weight: "4"
spec:
template:
metadata:
labels:
{{- include "spark-operator.hook.labels" . | nindent 8 }}
{{- with .Values.hook.labels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.hook.annotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
containers:
- name: spark-operator-hook
image: {{ include "spark-operator.hook.image" . }}
{{- with .Values.image.pullPolicy }}
imagePullPolicy: {{ . }}
{{- end }}
args:
- apply
- --server-side
- --force-conflicts
- -f
- /etc/spark-operator/crds
{{- with .Values.hook.resources }}
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
securityContext:
readOnlyRootFilesystem: true
privileged: false
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
{{- with .Values.image.pullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.hook.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.hook.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.hook.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "spark-operator.hook.serviceAccount.name" . }}
restartPolicy: Never
{{- end }}