# Create the actual deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  name: flytescheduler
  namespace: flyte
  labels:
    app: flytescheduler
spec:
  replicas: 1
  selector:
    matchLabels:
      app: flytescheduler
  template:
    metadata:
      labels:
        app: flytescheduler
        app.kubernetes.io/name: flytescheduler
        app.kubernetes.io/version: 0.3.4
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "10254"
        prometheus.io/path: "/metrics"
    spec:
      serviceAccountName: flyteadmin
      volumes:
        - name: config-volume
          configMap:
            name: flyte-scheduler-config
        - name: db-pass
          secret:
            secretName: db-pass
        - name: auth
          secret:
            secretName: flyte-secret-auth
      initContainers:
      - command:
        - flytescheduler
        - precheck
        - --config
        - /etc/flyte/config/*.yaml
        image: "cr.flyte.org/flyteorg/flytescheduler:v0.6.49"
        imagePullPolicy: "IfNotPresent"
        name: flytescheduler-check
        volumeMounts:
          - mountPath: /etc/flyte/config
            name: config-volume
      containers:
      - command:
        - flytescheduler
        - run
        - --config
        - /etc/flyte/config/*.yaml
        image: "cr.flyte.org/flyteorg/flytescheduler:v0.6.49"
        imagePullPolicy: "IfNotPresent"
        name: flytescheduler
        resources:
          limits:
            cpu: 250m
            ephemeral-storage: 100Mi
            memory: 500Mi
          requests:
            cpu: 10m
            ephemeral-storage: 50Mi
            memory: 50Mi
        volumeMounts:
          - name: auth
            mountPath: /etc/secrets/
          - mountPath: /etc/flyte/config
            name: config-volume
          - name: db-pass
            mountPath: /etc/db
