Add Cluster to GitLab project

In order for the project artifact to be deployed on your cluster, you must make sure that your cluster is connected to your GitLab repository correctly.


  • You must have a remote GitLab repository for your custom light module.

  • You must have administrator privileges on your custom light module repository.

  • You must have a Magnolia PaaS subscription.

  • You must have an existing Rancher account and cluster.


To complete these instructions, you need to have both Rancher and Gitlab open.

You should also have a text editor to hand.

Rancher steps

  1. First thing’s first, have your text editor open.

  2. Log in to your Rancher account.

  3. From the Global view, open the cluster you want to connect with your light module repo.

  4. Open Kubeconfig File.

  5. In the pop-up, copy the server URL. Paste it into your text editor.

    1. Also, copy the token. Paste it into your text editor.

      kubeconfig url
      Keep this handy for the Gitlab steps.

Gitlab steps

  1. Log in to your Gitlab account.

  2. Navigate to your custom light module repository.

  3. Go to Operations > Kubernetes.

    gitlab operations kubernetes
  4. Choose the Connect existing cluster tab.

    gitlab connect existing cluster
  5. Fill in the details: (see the image below for help if needed)

    1. Kubernetes cluster name

      Choose any name, but note that it should correspond to your Rancher cluster name.
    2. Environment Scope Leave the asterisk.

    3. API URL Paste the server URL that you copied from Rancher.

    4. CA Certificate can be left empty.

    5. Service Token Paste the token you took from the Rancher steps above.

    6. Uncheck RBAC-enabled cluster

    7. Uncheck GitLab-managed cluster

    8. Uncheck Namespace per environment

    9. Leave the Project namespace prefix (optional unique) empty.

  6. Click Add Kubernetes cluster.

full details kubernetes light modules
Ready for launch

The cluster is now ready for deployments.