1
votes

Does anyone successfully setup kubernetes executor/runner on gitlab for CI jobs? I set up mine but its stucking on executing my pipeline indefinitely.

I'm running a runner as a docker container on top of kubernetes cluster and connecting to my gitlab instance for handling my CI builds.

Any working config file would be appreciated.

My runner configuration looks like this:

[[runners]]
  name = "kube-executor"
  url = "https://gitlab.example.ltd/"
  token = "some-token"
  executor = "kubernetes"
  [runners.cache]
  [runners.kubernetes]
    host = "https://my-kubernetes-api-address:443"
    ca_file = "/etc/ssl/certs/ca.crt"
    cert_file = "/etc/ssl/certs/server.crt"
    key_file = "/etc/ssl/certs/server.key"
    image = "docker:latest"
    namespace = "gitlab"
    namespace_overwrite_allowed = "ci-.*"
    privileged = true
    cpu_limit = "1"
    memory_limit = "1Gi"
    service_cpu_limit = "1"
    service_memory_limit = "1Gi"
    helper_cpu_limit = "500m"
    helper_memory_limit = "100Mi"
    poll_interval = 5
    poll_timeout = 3600
    [runners.kubernetes.volumes]

this throws this error: ERROR: Job failed (system failure): Post https://my-kubernetes-api-address:443/api/v1/namespaces/gitlab/secrets: x509: certificate signed by unknown authority

1
What is your config so far? Please be more specific with what you have done already and what the error is.adebasi
concurrent = 1 check_interval = 0 [[runners]] name = "kubernetes" url = "gitlab.repo.ltd" token = "my-token-" executor = "kubernetes" [runners.cache] [runners.kubernetes] host = "my-kubernetes-api-address.ltd" --tls-cert-file = "/etc/ssl/certs/server.crt" --tls-private-key-file = "/etc/ssl/certs/server.key" --client-ca-file = "/etc/ssl/certs/ca.crt" image = "docker:latest" namespace = "ci" namespace_overwrite_allowed = "ci-.*" privileged = true [runners.kubernetes.volumes]Buba Conteh
this is the config I have in my /etc/gitlab-runner/config.tomlBuba Conteh
This is the error I'm getting back ERROR: Job failed (system failure): Post https://"my-kubernetes-api-address.ltd/api/v1/namespaces/ci/secrets: x509: certificate signed by unknown authority @adebasiBuba Conteh
Please edit your question and put those information there to improve readability.adebasi

1 Answers

0
votes

you are using https, so where are the certs, are they self signed certs? if yes you have to mention --tls-cert-file and --tls-private-key-file flags in your configmap.

Copied from https://stackoverflow.com/a/43362697/432115