apiVersion: apps/v1
kind: Deployment
metadata:
  name: ml-pipeline
spec:
  template:
    spec:
      containers:
      - name: ml-pipeline-api-server
        env:
        - $patch: replace
        - name: AUTO_UPDATE_PIPELINE_DEFAULT_VERSION
          valueFrom:
            configMapKeyRef:
              name: pipeline-install-config
              key: autoUpdatePipelineDefaultVersion
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: OBJECTSTORECONFIG_SECURE
          value: "false"
        - name: OBJECTSTORECONFIG_BUCKETNAME
          valueFrom:
            configMapKeyRef:
              name: pipeline-install-config
              key: bucketName
        - name: DBCONFIG_CONMAXLIFETIME
          valueFrom:
            configMapKeyRef:
              name: pipeline-install-config
              key: ConMaxLifeTime
        - name: DB_DRIVER_NAME
          valueFrom:
            configMapKeyRef:
              name: pipeline-install-config
              key: dbType
        # PostgreSQL Config
        - name: DBCONFIG_POSTGRESQLCONFIG_USER
          valueFrom:
            secretKeyRef:
              name: postgres-secret-extended
              key: username
        - name: DBCONFIG_POSTGRESQLCONFIG_PASSWORD
          valueFrom:
            secretKeyRef:
              name: postgres-secret-extended
              key: password
        - name: DBCONFIG_POSTGRESQLCONFIG_DBNAME
          valueFrom:
            configMapKeyRef:
              name: pipeline-install-config
              key: pipelineDb
        - name: DBCONFIG_POSTGRESQLCONFIG_HOST
          valueFrom:
            configMapKeyRef:
              name: pipeline-install-config
              key: postgresHost
        - name: DBCONFIG_POSTGRESQLCONFIG_PORT
          valueFrom:
            configMapKeyRef:
              name: pipeline-install-config
              key: postgresPort
        # end of PostgreSQL variables
        - name: OBJECTSTORECONFIG_ACCESSKEY
          valueFrom:
            secretKeyRef:
              name: mlpipeline-minio-artifact
              key: accesskey
        - name: OBJECTSTORECONFIG_SECRETACCESSKEY
          valueFrom:
            secretKeyRef:
              name: mlpipeline-minio-artifact
              key: secretkey