Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load key "/etc/git-secret/ssh": Permission denied #34

Closed
dohnto opened this issue Feb 2, 2017 · 2 comments
Closed

Load key "/etc/git-secret/ssh": Permission denied #34

dohnto opened this issue Feb 2, 2017 · 2 comments
Assignees

Comments

@dohnto
Copy link

dohnto commented Feb 2, 2017

Hello,

I am using this version of git sync 1a9138765af75007d88f77c985f4f2af200b1227
I build a docker image using make container REGISTRY=X TAG=Y

And I am using following setup:

apiVersion: v1
kind: Pod
metadata:
  name: server
spec:
  containers:
  - image: nginx
    name: nginx
    volumeMounts:
    - mountPath: /mypath
      name: git-volume
  - image: MY_IMAGE:git-sync-amd64:v2.0.4-6-g1a91387
    name: git-sync
    env:
    - name: GIT_SYNC_REPO
      value: "git@MY_REPO"
    - name: GIT_SYNC_SSH
      value: "true"
    #command:
    #- tail
    #- -f
    #- /dev/null
    args:
    - -dest
    - foo
    - --v=9
    volumeMounts:
    - mountPath: /etc/git-secret
      name: git-secret
    - name: git-volume
      mountPath: /git
  volumes:
  - name: git-secret
    secret:
      secretName: creds
      defaultMode: 256
  - name: git-volume
    emptyDir: {}

But I cannot clone the repository.

When I use the commend version with tail -f /dev/null and execute into the container and I run manually:

# export GIT_SSH_COMMAND="ssh -vv -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i/etc/git-secret/ssh"
# git clone git@MY_REPO
...
Load key "/etc/git-secret/ssh": Permission denied
...
# ls -l /etc/git-secret/ssh
lrwxrwxrwx 1 root root 10 Feb  2 16:21 /etc/git-secret/ssh -> ..data/ssh
# -l /etc/git-secret/..data/ssh 
-r-------- 1 root root 1675 Feb  2 16:21 /etc/git-secret/..data/ssh
# whoami 
nobody
@stp-ip stp-ip self-assigned this Feb 6, 2017
@sjernigan
Copy link

We had the same issue. Eventually worked around it by running the container as root :-(

    securityContext:
      runAsUser: 0

This was referenced Feb 17, 2017
@stp-ip
Copy link
Member

stp-ip commented Feb 17, 2017

Fixed via #37.

@stp-ip stp-ip closed this as completed Feb 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants