347175 (6) [Avatar] Offline
#1
The sidecar container description in this section does not contain enough information to deploy a working example of a sidecar container.

I've tried this example ...
https://github.com/kubernetes/git-sync/tree/master/demo

But the hugo image does not build.
https://github.com/kubernetes/git-sync/issues/74

Is there a working example of using git-sync as a sidecar container on gke that I can try?
echeadle (85) [Avatar] Offline
#2
I don't know if this example helps, but the code works with minikube. I searched dockerhub and randomly selected the openweb/git-sync image. The code assumes you are using your own github account.

apiVersion: v1
kind: Pod
metadata:
name: gitrepo-volume-pod
spec:
containers:
- image: nginx:alpine
name: web-server
volumeMounts:
- name: html
mountPath: /usr/share/nginx/html
readOnly: true
ports:
- containerPort: 80
protocol: TCP
- image: openweb/git-sync
name: git-sync
env:
- name: GIT_SYNC_REPO
value: "https://github.com/<your-account>/kubia-website-example.git"
- name: GIT_SYNC_DEST
value: "/html"
- name: GIT_SYNC_BRANCH
value: "master"
- name: GIT_SYNC_REV
value: "FETCH_HEAD"
- name: GIT_SYNC_WAIT
value: "10"
volumeMounts:
- name: html
mountPath: /html
readOnly: false
volumes:
- name: html
gitRepo:
repository: https://github.com/<your-account>/kubia-website-example.git
revision: master
directory: .