K8s KinD Cluster - CrashLoopBackOff - PersistentVolumeClaim

What I want to do

Run Dgraph on K8s KinD Cluster

What I did

Created a KinD Cluster

cat <<EOF | kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
EOF

Also tried to add extraMounts to each node:

    extraMounts:
      - hostPath: /home/parallels/kindvolume
        containerPath: /kindvolume_one

CrashLoopBackOff

kubectl describe pod dgraph-0

Name:         dgraph-0
Namespace:    default
Priority:     0
Node:         kind-worker/172.18.0.3
Start Time:   Mon, 03 Jan 2022 18:07:11 +0100
Labels:       app=dgraph
              controller-revision-hash=dgraph-6b5fb46d67
              statefulset.kubernetes.io/pod-name=dgraph-0
Annotations:  <none>
Status:       Running
IP:           10.244.1.3
IPs:
  IP:           10.244.1.3
Controlled By:  StatefulSet/dgraph
Containers:
  zero:
    Container ID:  containerd://3a5466125dd054a8dcb2711da63e7a643658276795cefa63919dfd6424e3444f
    Image:         dgraph/dgraph:latest
    Image ID:      docker.io/dgraph/dgraph@sha256:b3f8521c9a9358c468e0ff8173bc85dfd54396e36745e455b7faaeddb560d55d
    Ports:         5080/TCP, 6080/TCP
    Host Ports:    0/TCP, 0/TCP
    Command:
      bash
      -c
      set -ex
      dgraph zero --my=$(hostname -f):5080
      
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Mon, 03 Jan 2022 18:28:24 +0100
      Finished:     Mon, 03 Jan 2022 18:28:24 +0100
    Ready:          False
    Restart Count:  9
    Environment:    <none>
    Mounts:
      /dgraph from datadir (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-4kndz (ro)
  alpha:
    Container ID:  containerd://702ace89702443bb902f3a2d6e38560eaace87ddcf246368caf6141b5ff5bed1
    Image:         dgraph/dgraph:latest
    Image ID:      docker.io/dgraph/dgraph@sha256:b3f8521c9a9358c468e0ff8173bc85dfd54396e36745e455b7faaeddb560d55d
    Ports:         8080/TCP, 9080/TCP
    Host Ports:    0/TCP, 0/TCP
    Command:
      bash
      -c
      set -ex
      dgraph alpha --my=$(hostname -f):7080 --zero dgraph-0.dgraph.${POD_NAMESPACE}:5080
      
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Mon, 03 Jan 2022 18:28:24 +0100
      Finished:     Mon, 03 Jan 2022 18:28:24 +0100
    Ready:          False
    Restart Count:  9
    Environment:
      POD_NAMESPACE:  default (v1:metadata.namespace)
    Mounts:
      /dgraph from datadir (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-4kndz (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  datadir:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  datadir-dgraph-0
    ReadOnly:   false
  kube-api-access-4kndz:
    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  24m                    default-scheduler  Successfully assigned default/dgraph-0 to kind-worker
  Normal   Pulling    24m                    kubelet            Pulling image "dgraph/dgraph:latest"
  Normal   Pulled     24m                    kubelet            Successfully pulled image "dgraph/dgraph:latest" in 7.554120018s
  Normal   Created    23m (x3 over 24m)      kubelet            Created container zero
  Normal   Started    23m (x3 over 24m)      kubelet            Started container zero
  Normal   Pulled     23m (x3 over 24m)      kubelet            Container image "dgraph/dgraph:latest" already present on machine
  Normal   Created    23m (x3 over 24m)      kubelet            Created container alpha
  Normal   Started    23m (x3 over 24m)      kubelet            Started container alpha
  Normal   Pulled     23m (x2 over 24m)      kubelet            Container image "dgraph/dgraph:latest" already present on machine
  Warning  BackOff    23m (x3 over 24m)      kubelet            Back-off restarting failed container
  Warning  BackOff    4m16s (x101 over 24m)  kubelet            Back-off restarting failed container

Version

PASTE THE RESULTS OF dgraph version HERE.
Installed Kubernetes “2-Node Cluster” : Downloads – Dgraph | GraphQL Cloud Platform

What error message are you getting?

I see you’re running dgraph/dgraph:latest here. You may want to run with a specific image tag. If you were previously running, say, Dgraph v21.03 and then you’re now running Dgraph v21.12 that wouldn’t work as those are major version differences.

Thanks

I create a new KinD cluster each time I am testing and I am getting CrashLoopBackOff, see “kubectl describe pod dgraph-0” above:
kubectl get pods

NAME       READY   STATUS             RESTARTS   AGE
dgraph-0   0/2     CrashLoopBackOff   434        18h