Deploying GitLab Runners on GCP

I am attempting to use GitLab runners on Google Cloud Platform (GCP). I have been following this guide to get them running on Kubernetes: Tutorial: Configure GitLab Runner to use the Google Kubernetes Engine | GitLab

I get stuck on the fourth step when attempting to use the cert-manager. When I apply it I see the following:

Error from server (BadRequest): error when creating “certificate-issuer-install.yaml”: Namespace in version “v1” cannot be handled as a Namespace: strict decoding error: unknown field “labels”, unknown field “name”
Error from server (BadRequest): error when creating “certificate-issuer-install.yaml”: Certificate in version “v1” cannot be handled as a Certificate: strict decoding error: unknown field “dnsNames”, unknown field “issuerRef”, unknown field “name”, unknown field “namespace”, unknown field “secretName”
Error from server (BadRequest): error when creating “certificate-issuer-install.yaml”: Issuer in version “v1” cannot be handled as a Issuer: strict decoding error: unknown field “name”, unknown field “namespace”, unknown field “selfSigned”

Does anyone know how to fix this?

same problem here, did you find a solution ?

edit: found out why it didn’t work, in case someone else ends here:

if you copy / paste the tutorial in your cloud console, the formating of the yaml files will not be correct, you need to indent your file like this:

kind: Namespace
metadata:
  labels:
    app.kubernetes.io/component: controller-manager
    app.kubernetes.io/managed-by: olm
    app.kubernetes.io/name: gitlab-runner-operator
  name: gitlab-runner-system
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: gitlab-runner-serving-cert
  namespace: gitlab-runner-system
spec:
  dnsNames:
  - gitlab-runner-webhook-service.gitlab-runner-system.svc
  - gitlab-runner-webhook-service.gitlab-runner-system.svc.cluster.local
  issuerRef:
    kind: Issuer
    name: gitlab-runner-selfsigned-issuer
  secretName: webhook-server-cert
---
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
  name: gitlab-runner-selfsigned-issuer
  namespace: gitlab-runner-system
spec:
  selfSigned: {}

you’ll encounter the same problems for the rest of the tutorial, just open the file you created in the editor and check the indentation to fix it