I am using git-sync as a sidecar in Kubernetes to do git-pull and mount the pulled data to shared volume periodically.
Everything works well except GIT_SYNC_PERIOD. I want git sync every 10min, somehow it always use the default value which is 10ms.
Here is my configuration.
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx-helloworld
image: nginx
ports:
- containerPort: 80
volumeMounts:
- mountPath: "/usr/share/nginx/html"
name: www-data
- name: git-sync
image: k8s.gcr.io/git-sync:v3.1.3
volumeMounts:
- name: www-data
mountPath: /data
env:
- name: GIT_SYNC_REPO
value: "https://github.com/musaalp/gighub.git" ##repo-path-you-want-to-clone
- name: GIT_SYNC_BRANCH
value: "master" ##repo-branch
- name: GIT_SYNC_ROOT
value: /data
- name: GIT_SYNC_DEST
value: "languages" ##path-where-you-want-to-clone
- name: GIT_SYNC_PERIOD
value: "600"
securityContext:
runAsUser: 0
volumes:
- name: www-data
emptyDir: {}
I am assuming the value for GIT_SYNC_PERIOD is second.