apiVersion: apps/v1
kind: Deployment
metadata:
  name: metadata-deployment
  namespace: kubeflow
  labels:
    component: server
    kustomize.component: metadata
spec:
  replicas: 1
  selector:
    matchLabels:
      component: server
      kustomize.component: metadata
  template:
    metadata:
      labels:
        component: server
        kustomize.component: metadata
      annotations:
        sidecar.istio.io/inject: "false"
    spec:
      containers:
      - name: container
        image: gcr.io/gcp-private-dev/mirror/gcr.io/kubeflow-images-public/metadata:v0.1.11
        command:
        - ./server/server
        - --http_port=8080
        - --mysql_service_host=metadata-db
        - --mysql_service_port=$(MYSQL_PORT)
        - --mysql_service_user=$(MYSQL_USER_NAME)
        - --mysql_service_password=$(MYSQL_ROOT_PASSWORD)
        - --mlmd_db_name=$(MYSQL_DATABASE)
        ports:
        - name: backendapi
          containerPort: 8080
        envFrom:
        - configMapRef:
            name: metadata-db-parameters
        - secretRef:
            name: metadata-db-secrets
        livenessProbe:
          httpGet:
            port: backendapi
            httpHeaders:
            - name: ContentType
              value: application/json
            path: /api/v1alpha1/artifact_types
          initialDelaySeconds: 3
          periodSeconds: 5
          timeoutSeconds: 2
        readinessProbe:
          httpGet:
            port: backendapi
            httpHeaders:
            - name: ContentType
              value: application/json
            path: /api/v1alpha1/artifact_types
          initialDelaySeconds: 3
          periodSeconds: 5
          timeoutSeconds: 2
