k3d-io / k3d

Little helper to run CNCF's k3s in Docker
https://k3d.io/
MIT License
5.35k stars 456 forks source link

[BUG] Calico not starting correctly: no space left on device #1011

Open izorster opened 2 years ago

izorster commented 2 years ago

What did you do

helm repo add

helm repo update

helm upgrade --install -n "namespace" "releasename" "chartlocation" --wait --timeout 10m

What did you expect to happen

The cluster and application pods to come up/stay up.

Screenshots or terminal output

If applicable, add screenshots or terminal output (code block) to help explain your problem.

In the calico-kube-controllers pod events:

Warning FailedMount 50s kubelet (combined from similar events): MountVolume.SetUp failed for volume "kube-api-access-q6jh6" : write /var/lib/kubelet/pods/6ad5f79e-4f7a- │ │ 43ce-a01d-1770fbadd14d/volumes/kubernetes.io~projected/kube-api-access-q6jh6/..2022_03_09_15_56_14.518548044/token: no space left on device

Which OS & Architecture

MacOS 12

Which version of k3d

5.3.0

Which version of docker

Client:
 Cloud integration: v1.0.22
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.16.12
 Git commit:        e91ed57
 Built:             Mon Dec 13 11:46:56 2021
 OS/Arch:           darwin/amd64
 Context:           default
 Experimental:      true

Server: Docker Desktop 4.5.0 (74594)
 Engine:
  Version:          20.10.12
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.12
  Git commit:       459d0df
  Built:            Mon Dec 13 11:43:56 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.7.1)
  compose: Docker Compose (Docker Inc., v2.2.3)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 3
 Server Version: 20.10.12
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc version: v1.0.2-0-g52b36a2
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.10.76-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 11.7GiB
 Name: docker-desktop
 ID: EOEP:CV6C:YE5Z:3ZKW:4WXW:K7IL:ZWIN:I6NM:CJVD:TQSN:OSIE:FJZS
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false
iwilltry42 commented 2 years ago

Hi @izorster , thanks for opening this issue! Does this only happen with Calico or also with any other deployment? EDIT: I only ever saw a similar log here: https://k3d.io/v5.3.0/faq/faq/#spurious-pid-entries-in-proc-after-deleting-k3d-cluster-with-shared-mounts

izorster commented 2 years ago

Only happens with calico cube controller of the calico deployment and only on MacOS:

On Mar 22, 2022, at 12:26 PM, Thorsten Klein @.***> wrote:

Hi @izorster https://github.com/izorster , thanks for opening this issue! Does this only happen with Calico or also with any other deployment?

— Reply to this email directly, view it on GitHub https://github.com/k3d-io/k3d/issues/1011#issuecomment-1075360407, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUNYZM6NDLR2PKMGEVONA4LVBHYEDANCNFSM5QN535ZA. You are receiving this because you were mentioned.

iwilltry42 commented 2 years ago

Maybe it's related to inotify limits in the Docker VM of DfD. See e.g. https://github.com/kubernetes-sigs/kind/issues/2475 which points to https://kind.sigs.k8s.io/docs/user/known-issues/#pod-errors-due-to-too-many-open-files Or in general for DfD: https://jhooq.com/docker-error-no-space-left/

izorster commented 2 years ago

I read through and tried some of this…the first link didn’t seem to be the same issue. The link it points to states to increase params on linux-like os (I assume the pods, etc.) which after docker exec-ing in, set, killed off pod to restart resulted in the same issue. The third one is irrelevant as I am using Docker desktop and have allocated 12G of ram and 80G of storage space. I found nowhere to change I-notify for MacOS…

Thanks

On Mar 23, 2022, at 12:08 PM, Thorsten Klein @.***> wrote:

Maybe it's related to inotify limits in the Docker VM of DfD. See e.g. kubernetes-sigs/kind#2475 https://github.com/kubernetes-sigs/kind/issues/2475 which points to https://kind.sigs.k8s.io/docs/user/known-issues/#pod-errors-due-to-too-many-open-files https://kind.sigs.k8s.io/docs/user/known-issues/#pod-errors-due-to-too-many-open-files Or in general for DfD: https://jhooq.com/docker-error-no-space-left/ https://jhooq.com/docker-error-no-space-left/ — Reply to this email directly, view it on GitHub https://github.com/k3d-io/k3d/issues/1011#issuecomment-1076518678, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUNYZM6A4CSJCGOZNT5T2DLVBM6YBANCNFSM5QN535ZA. You are receiving this because you were mentioned.

iwilltry42 commented 2 years ago

True, but you're on Mac.. Docker for Desktop uses a Linux VM under the hood and you can tweak that VM's options as well using a privileged pod: https://stackoverflow.com/questions/39739560/how-to-access-the-vm-created-by-dockers-hyperkit/60582083#60582083

Again: This is trial and error. In any case, it was confirmed multiple times, that Calico works just fine in k3d on various systems :thinking:

izorster commented 2 years ago

The i-notify values are larger than what is suggested in the post leading me to believe that this still is not the issue:

docker-desktop:/etc/sysctl.d# grep notify * 04-inotify.conf:fs.inotify.max_user_watches = 1048576 04-inotify.conf:fs.inotify.max_user_instances = 8192

fs.inotify.max_user_watches = 524288 fs.inotify.max_user_instances = 512

On Mar 24, 2022, at 12:05 PM, Thorsten Klein @.***> wrote:

True, but you're on Mac.. Docker for Desktop uses a Linux VM under the hood and you can tweak that VM's options as well using a privileged pod: https://stackoverflow.com/questions/39739560/how-to-access-the-vm-created-by-dockers-hyperkit/60582083#60582083 https://stackoverflow.com/questions/39739560/how-to-access-the-vm-created-by-dockers-hyperkit/60582083#60582083 Again: This is trial and error. In any case, it was confirmed multiple times, that Calico works just fine in k3d on various systems 🤔

— Reply to this email directly, view it on GitHub https://github.com/k3d-io/k3d/issues/1011#issuecomment-1077790815, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUNYZM5CNH24F5K7RXEJT6DVBSHFFANCNFSM5QN535ZA. You are receiving this because you were mentioned.

iwilltry42 commented 2 years ago

Unfortunately now I'm out of ideas here. On a different hand: are you using some wrapper around k3d?

--k3d_options "--volume" "$(pwd)/calico.yaml:/var/lib/rancher/k3s/server/manifests/calico.yaml"

izorster commented 2 years ago

Yes, we have a script that invokes k3d and options are based on the parameters passed/parsed to the script.

On Mar 25, 2022, at 2:03 PM, Thorsten Klein @.***> wrote:

Unfortunately now I'm out of ideas here. On a different hand: are you using some wrapper around k3d?

--k3d_options "--volume" "$(pwd)/calico.yaml:/var/lib/rancher/k3s/server/manifests/calico.yaml"

— Reply to this email directly, view it on GitHub https://github.com/k3d-io/k3d/issues/1011#issuecomment-1079273171, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUNYZM2M5LQL24XPNHWHH4TVBX5XBANCNFSM5QN535ZA. You are receiving this because you were mentioned.