---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: flux-helm-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: flux-helm-operator
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        name: flux-helm-operator
    spec:
      serviceAccount: flux
      volumes:
      # The following volume is for using a customised known_hosts
      # file file, which you will need to do if you host your own git
      # repo rather than using github or the like. You'll also need to
      # mount it into the container, below.
      # - name: sshdir
      #   configMap:
      #     name: flux-ssh-config
      #     defaultMode: 0600
      - name: git-key
        secret:
          secretName: flux-git-deploy
          defaultMode: 0400 # when mounted read-only, we won't be able to chmod
      containers:
      - name: flux-helm-operator
        # There are no ":latest" images for helm-operator. Find the most recent
        # release or image version at https://quay.io/weaveworks/helm-operator
        # and replace the tag here.
        image: quay.io/weaveworks/helm-operator:0.2.1
        imagePullPolicy: IfNotPresent
        volumeMounts:
        # Include this if you need to mount a customised known_hosts
        # file; you'll also need the volume declared above.
        # - name: sshdir
        # mountPath: /root/.ssh/known_hosts
        # subPath: known_hosts
        # readOnly: true
        - name: git-key
          mountPath: /etc/fluxd/ssh
          readOnly: true # this will be the case perforce in K8s >=1.10
        args:
        # replace (at least) the following URL
        - --git-url=ssh://git@github.com/weaveworks/flux-helm-test
        - --git-branch=master
        - --git-charts-path=charts
