apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    control-plane: kubeflow-training-operator
  name: {{ include "training-operator.fullname" . }}
  namespace: kubeflow
spec:
  replicas: 1
  selector:
    matchLabels:
      control-plane: kubeflow-training-operator
  template:
    metadata:
      annotations:
        sidecar.istio.io/inject: 'false'
      labels:
        control-plane: kubeflow-training-operator
    spec:
      containers:
      - command:
        - /manager
{{- if .Values.schemes }}
{{- range .Values.schemes }}
        - --enable-scheme={{ . }}
{{- end }}
{{- end }}
        env:
        - name: MY_POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: MY_POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8081
          initialDelaySeconds: 15
          periodSeconds: 20
          timeoutSeconds: 3
        name: training-operator
        ports:
        - containerPort: 8080
        readinessProbe:
          httpGet:
            path: /readyz
            port: 8081
          initialDelaySeconds: 10
          periodSeconds: 15
          timeoutSeconds: 3
        securityContext:
          allowPrivilegeEscalation: false
      serviceAccountName: training-operator
      terminationGracePeriodSeconds: 10