Mounting private GitHub repository into a pod's volume

9/1/2015

Has anyone mounted a private GitHub repository into a kubernetes pod volume?

What is the best way to achieve this? I thought of two possible ways:

  1. Using user / password in HTTPS repository URL
  2. Using private SSH key on the machine

I like the second better, but I couldn't figure which user is pulling the repository to puts the appropriate SSH configuration for it.

Any thoughts?

-- Erez Rabih
docker
github
kubernetes
volume

1 Answer

9/1/2015

GitHub allows cloning repositories using an OAuth token in https URLs as such:

$ git clone https://$GH_TOKEN@github.com/owner/repo.git

see https://help.github.com/articles/creating-an-access-token-for-command-line-use/

-- hd.deman
Source: StackOverflow