apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: ml-pipeline-ui
  name: ml-pipeline-ui
spec:
  selector:
    matchLabels:
      app: ml-pipeline-ui
  template:
    metadata:
      labels:
        app: ml-pipeline-ui
    spec:
      containers:
      - image: $(IMAGE_PREFIX)/frontend:$(IMAGE_TAG)
        imagePullPolicy: IfNotPresent
        name: ml-pipeline-ui
        ports:
        - containerPort: 3000
        env:
          - name: MINIO_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: ALLOW_CUSTOM_VISUALIZATIONS
            value: "true"
        readinessProbe:
          exec:
            command:
              - wget
              - -q # quiet
              - -S # show server response
              - -O
              - "-" # Redirect output to stdout
              - http://localhost:3000/apis/v1beta1/healthz
          initialDelaySeconds: 3
          periodSeconds: 5
          timeoutSeconds: 2
        livenessProbe:
          exec:
            command:
              - wget
              - -q # quiet
              - -S # show server response
              - -O
              - "-" # Redirect output to stdout
              - http://localhost:3000/apis/v1beta1/healthz
          initialDelaySeconds: 3
          periodSeconds: 5
          timeoutSeconds: 2
      serviceAccountName: ml-pipeline-ui
