apiVersion: apps/v1
kind: Deployment
metadata:
  name: bookkeeper-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: bookkeeper-operator
  template:
    metadata:
      labels:
        name: bookkeeper-operator
        component: bookkeeper-operator
    spec:
      serviceAccountName: bookkeeper-operator
      containers:
        - name: bookkeeper-operator
          image: pravega/bookkeeper-operator:0.1.3
          ports:
          - containerPort: 60000
            name: metrics
          command:
          - bookkeeper-operator
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              value: ""
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "bookkeeper-operator"
          volumeMounts:
            - name: webhook-cert
              mountPath: "/tmp/k8s-webhook-server/serving-certs"
              readOnly: true
            - name: versions-volume
              mountPath: "/tmp/config"
      volumes:
        - name: webhook-cert
          secret:
            secretName: selfsigned-cert-tls-bk
        - name: versions-volume
          configMap:
            name: bk-supported-versions-map
