apiVersion: apps/v1
kind: Deployment
metadata:
  name: klusterlet-addon-lease-controller
spec:
  template:
    spec:
      containers:
      - name: fake-addon
        image: busybox
        command: ['sh', '-c', 'if [ ! -f /usr/share/do_not_run ]; then echo running; touch /usr/share/do_not_run; sleep 150; fi; exit 1;']
        volumeMounts:
        - mountPath: /usr/share/
          name: shared-data
      - name: klusterlet-addon-lease-controller
        imagePullPolicy: IfNotPresent
        volumeMounts:
        - mountPath: /tmp/coverage
          name: coverage-dir
        - mountPath: /usr/share/
          name: shared-data
        command: 
        args:
        - -lease-name 
        - addon-lease
        - -lease-namespace 
        - open-cluster-management-self-import
        - -hub-kubeconfig-secret
        - hub-config-secret
        - -lease-duration
        - "5"
        - -startup-delay
        - "2"
        env:
        - name: WATCH_NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
      volumes:
      - name: shared-data
        emptyDir: {}
      - name: coverage-dir
        hostPath:
          # directory location on host
          path: /tmp/coverage
          # this field is optional
          type: Directory