Kubernetes执行人gitlab

时间:2017-11-03 22:24:18

标签: kubernetes gitlab gitlab-ci gitlab-ci-runner

有没有人在gitlab上为CI作业成功设置kubernetes executor / runner?我设置了我的,但它坚持无限期地执行我的管道。

我正在kubernetes集群上运行一个作为docker容器的运行器,并连接到我的gitlab实例来处理我的CI构建。

任何有效的配置文件都将受到赞赏。

我的跑步者配置如下:

[[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]

这会引发此错误:ERROR: Job failed (system failure): Post https://my-kubernetes-api-address:443/api/v1/namespaces/gitlab/secrets: x509: certificate signed by unknown authority

1 个答案:

答案 0 :(得分:0)

您使用的是https,那么证书在哪里,它们是自签名证书吗?如果是,则必须在配置图中提及--tls-cert-file--tls-private-key-file标记。

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

复制