Skip to content

Latest commit

 

History

History
48 lines (39 loc) · 1.2 KB

proxy.md

File metadata and controls

48 lines (39 loc) · 1.2 KB

Using git with proxy

Git-sync supports using a proxy through git-configuration.

Background

See issue 180 for a background. See Github documentation specifically for GitHub. Lastly, see similar issue for FluxCD for configuration.

Step 1: Create 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