carlaKC / attackathon

utilities and instructions to run a lightning jamming attackathon
0 stars 6 forks source link

error: timed out waiting for the condition on pods/rpc-0 #29

Closed ellemouton closed 4 months ago

ellemouton commented 4 months ago

Hey ya'll: kubernetes noob here 🤓

Was just following along with the setup steps - got to part where you run the start_warnet.sh script but I ran into this error:

+ kubectl wait --for=condition=Ready --timeout=2m pod rpc-0
error: timed out waiting for the condition on pods/rpc-0
error: Recipe `start` failed with exit code 1
Port forwarding from kubernetes to warnet cluster for warcli (don't close this!)
kubectl port-forward svc/rpc 9276:9276
error: unable to forward port because pod is not running. Current status=Pending
error: Recipe `p` failed on line 84 with exit code 1

Other info outputs:

$ kubectl get pods

NAME    READY   STATUS              RESTARTS   AGE
rpc-0   0/1     ContainerCreating   0          13m
$ kubectl describe pod rpc-0

Name:           rpc-0
Namespace:      warnet
Priority:       0
Node:           docker-desktop/192.168.65.4
Start Time:     Fri, 12 Apr 2024 13:33:33 +0200
Labels:         controller-revision-hash=rpc-77f758bbb5
                io.kompose.service=rpc
                statefulset.kubernetes.io/pod-name=rpc-0
Annotations:    <none>
Status:         Pending
IP:
IPs:            <none>
Controlled By:  StatefulSet/rpc
Containers:
  warnet-rpc:
    Container ID:
    Image:          bitcoindevproject/warnet-rpc:latest
    Image ID:
    Port:           9276/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Liveness:       exec [/bin/bash -c /root/warnet/src/templates/rpc/livenessProbe.sh] delay=20s timeout=1s period=5s #success=1 #failure=3
    Readiness:      http-get http://:9276/-/healthy delay=1s timeout=2s period=2s #success=1 #failure=2
    Environment:    <none>
    Mounts:
      /root/warnet from source-code (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-2n7k5 (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  source-code:
    Type:          HostPath (bare host directory volume)
    Path:          /mnt/src
    HostPathType:  Directory
  kube-api-access-2n7k5:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason       Age                 From               Message
  ----     ------       ----                ----               -------
  Normal   Scheduled    13m                 default-scheduler  Successfully assigned warnet/rpc-0 to docker-desktop
  Warning  FailedMount  81s (x14 over 13m)  kubelet            MountVolume.SetUp failed for volume "source-code" : hostPath type check failed: /mnt/src is not a directory
  Warning  FailedMount  12s (x6 over 11m)   kubelet            Unable to attach or mount volumes: unmounted volumes=[source-code], unattached volumes=[source-code kube-api-access-2n7k5]: timed out waiting for the condition

From the above, the thing that stands out is:

  Warning  FailedMount  81s (x14 over 13m)  kubelet            MountVolume.SetUp failed for volume "source-code" : hostPath type check failed: /mnt/src is not a directory

Looks like it is expecting my local machine (host) to have a /mnt/src directory to mount to?

ellemouton commented 4 months ago

found the issue:

this part of the start_warnet script was choosing the wrong branch and was trying to do Minikube things 🤓

if grep -q "Context:.*desktop" <<< "$docker_info"; then
    echo "Starting warnet for docker desktop."
    just startd
else
    echo "Starting warnet for docker."
    just start
fi
carlaKC commented 4 months ago

Addressed in #30 ❤️‍🔥