EDIT: so, I’ve decided not to use gitlab’s integration into kubermatic, because it doesn’t work very well. For instance, it can’t find my cluster’s ip, and I think it’s easier just to do everything manually. So, if you want to test it out, use the code below, I’m just not recommending it.

Create your cluster following kubermatic’s instructions. I use digital ocean. Connect to your cluster following kubermatic’s instructions (cloud.kubermatic.io -> click on you cluster, click “connect”) go to gitlab project page, Operations -> Kubernetes -> Add Kubernetes Cluster -> Add Existing Enter the following values for the variables:

Kubernetes cluster name: whatever you want API URL: $ kubectl config view | grep server | cut -f 2- -d “:”| tr -d “ “ Token: $ kubectl config view | grep token | cut -f 2- -d “:” | tr -d “ “



Project namespace: default, unless you changed it. For example, you could run prod and staging environments like I did.

5. Add the gitlab cluster role:

cat > /tmp/gitlab-role.yml <<EOF

apiVersion: v1

kind: Namespace

metadata:

name: gitlab-managed-apps

---

apiVersion: rbac.authorization.k8s.io/v1beta1

kind: ClusterRoleBinding

metadata:

name: gitlab-cluster-role

roleRef:

apiGroup: rbac.authorization.k8s.io

kind: ClusterRole

name: cluster-admin

subjects:

- kind: ServiceAccount

name: default

namespace: gitlab-managed-apps

EOF

kubectl create -f /tmp/gitlab-role.yml

It should be working