apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    name: gitsrv
  name: gitsrv
spec:
  replicas: 1
  selector:
    matchLabels:
      name: gitsrv
  template:
    metadata:
      labels:
        name: gitsrv
    spec:
      containers:
        - name: git
          image: fluxcd/gitsrv:latest
          imagePullPolicy: IfNotPresent
          env:
            - name: REPO
              value: "cluster.git"
            - name: TAR_URL
              value: "https://github.com/fluxcd/flux-get-started/archive/master.tar.gz"
          ports:
            - containerPort: 22
              name: ssh
              protocol: TCP
          readinessProbe:
            tcpSocket:
              port: 22
            initialDelaySeconds: 20
            periodSeconds: 10
          livenessProbe:
            tcpSocket:
              port: 22
            initialDelaySeconds: 20
            periodSeconds: 10
          volumeMounts:
            - mountPath: /git-server/repos
              name: git-server-data
            - mountPath: /git-server/keys
              name: ssh-key
      volumes:
        - name: ssh-key
          secret:
            secretName: ssh-key
        - name: git-server-data
          emptyDir: {}
