apiVersion: apps/v1
kind: Deployment
metadata:
  name: ranvier
  labels:
    app: ranvier
spec:
  replicas: 3
  template:
    metadata:
      name: ranvier
      labels:
        app: ranvier
    spec:
      containers:
        - name: ranvier
          image: edwardrowens/ranvier-server:latest
          imagePullPolicy: Always
          resources:
            limits:
              cpu: 500m
              memory: 512Mi
            requests:
              cpu: 256m
              memory: 128Mi
          ports:
            - containerPort: 8080
          env:
            - name: RANVIER_GIT_SSHKEY
              value: /.ssh/id_rsa
          volumeMounts:
            - mountPath: /.ssh/id_rsa
              subPath: id_rsa
              name: ssh-key
              readOnly: true
      restartPolicy: Always
      volumes:
        - name: ssh-key
          secret:
            secretName: git-access
            optional: false
            items:
              - key: ssh-key
                path: id_rsa
  selector:
    matchLabels:
      app: ranvier