kubernetes 升级的gitlab runner抛出'服务负载均衡器外部地址尚不可用'

0s7z1bwu  于 2023-01-08  发布在  Kubernetes
关注(0)|答案(2)|浏览(90)

我正在运行一个kubernetes单节点集群,并使用helm chart将我的gitlab14.3.2升级到14.7.0。这是我的values.yaml文件,之前运行得很完美...

global:
  edition: ce
  hosts:
    domain: domain.com
  shell:
    port: 30022
  rails:
    bootsnap:
      enabled: false
  ingress:
    class: nginx
    configureCertmanager: false
    annotations:
      cert-manager.io/cluster-issuer: letsencrypt-prod
      acme.cert-manager.io/http01-edit-in-place: "true"
certmanager:
  install: false
nginx-ingress:
  enabled: false
prometheus:
  install: false
redis:
  resources:
    requests:
      cpu: 10m
      memory: 64Mi
minio:
  ingress:
    tls:
      secretName: gitlab-minio-tls
  resources:
    requests:
      memory: 64Mi
      cpu: 10m
gitlab-runner:
  runners:
    privileged: false
gitlab:
  gitaly:
    persistence:
      size: 2Gi
  gitlab-shell:
    minReplicas: 1
    service:
      type: NodePort
      nodePort: 30022
  webservice:
    minReplicas: 1
    ingress:
      tls:
        secretName: gitlab-webservice-tls
  sidekiq:
    minReplicas: 1
  toolbox:
    enabled: false
registry:
  hpa:
    minReplicas: 1
  ingress:
    tls:
      secretName: gitlab-registry-tls

...但是新的gitlab runner pod失败了。在日志中我确实看到了错误

gitlab-gitlab-runner Service LoadBalancer External Address not yet available

values.yaml文件中缺少了什么?因为我运行的是单节点群集,所以我没有负载平衡器。所以我不明白错误消息。

hgqdbh6s

hgqdbh6s1#

得到了同样的问题。我发现一个服务配置错误,查找图表,发现它是关于会话服务器的。
然后我简单地禁用了sessionServer,默认情况下应该禁用它(cf https://gitlab.com/gitlab-org/charts/gitlab-runner/-/commit/477f145bedcb68690d723826831d9c8c4f5b2d09),我不需要它,它起到了作用。

gitlab-runner:
  sessionServer:
    enabled: false

如果你需要的话,我认为你必须设置一些配置,比如PublicIp,下面是here的默认值:

## Specify whether the runner should start the session server.
## Defaults to false
## ref: 
##
## When sessionServer is enabled, the user can either provide a public publicIP 
## or either rely on the external IP auto discovery
## When a serviceAccountName is used with the automounting to the pod disable,
## we recommend the usage of the publicIP
sessionServer:
  enabled: true
  # timeout: 1800
  # internalPort: 8093
  # externalPort: 9000
  # publicIP: ""
icomxhvb

icomxhvb2#

您还需要设置rbac,以便runner可以实际检查服务配置和状态:https://gitlab.com/gitlab-org/charts/gitlab-runner/-/blob/main/values.yaml#L158

rbac:
  create: true
  rules:
    - resources: ["pods", "secrets", "configmaps", "services"]
      verbs: ["get", "list", "watch", "create", "patch", "update", "delete"]

相关问题