apiVersion: apps/v1
kind: Deployment
metadata:
  name: model-registry-deployment
spec:
  template:
    metadata:
      annotations:
        # db doesn't use istio
        traffic.sidecar.istio.io/excludeOutboundPorts: $(POSTGRES_PORT)
    spec:
      containers:
        - name: grpc-container
          # Remove existing environment variables
          env:
          - $patch: replace
          envFrom:
          - configMapRef:
              name: metadata-registry-db-parameters
          - secretRef:
              name: metadata-registry-db-secrets
          - configMapRef:
              name: model-registry-configmap
          args: ["--grpc_port=$(MODEL_REGISTRY_GRPC_SERVICE_PORT)",
                 "--metadata_source_config_type=postgresql",
                 "--postgres_config_host=$(MLMD_DB_HOST)",
                 "--postgres_config_port=$(POSTGRES_PORT)",
                 "--postgres_config_dbname=$(POSTGRES_DBNAME)",
                 "--postgres_config_user=$(POSTGRES_USER)",
                 "--postgres_config_password=$(POSTGRES_PASSWORD)",
                #  "--postgres_config_skip_db_creation=true",
                 "--enable_database_upgrade=true"]
