Git-sync supports using a proxy through git-configuration.
See issue 180 for a background. See Github documentation specifically for GitHub. Lastly, see similar issue for FluxCD for configuration.
Create a Kubernetes ConfigMap to store your configuration:
cat << EOF >> /tmp/ssh-config
Host github.com
ProxyCommand socat STDIO PROXY:<proxyIP>:%h:%p,proxyport=<proxyport>,proxyauth=<proxyAuth>
User git
Hostname ssh.github.com
Port 443
IdentityFile /etc/git-secret/ssh
EOF
kubectl create configmap ssh-config --from-file=ssh-config=/tmp/ssh-config
then mount this under ~/.ssh/config
, typically /tmp/.ssh/config
:
...
apiVersion: v1
kind: Pod
...
spec:
containers:
- name: git-sync
...
volumeMounts:
- name: ssh-config
mountPath: /tmp/.ssh/config
readOnly: true
subPath: ssh-config
volumes:
- name: ssh-config
configMap:
name: ssh-config