Open Grieves

Open Grieves

Assimilate quickly!

You must comply!

Running a Git server (GOGS) on OpenShift

You must readPosted by Magnus Glantz 2017-02-07 11:11:21
Hi all,

Sometimes your OpenShift cluster may not have a connection to a git repository, such as GitHub or etc. Then it may be a good idea to run a Git service on the OpenShift cluster itself. This may also be a good idea in general, if each development team want their own clean environment, shared with no-one.

Here’s an example on how you can do that. In my example, I’m using the GOGS (GO Git Service), as it’s tiny, and there are existing OpenShift templates for deploying it.

Here we go, step-by-step:

1. Clone Alessandro Arrichiello’s GitHub repo, which containers templates and more for us to use
$ git clone https://github.com/alezzandro/openshift-gogs-template

2. Create a project to deploy your GOGS server in. In my example, I’ll use the name: my-gogs-project
$ oc new-project my-gogs-project
$ oc project my-gogs-project

3. Go into the cloned ‘openshift-gogs-template’ project.
$ cd openshift-gogs-template

4. Create the gogs service account
$ oc create -f gogs-sa.yml

5. Add permissions for the gogs service account:
$ oadm policy add-scc-to-user privileged system:serviceaccount:my-gogs-project:gogs
$ oc edit scc anyuid

# CHANGE
allowPrivilegedContainer: false
# TO
allowPrivilegedContainer: true

# ADD:
users:
- system:serviceaccount:my-gogs-project:gogs
# SAVE (do not add this line..)

6. Create the template. If the template is not created in the openshift project, it will not be available to all projects.
$ oc create -f gogs-standalone-template.yml -n openshift

7. Deploy GOGS from template (Add to project in the GUI).
8. Goto the gogs URL (route) to do the final setup (don't forget to create a user).
8. Done.





  • Comments(0)//blog.hacka.net/#post126