portainer / k2d

Kubernetes to Docker translator
Other
130 stars 9 forks source link

Bind mount failed #91

Open rothgar opened 2 days ago

rothgar commented 2 days ago

I'm trying to create a pod via kubectl with this spec

apiVersion: v1
kind: Pod
metadata:
  name: nginx-pod
  labels:
    app: nginx
spec:
  containers:
  - name: nginx
    image: nginx:latest
    ports:
    - containerPort: 80
  automountServiceAccountToken: false

but when I apply it the docker container gets created but isn't running. I see this error in the k2d logs

ERROR   controller/controller.go:174    unable to create pod   {"error": "Error response from daemon: Bind mount failed: '/var/lib/k2d/secrets/k2d-k2d-serviceaccount-k2dsec-token' does not exists", "request_id": "5af66fd9-7991-4ee6-92c8-5961713f962b"}

The pod stays in an Unknown state

k get pods
NAME            READY   STATUS    RESTARTS   AGE
nginx           0/1     Unknown   0          3m13s

If I manually create an empty file in that location it continues but errors on k2d-k2d-serviceaccount-k2dsec-ca.crt not existing. I can manually create an empty file for that too but it won't continue past that error.

2024-10-16T17:49:18.840Z        ERROR   controller/controller.go:174    unable to create pod   {"error": "Error response from daemon: Bind mount failed: '/var/lib/k2d/secrets/k2d-k2d-serviceaccount-k2dsec-ca.crt' does not exists", "request_id": "737ca7ef-6aba-45fa-9e81-f9e1fc571960"}
github.com/portainer/k2d/internal/controller.(*OperationController).processOperation
        /root/workspace/k2d/internal/controller/controller.go:174 github.com/portainer/k2d/internal/controller.(*OperationController).processPriorityOper
ations
        /root/workspace/k2d/internal/controller/controller.go:165 github.com/portainer/k2d/internal/controller.(*OperationController).processOperationQueue
rothgar commented 2 days ago

Here's my docker info

Client:
 Context:    default
 Debug Mode: false

Server:
 Containers: 8
  Running: 7
  Paused: 0
  Stopped: 1
 Images: 77
 Server Version: 20.10.3
 Storage Driver: btrfs
  Build Version: Btrfs v4.0
  Library Version: 101
 Logging Driver: db
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs db 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: 3fa00912415f3e9c6f82dd72119179d599efd13b
 runc version: 31cc25f16f5eba4d0f53e35374532873744f4b31
 init version: ed96d00 (expected: de40ad0)
 Security Options:
  apparmor
 Kernel Version: 4.4.180+
 Operating System: Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.619GiB
 Name: d
 ID: LRNO:2ZLN:3LHJ:U3UI:75LT:3LOS:U3H3:Z77V:ZE6W:B3QA:SRJM:BGAP
 Docker Root Dir: /volume1/@docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No kernel memory TCP limit support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support
WARNING: No blkio weight support
WARNING: No blkio weight_device support
WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support