mirror of
https://github.com/bitnami/charts.git
synced 2026-03-13 06:47:24 +08:00
162 lines
5.8 KiB
YAML
162 lines
5.8 KiB
YAML
{{- if eq .Values.mode "standalone" }}
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "mxnet.fullname" . }}
|
|
labels:
|
|
app.kubernetes.io/name: {{ include "mxnet.name" . }}
|
|
helm.sh/chart: {{ include "mxnet.chart" . }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
app.kubernetes.io/component: standalone
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: {{ include "mxnet.name" . }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
app.kubernetes.io/component: standalone
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: {{ include "mxnet.name" . }}
|
|
helm.sh/chart: {{ include "mxnet.chart" . }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
app.kubernetes.io/component: standalone
|
|
spec:
|
|
{{- include "mxnet.imagePullSecrets" . | nindent 6 }}
|
|
{{- if .Values.securityContext.enabled }}
|
|
securityContext:
|
|
fsGroup: {{ .Values.securityContext.fsGroup }}
|
|
runAsUser: {{ .Values.securityContext.runAsUser }}
|
|
{{- end }}
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector: {{ tpl (toYaml .) $ | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations: {{ tpl (toYaml .) $ | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity: {{ tpl (toYaml .) $ | nindent 8 }}
|
|
{{- end }}
|
|
initContainers:
|
|
{{- if .Values.cloneFilesFromGit.enabled }}
|
|
- name: git-clone-repository
|
|
image: {{ include "git.image" . }}
|
|
imagePullPolicy: {{ .Values.git.pullPolicy | quote }}
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- |
|
|
git clone {{ .Values.cloneFilesFromGit.repository }} --branch {{ .Values.cloneFilesFromGit.revision }} /app
|
|
volumeMounts:
|
|
- name: git-cloned-files
|
|
mountPath: /app
|
|
{{- end }}
|
|
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
|
|
- name: volume-permissions
|
|
image: "{{ template "mxnet.volumePermissions.image" . }}"
|
|
imagePullPolicy: {{ default "" .Values.volumePermissions.image.pullPolicy | quote }}
|
|
command: ["chown", "-R", "{{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }}", "{{ .Values.persistence.mountPath }}"]
|
|
securityContext:
|
|
runAsUser: 0
|
|
resources: {{ toYaml .Values.volumePermissions.resources | nindent 10 }}
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: {{ .Values.persistence.mountPath }}
|
|
{{- end }}
|
|
{{- if .Values.initContainers }}
|
|
{{- toYaml .Values.initContainers | nindent 6 }}
|
|
{{- end }}
|
|
containers:
|
|
- name: mxnet
|
|
workingDir: {{ .Values.entrypoint.workDir }}
|
|
image: {{ include "mxnet.image" . }}
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
command:
|
|
- bash
|
|
- -c
|
|
- |
|
|
{{- include "mxnet.entrypoint" . | nindent 10 }}
|
|
env:
|
|
{{- if .Values.commonExtraEnvVars }}
|
|
{{- include "mxnet.parseEnvVars" .Values.commonExtraEnvVars | nindent 8 }}
|
|
{{- end }}
|
|
ports:
|
|
- name: mxnet
|
|
containerPort: {{ .Values.schedulerPort }}
|
|
{{- if .Values.livenessProbe.enabled }}
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- python3
|
|
- -c
|
|
- import mxnet; print(mxnet.__version__)
|
|
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
|
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
|
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
|
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
|
|
{{- end }}
|
|
{{- if .Values.readinessProbe.enabled }}
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- python3
|
|
- -c
|
|
- import mxnet; print(mxnet.__version__)
|
|
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
|
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
|
successThreshold: {{ .Values.readinessProbe.successThreshold }}
|
|
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
|
|
{{- end }}
|
|
resources: {{ toYaml .Values.resources | nindent 12 }}
|
|
volumeMounts:
|
|
{{- if .Values.configMap }}
|
|
- name: ext-files
|
|
mountPath: /app
|
|
{{- else if .Files.Glob "files/*" }}
|
|
- name: local-files
|
|
mountPath: /app
|
|
{{- else if .Values.cloneFilesFromGit.enabled }}
|
|
- name: git-cloned-files
|
|
mountPath: /app
|
|
{{- end }}
|
|
- name: data
|
|
mountPath: {{ .Values.persistence.mountPath }}
|
|
{{- if .Values.existingSecret }}
|
|
- name: secret-data
|
|
mountPath: /secrets
|
|
{{- end }}
|
|
{{- if .Values.sidecars }}
|
|
{{- toYaml .Values.sidecars | nindent 6 }}
|
|
{{- end }}
|
|
volumes:
|
|
{{- if .Values.existingSecret }}
|
|
- name: secret-data
|
|
secret:
|
|
secretName: {{ .Values.existingSecret }}
|
|
{{- end }}
|
|
{{- if .Values.configMap }}
|
|
- name: ext-files
|
|
configMap:
|
|
name: {{ .Values.configMap }}
|
|
{{- else if .Files.Glob "files/*" }}
|
|
- name: local-files
|
|
configMap:
|
|
name: {{ include "mxnet.fullname" . }}-files
|
|
{{- else if .Values.cloneFilesFromGit.enabled }}
|
|
- name: git-cloned-files
|
|
emptyDir: {}
|
|
{{- end }}
|
|
- name: data
|
|
{{- if .Values.persistence.enabled }}
|
|
persistentVolumeClaim:
|
|
claimName: {{ include "mxnet.fullname" . }}
|
|
{{- else }}
|
|
emptyDir: {}
|
|
{{- end }}
|
|
{{- end }}
|