---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    run: nginx-synced
  name: nginx-synced
spec:
  replicas: 3
  selector:
    matchLabels:
      run: nginx-synced
  
  template:
    metadata:
      labels:
        run: nginx-synced
    spec:
      volumes:
      - name: html
        emptyDir: {}
      containers:
      - image: k8s.gcr.io/git-sync:v3.1.5
        name: git-sync
        env:
        - name: GIT_SYNC_REPO
          value: https://github.com/bjethwan/ps-sidecar.git
        - name: GIT_SYNC_BRANCH
          value: master
        - name: GIT_SYNC_DEST
          value: html
        - name: GIT_SYNC_DEPTH
          value: "1"
        volumeMounts:
        - name: html
          mountPath: /tmp/git
      - image: bjethwan/nginx
        name: nginx-synced
        ports:
        - containerPort: 80
        volumeMounts:
        - name: html
          mountPath: /usr/share/nginx
