GitLab Operator

If you already have a Git repository consider using that and skip this step.

Note:

To complete this task, you must be a cluster administrator.

Warning:

The GitLab Operator is still only available in version 0.x and not yet suitable for production use. We recommend this operator only for PoC situations.

Install the GitLab Operator from the OperatorHub

Warning:

To complete this task a user in the cluster admin role is required.

As a cluster administrator, install the GitLab operator from the OperatorHub to the namespace gitlab-system as follows:

  1. Navigate in the OpenShift Web Console to the Operators → OperatorHub page
  2. Filter by keyword: gitlab
  3. Select the operator: GitLab provided by GitLab Inc
  4. Read the information about the operator and click Install
  5. On the Create Operator Subscription page:
    • Select option A specific namespace on the cluster with namespace gitlab-system
    • Select an update channel (if more than one is available)
    • Select Automatic approval strategy
    • Click Subscribe
  6. After the subscription's upgrade status is up to date, navigate in the web console to the Operators → Installed Operators page
  7. Select the GitLab operator and verify that the content for the Overview tab of the Operators → Operator Details page is displayed
Note:

See OpenShift documentation on adding operators to a cluster (OpenShift 4.14) for further information on how to install an operator from the OperatorHub.

Create the GitLab instance

Create the GitLab CRD instance in the namespace gitlab-system as follows:

  1. Navigate in the OpenShift Web Console to the Operators → Installed Operators page
  2. Select the GitLab Operator
  3. Navigate to the GitLab tab of the Operators → Operator Details page
  4. Click Create GitLab
  5. Verify that in the GitLab tab the newly created gitlab CRD instance is displayed.

Example GitLab Configuration

apiVersion: apps.gitlab.com/v1beta1
kind: GitLab
metadata:
  name: gitlab
  namespace: gitlab-system
spec:
  chart:
    values:
      certmanager:
        install: false
      global:
        appConfig:
          omniauth:
            enabled: true
            autoLinkSamlUser: false
            providers:
              - key: provider
                secret: gitlab-client
            syncProfileAttributes:
              - email
            autoSignInWithProvider: null
            syncProfileFromProvider: []
            allowBypassTwoFactor: []
            allowSingleSignOn:
              - oauth2_generic
            autoLinkUser: []
            externalProviders: []
            autoLinkLdapUser: false
            blockAutoCreatedUsers: false
        hosts:
          domain: apps.openshift.my.cloud
        ingress:
          configureCertmanager: false
    version: 6.2.2