apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: cache-server
    app.kubernetes.io/component: ml-pipeline
    app.kubernetes.io/name: kubeflow-pipelines
  name: cache-server
  namespace: kubeflow
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cache-server
      app.kubernetes.io/component: ml-pipeline
      app.kubernetes.io/name: kubeflow-pipelines
  template:
    metadata:
      labels:
        app: cache-server
        app.kubernetes.io/component: ml-pipeline
        app.kubernetes.io/name: kubeflow-pipelines
    spec:
      containers:
      - args:
        - --db_driver=$(DBCONFIG_DRIVER)
        - --db_host=$(DBCONFIG_HOST_NAME)
        - --db_port=$(DBCONFIG_PORT)
        - --db_name=$(DBCONFIG_DB_NAME)
        - --db_user=$(DBCONFIG_USER)
        - --db_password=$(DBCONFIG_PASSWORD)
        - --namespace_to_watch=$(NAMESPACE_TO_WATCH)
        env:
        - name: DBCONFIG_DRIVER
          value: mysql
        - name: DBCONFIG_DB_NAME
          valueFrom:
            configMapKeyRef:
              key: cacheDb
              name: pipeline-install-config-2829cc67f8
        - name: DBCONFIG_HOST_NAME
          valueFrom:
            configMapKeyRef:
              key: dbHost
              name: pipeline-install-config-2829cc67f8
        - name: DBCONFIG_PORT
          valueFrom:
            configMapKeyRef:
              key: dbPort
              name: pipeline-install-config-2829cc67f8
        - name: DBCONFIG_USER
          valueFrom:
            secretKeyRef:
              key: username
              name: mysql-secret-fd5gktm75t
        - name: DBCONFIG_PASSWORD
          valueFrom:
            secretKeyRef:
              key: password
              name: mysql-secret-fd5gktm75t
        - name: NAMESPACE_TO_WATCH
          value: ""
        image: gcr.io/ml-pipeline/cache-server:1.0.0
        imagePullPolicy: Always
        name: server
        ports:
        - containerPort: 8443
          name: webhook-api
        volumeMounts:
        - mountPath: /etc/webhook/certs
          name: webhook-tls-certs
          readOnly: true
      serviceAccountName: kubeflow-pipelines-cache
      volumes:
      - name: webhook-tls-certs
        secret:
          secretName: webhook-server-tls
