1 year ago
#361068
przems
Any way to make GitLab K8s Agent work with a cluster with Windows nodes and Flannel networking?
So my new task at work involves setting up a Kubernetes cluster with Windows nodes for GitLab CI/CD on a .NET Framework project. I’ve never done anything with Kubernetes, so this week has been quite a journey, and now I can’t manage to get my cluster to run the GitLab agent and connect to the GitLab instance.
My guess is that it’s because the “Adding windows nodes” guide told me to use Flannel, but GitLab Agent is trying to use cni net.d? Is this the problem? Is there a way to fix this, or maybe a simpler way to do all of this?
Thanks in advance.
I’ve managed to set up a control-plane node on Ubuntu 20.04, add some Ubuntu and Windows worker nodes, but I got stuck with setting up the GitLab Agent (connecting the cluster and GitLab instance). I’ve used this tutorial for setting up the cluster, except I changed the Flannel install step with the patched version from this documentation page. The latter page is what I used to add the Windows nodes to the cluster.
So I’m trying to install the GitLab K8s agent using this page. The GitLab test server is a Docker Omnibus install on a separate server with Ubuntu. I’m trying to use the one-liner method since I don’t understand the advanced methods, but after I run the one-liner my GitLab Agent pod gets stuck in an ImagePullBackOff.
Here’s the looped output of “journalctl -xeu kubelet” on the control node:
`Mar 31 12:30:37 k8s-ctrl-ubu1 kubelet[4594]: I0331 12:30:37.208235 4594 cni.go:240] "Unable to update cni config" err="no networks found in /etc/cni/net.d"
Mar 31 12:30:40 k8s-ctrl-ubu1 kubelet[4594]: E0331 12:30:40.052911 4594 kubelet.go:2347] "Container runtime network not ready" networkReady="NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized"
Mar 31 12:30:42 k8s-ctrl-ubu1 kubelet[4594]: I0331 12:30:42.208568 4594 cni.go:240] "Unable to update cni config" err="no networks found in /etc/cni/net.d"
Mar 31 12:30:45 k8s-ctrl-ubu1 kubelet[4594]: E0331 12:30:45.061648 4594 kubelet.go:2347] "Container runtime network not ready" networkReady="NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized"
Mar 31 12:30:47 k8s-ctrl-ubu1 kubelet[4594]: I0331 12:30:47.208848 4594 cni.go:240] "Unable to update cni config" err="no networks found in /etc/cni/net.d"
Mar 31 12:30:50 k8s-ctrl-ubu1 kubelet[4594]: E0331 12:30:50.070691 4594 kubelet.go:2347] "Container runtime network not ready" networkReady="NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized"
Mar 31 12:30:52 k8s-ctrl-ubu1 kubelet[4594]: I0331 12:30:52.209618 4594 cni.go:240] "Unable to update cni config" err="no networks found in /etc/cni/net.d"`
Here’s the output of “kubectl describe pod” on the gitlab-kubernetes-agent pod:
`Events:
Type Reason Age From Message
Normal Scheduled 5m28s default-scheduler Successfully assigned gitlab-kubernetes-agent/gitlab-agent-6bb8c4f4d5-wc64z to k8s-win5
Normal Pulling 4m1s (x4 over 5m27s) kubelet Pulling image "registry.gitlab.com/gitlab-org/cluster-integration/gitlab-agent/agentk:stable"
Warning Failed 4m (x4 over 5m25s) kubelet Error: ErrImagePull
Normal BackOff 20s (x19 over 5m24s) kubelet Back-off pulling image "registry.gitlab.com/gitlab-org/cluster-integration/gitlab-agent/agentk:stable"`
docker
kubernetes
gitlab
gitlab-ci
flannel
0 Answers
Your Answer