Bug 1374984

Summary: Support for git volumes
Product: OpenShift Container Platform Reporter: Jaspreet Kaur <jkaur>
Component: RFEAssignee: Bradley Childs <bchilds>
Status: CLOSED NOTABUG QA Contact: Johnny Liu <jialiu>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.2.0CC: aos-bugs, jokerman, jsafrane, mmccomas, simon.gunzenreiner, swatt
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-15 23:09:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jaspreet Kaur 2016-09-11 11:25:12 UTC
4. Why does the customer need this? (List the business requirements here)
For technical openshift extensions (controllers) or other platform management purposes (managing metadata about tenants, their ingress and egress routers and associated nodes, as well as mapping of certain security attributes of applications towards such routers) the customer would like to store such information in a versioned versioning system, specifically git.
This would allow for the git volume to be periodically mounted (see controller of fabric 8 for that), and acct according to the new information in the target environment.
Currently identified, inferior alternatives: 
- storing the model in a openshift hosted versioned database (discarded because overkill)
- storing a "flat" version of the model in ConfigMaps

5. How would the customer like to achieve this? (List the functional requirements here)
Being able to declare git volumes as PVs to projects.

6. For each functional requirement listed in question, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.
- mount git volume via the specification of ssh or userid/pwd or access token credentials
- be able to read from that repo once assigned to a pod

7. Is there already an existing RFE upstream or in Red Hat bugzilla?
Not that the customer would be aware.

8. Does the customer have any specific timeline dependencies?
Customer currently has to build "work around", so the sooner the better.

Comment 2 Jan Safranek 2016-09-16 12:01:41 UTC
1) It is already possible to use git repos as volumes in Kubernetes, see http://kubernetes.io/docs/user-guide/volumes/#gitrepo

I am not sure about its availability on OpenShift, especially whether /usr/bin/git is installed on Atomic Host or in OpenShift containers.

2) You can achieve the same with init containers, https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/container-init.md - an init container downloads git repository into an EmptyDir, where the "real" pod containers find it when they start. You can do any magic you want in the init container, you're not limited to simple `git clone`. This way, /usr/bin/git does not need to be installed on Atomic Host.

We do not like adding new specific volume types for various SCM systems, we would end up with dozens of them.