Docker Jenkins工作节点缺少docker组

问题描述 投票:0回答:1

使用掌舵图:https://github.com/helm/charts/tree/master/stable/jenkins

以前我在k8s集群上使用了这个图表。我最近使用相同的持久存储卷重新安装了图表。我只更改了values.yaml文件中代理的资源请求。现在,当我尝试通过管道运行部署时,主pod无法连接到它正在创建的工作器pod。我已经验证节点上有可用的空间,它们似乎没有问题。只是工作室容器的启动看起来有一些问题。最值得注意的是失踪的码头组。我不确定如何配置创建组,或者为什么这首先是一个问题?

如果让这个部署管道再次运行,我做错了什么?

覆盖图表的values.yaml:

rbac:
  install: true

Master:
  HostName: jenkins.grapenuts.flytedesk.com
  ServiceType: ClusterIP
  NodePort:
  Ingress:
    Annotations:
      kubernetes.io/ingress.class: traefik
  JavaOpts: "-Dorg.jenkinsci.plugins.durabletask.BourneShellScript.HEARTBEAT_CHECK_INTERVAL=1000"
  resources:
    requests:
      cpu: "500m"
      memory: "512Mi"
    limits:
      cpu: "2000m"
      memory: "2048Mi"
  InstallPlugins:
    - amazon-ecr:1.6
    - blueocean:1.7.1
    - kubernetes:1.12.1
    - kubernetes-cli:1.2.0
    - workflow-aggregator:2.5
    - workflow-job:2.23
    - credentials-binding:1.16
    - git:3.9.1
    - slack:2.3

Agent:
  resources:
    requests:
      cpu: "200m"
      memory: "256Mi"
    limits:
      cpu: "1000m"
      memory: "4096Mi"

Persistence:
  Enabled: true
  Size: 8Gi
  ExistingClaim: jenkins-master-pvc

从Jenkins主节点创建的Docker Worker节点中记录日志

