The ability to use Gitlab in the v2.x Pipeline seems like a fairly common request. There’s a feature request under Ability to use GitLab in Pipeline #12608, so hopefully that will happen at some point. Until that fine day, what about the other way around? On Gitlab’s end there’s also an option for connecting GitLab with a Kubernetes cluster.
I’ve messed around with it a little bit, but keep getting 404s on the Gitlab end when trying to connect. It seems to be connecting to Rancher when I make a key in https://rancher.example.com/apikeys. I have a feeling I’m not using the right endpoint in API URL. It probably needs to come from the cluster or the project namespace rather than Global, but I’m not sure which to grab, and none I’ve tried yet have worked.
Anyone able to get this working and willing to help map the Rancher 2.0 UI to this info to Gitlab?
I haven’t gotten very far with this yet. My use-case was to try to get Discourse into a pipeline. They (Discourse devs) recommend building the image in Ubuntu, then pushing. Unfortunately, deploying Ubuntu in the Gitlab pipeline with the Ubuntu Docker image limits the Docker storage driver to VFS, and AUFS or Overlay2 are needed for the Discourse build.
I’m considering adding Terraform to the mix (there’s a .gitlab-ci.yml for Terraform template in Gitlab, and a Deploying Discourse with Terraform example) to spin up a Digital Ocean Ubuntu droplet to do the build, then pushing the image back to Gitlab. But all of this is somewhat specific to Discourse so I haven’t been reporting details to this thread. That said, there does seem to be some interest in the general concept, and I hope others will add what they learn. I’ll report back if I get something working.
I don’t have much to add here except that I’m seeing the same thing. I’m brand new to Rancher and just set up a 2.0.4 server, and I’m trying to integrate a project on my GitLab 10.8.4 server with it, and I get the same “Kubernetes error: failed to find schema api” error.
Thank you very much. I have tested your approach and it seams to work except that I get an issue with our cooperate proxy. Since gitlab creates the pods in the rancher cluster there is no way to add the proxy during deployment. I found a very nice way using Kubernetes PodPreset. Is there a way to enable PodPreset somehow. Can you please have a look into my second request: How set additional flags to the kubernetes cluster?