GitLab Documentation

Omnibus GitLab Development Setup

Requirements

An all-in-one install of OpenShift will require at least 5Gb of free RAM on your computer in order to test GitLab.

Setup OpenShift Origin

The first thing you need to interact with OpenShift Origin, are the oc client tools for your terminal:

  1. Download and install the OpenShift Origin Client Tools onto your path if you don't already have them.

Next you need to setup an OpenShift Origin environment. To setup the environment you can use the production installer on a cloud machine, use minishift on your local machine (uses kvm or xhyve), or setup an instance using docker for the master, and your own machine as the slave using oc cluster up

Minishift

Installation instructions for Minishift can be found at https://docs.openshift.org/latest/minishift/getting-started/installing.html

  1. Before installing Minishift you need to install the proper docker machine driver.

  2. Install Minishift, following the instruction for your platform

  3. Start Minishift with enough cpu/memory to run GitLab: minishift start --cpus 4 --memory 6144

    • When it is finished starting, the command will output the location of the web console.
  4. Minishift internally uses the oc cluster up method, so start following the directions in step 2

  5. You can login to the UI at https://<your_local_minishift_ip>:8443/console/

    • Your minishift IP was shown after starting minishift, but you can also find it later by running minishift ip

Docker oc cluster up

If you have Docker installed, you can setup OpenShift Origin on your local machine: https://github.com/openshift/origin/blob/master/docs/cluster_up_down.md

**Note:this currently does not start if you are using docker-ce/ee with the new version scheme (17.xx)

  1. On your terminal call oc cluster up --host-data-dir='/srv/openshift'

    • Note that oc cluster needs access to port 80 on your host, so you may need to stop any webserver while using OpenShift
  2. Create a new namespace to assign storage and permissions to.

    • oc new-project <namespace>
  3. Login as system admin

    • oc login -u system:admin
  4. In order to allow the GitLab pod to run as root you need to edit the anyuid security context:

    • oc adm policy add-scc-to-user anyuid system:serviceaccount:<namespace>:<gitlab-app-name>-user
    • (gitlab-app-name is the first config option when installing GitLab, and defaults to gitlab-ce)
  5. Create some Persistent Volumes for GitLab to use.

    • Create a file with the following:
    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: pv0001
    spec:
      capacity:
        storage: 5Gi
      accessModes:
      - ReadWriteOnce
      hostPath:
        path: /srv/openshift-gitlab/pv0001
      persistentVolumeReclaimPolicy: Recycle
    ---
    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: pv0002
    spec:
      capacity:
        storage: 5Gi
      accessModes:
      - ReadWriteOnce
      hostPath:
        path: /srv/openshift-gitlab/pv0002
      persistentVolumeReclaimPolicy: Recycle
    ---
    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: pv0003
    spec:
      capacity:
        storage: 5Gi
      accessModes:
      - ReadWriteOnce
      hostPath:
        path: /srv/openshift-gitlab/pv0003
      persistentVolumeReclaimPolicy: Recycle
    ---
    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: pv0004
    spec:
      capacity:
        storage: 5Gi
      accessModes:
      - ReadWriteOnce
      hostPath:
        path: /srv/openshift-gitlab/pv0004
      persistentVolumeReclaimPolicy: Recycle
    
  1. Create each of the host paths on your own machine and ensure they have a 777 filemode

  2. You can now login to the UI at https://localhost:8443/console/

Production Ansible Installer

You can use OpenShift's Ansible installer to setup OpenShift masters and slaves in Digital Ocean. Follow the advanded install docs.

You can find the Ansible playbooks at: https://github.com/openshift/openshift-ansible

After setting it all up, you will need to make sure you deploy the registry and router mentioned in the what's next section

In order to finish setting up the cluster, you need to create a project and allow your project's service account to run as anyuid.

And you need to setup persistent volumes. See 3 and 4 of the oc cluster up steps

Add the GitLab template to OpenShift

Add the GitLab template to OpenShift (The next release of the VM includes GitLab, so this may not be required)

Install GitLab

After having setup the template:

  1. Go to the web console for OpenShift
  2. Create a new project or use an existing one that doesn't already have GitLab
  3. Add to Project, and add the GitLab-Ce template

Removing the GitLab template

In case you want to upload a new version of it:

oc delete template/gitlab-ce -n openshift

Known Issues

  1. If running oc cluster up from your dev machine, newer versions of Docker are not yet supported. (The 17.xx version scheme)

  2. If you are running minishift, persistent volumes do not yet get persisted between restarts. So you need setup a new cluster each time you go to use it.

Releasing a New Version

See release/openshift.md.


Leave a comment below if you have any feedback on the documentation. For support and other inquires, see getting help.