WARN[2019-03-27T01:20:30.099307297Z] could not change group /var/run/docker.sock to docker: group docker not found 
 WARN[2019-03-27T01:20:30.099429310Z] [!] DON'T BIND ON ANY IP ADDRESS WITHOUT setting --tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING [!] 
 INFO[2019-03-27T01:20:30.111486018Z] libcontainerd: started new containerd process  pid=17
 INFO[2019-03-27T01:20:30.111603708Z] parsed scheme: "unix"                         module=grpc
 INFO[2019-03-27T01:20:30.111622892Z] scheme "unix" not registered, fallback to default scheme  module=grpc
 INFO[2019-03-27T01:20:30.117760193Z] ccResolverWrapper: sending new addresses to cc: [{unix:///var/run/docker/containerd/containerd.sock 0  <nil>}]  module=grpc
 INFO[2019-03-27T01:20:30.117825438Z] ClientConn switching balancer to "pick_first"  module=grpc
 INFO[2019-03-27T01:20:30.117931427Z] pickfirstBalancer: HandleSubConnStateChange: 0xc420740170, CONNECTING  module=grpc
 INFO[2019-03-27T01:20:30.700526951Z] starting containerd                           revision=e6b3f5632f50dbc4e9cb6288d911bf4f5e95b18e version=v1.2.4
 INFO[2019-03-27T01:20:30.701746137Z] loading plugin "io.containerd.content.v1.content"...  type=io.containerd.content.v1
 INFO[2019-03-27T01:20:30.701897179Z] loading plugin "io.containerd.snapshotter.v1.btrfs"...  type=io.containerd.snapshotter.v1
 WARN[2019-03-27T01:20:30.702171413Z] failed to load plugin io.containerd.snapshotter.v1.btrfs  error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.btrfs must be a btrfs filesystem to be used with the btrfs snapshotter"
 INFO[2019-03-27T01:20:30.702215021Z] loading plugin "io.containerd.snapshotter.v1.aufs"...  type=io.containerd.snapshotter.v1
 WARN[2019-03-27T01:20:30.712326057Z] failed to load plugin io.containerd.snapshotter.v1.aufs  error="modprobe aufs failed: "ip: can't find device 'aufs'\nmodprobe: can't change directory to '/lib/modules': No such file or directory\n": exit status 1"
 INFO[2019-03-27T01:20:30.712352225Z] loading plugin "io.containerd.snapshotter.v1.native"...  type=io.containerd.snapshotter.v1
 INFO[2019-03-27T01:20:30.712464182Z] loading plugin "io.containerd.snapshotter.v1.overlayfs"...  type=io.containerd.snapshotter.v1
 INFO[2019-03-27T01:20:30.712635973Z] loading plugin "io.containerd.snapshotter.v1.zfs"...  type=io.containerd.snapshotter.v1
 WARN[2019-03-27T01:20:30.716216413Z] failed to load plugin io.containerd.snapshotter.v1.zfs  error="path /var/lib/docker/containerd/daemon/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter"
 INFO[2019-03-27T01:20:30.716242462Z] loading plugin "io.containerd.metadata.v1.bolt"...  type=io.containerd.metadata.v1
INFO[2019-03-27T01:20:30.766699317Z] scheme "unix" not registered, fallback to default scheme  module=grpc
 INFO[2019-03-27T01:20:30.768163376Z] ccResolverWrapper: sending new addresses to cc: [{unix:///var/run/docker/containerd/containerd.sock 0  <nil>}]  module=grpc
 INFO[2019-03-27T01:20:30.768190514Z] ClientConn switching balancer to "pick_first"  module=grpc
 INFO[2019-03-27T01:20:30.768365344Z] ccResolverWrapper: sending new addresses to cc: [{unix:///var/run/docker/containerd/containerd.sock 0  <nil>}]  module=grpc
 INFO[2019-03-27T01:20:30.768639743Z] ClientConn switching balancer to "pick_first"  module=grpc
 INFO[2019-03-27T01:20:30.768644457Z] pickfirstBalancer: HandleSubConnStateChange: 0xc420740a90, CONNECTING  module=grpc
 INFO[2019-03-27T01:20:30.768760912Z] pickfirstBalancer: HandleSubConnStateChange: 0xc4207f3450, CONNECTING  module=grpc
 INFO[2019-03-27T01:20:30.769170856Z] pickfirstBalancer: HandleSubConnStateChange: 0xc420740a90, READY  module=grpc
 INFO[2019-03-27T01:20:30.769869637Z] pickfirstBalancer: HandleSubConnStateChange: 0xc4207f3450, READY  module=grpc
 INFO[2019-03-27T01:20:30.822166956Z] Graph migration to content-addressability took 0.00 seconds 
 INFO[2019-03-27T01:20:30.825122094Z] Loading containers: start.                   
 WARN[2019-03-27T01:20:30.854711776Z] Running modprobe bridge br_netfilter failed with message: ip: can't find device 'bridge'
 bridge                172032  1 br_netfilter
 stp                    16384  1 bridge
 llc                    16384  2 bridge,stp
 ipv6                  544768 497 bridge,[permanent]
 ip: can't find device 'br_netfilter'
 br_netfilter           24576  0 
 bridge                172032  1 br_netfilter
 modprobe: can't change directory to '/lib/modules': No such file or directory
 , error: exit status 1 
 WARN[2019-03-27T01:20:30.887386825Z] Running modprobe nf_nat failed with message: `ip: can't find device 'nf_nat'
 nf_nat_masquerade_ipv4    16384  1 ipt_MASQUERADE
 nf_nat_ipv4            16384  1 iptable_nat
 nf_nat                 36864  3 xt_nat,nf_nat_masquerade_ipv4,nf_nat_ipv4
 nf_conntrack          151552  8 xt_nat,ipt_MASQUERADE,nf_nat_masquerade_ipv4,nf_conntrack_netlink,nf_conntrack_ipv4,nf_nat_ipv4,xt_conntrack,nf_nat
 libcrc32c              16384  3 nf_nat,nf_conntrack,xfs
 modprobe: can't change directory to '/lib/modules': No such file or directory`, error: exit status 1 
 WARN[2019-03-27T01:20:30.895238719Z] Running modprobe xt_conntrack failed with message: `ip: can't find device 'xt_conntrack'
 xt_conntrack           16384  2 
 nf_conntrack          151552  8 xt_nat,ipt_MASQUERADE,nf_nat_masquerade_ipv4,nf_conntrack_netlink,nf_conntrack_ipv4,nf_nat_ipv4,xt_conntrack,nf_nat
 x_tables               45056 12 xt_statistic,xt_nat,xt_recent,ipt_REJECT,xt_tcpudp,xt_comment,xt_mark,ipt_MASQUERADE,xt_addrtype,iptable_filter,xt_conntrack,ip_tables
 modprobe: can't change directory to '/lib/modules': No such file or directory`, error: exit status 1 
 INFO[2019-03-27T01:20:31.093705399Z] Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address 
 INFO[2019-03-27T01:20:31.332494859Z] Loading containers: done.                    
 INFO[2019-03-27T01:20:31.470554395Z] Docker daemon                                 commit=774a1f4 graphdriver(s)=overlay2 version=18.09.3
 INFO[2019-03-27T01:20:31.470683993Z] Daemon has completed initialization          
 INFO[2019-03-27T01:20:31.485026627Z] API listen on [::]:2375                      
 INFO[2019-03-27T01:20:31.485180400Z] API listen on /var/run/docker.sock 
docker jenkins kubernetes-helm
1个回答
0
投票

我认为问题是用户jenkins无法运行docker命令。

  1. 根据https://access.redhat.com/solutions/3745881的说法,对于日志“无法将组/var/run/docker.sock更改为docker:未找到group docker”。这是信息性的消息而不是错误。
  2. 创建docker组。您可能需要将jenkins用户添加到docker组。 $ sudo groupadd docker将您的用户添加到docker组。 $ sudo usermod -aG docker $ USER https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user

https://github.com/helm/charts/tree/master/stable/jenkins中,此helm图表的默认设置允许Jenkins以uid 0的root用户身份运行。在其他情况下,Jenkins使用用户jenkins运行,uid = 1000

您可能会提供更多您遇到的错误?

© www.soinside.com 2019 - 2024. All rights reserved.