educative.io

Educative

Error while creating the pod for go-demo-2

Hi I am unable to create pods or replica sets while running descriptively the go-demo-2-*.yaml files from the github repository. attaching logs from the local minikube cluster, sys specs: MacOSx, arm64 arch M1 chip

output for logs

Defaulted container "db" out of: db, api
runtime: failed to create new OS thread (have 2 already; errno=22)
fatal error: newosproc

runtime stack:
runtime.throw(0x524da0, 0x9)
	/usr/local/go/src/runtime/panic.go:527 +0x90
runtime.newosproc(0xc82002c000, 0xc82003bfc0)
	/usr/local/go/src/runtime/os1_linux.go:150 +0x1ab
runtime.newm(0x555ce8, 0x0)
	/usr/local/go/src/runtime/proc1.go:1105 +0x130
runtime.main.func1()
	/usr/local/go/src/runtime/proc.go:48 +0x2c
runtime.systemstack(0x5c4300)
	/usr/local/go/src/runtime/asm_amd64.s:262 +0x79
runtime.mstart()
	/usr/local/go/src/runtime/proc1.go:674

goroutine 1 [running]:
runtime.systemstack_switch()
	/usr/local/go/src/runtime/asm_amd64.s:216 fp=0xc820026770 sp=0xc820026768
runtime.main()
	/usr/local/go/src/runtime/proc.go:49 +0x62 fp=0xc8200267c0 sp=0xc820026770
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:1696 +0x1 fp=0xc8200267c8 sp=0xc8200267c0

output for describe

Name:         go-demo-2
Namespace:    default
Priority:     0
Node:         minikube/192.168.49.2
Start Time:   Tue, 17 May 2022 17:43:11 +0530
Labels:       type=stack
Annotations:  <none>
Status:       Running
IP:           172.17.0.3
IPs:
  IP:  172.17.0.3
Containers:
  db:
    Container ID:   docker://702ed25b0b730bf895191db95b403ddd9a592cc57aa70dab98241b1c8cf6f962
    Image:          mongo:3.3
    Image ID:       docker-pullable://mongo@sha256:08a90c3d7c40aca81f234f0b2aaeed0254054b1c6705087b10da1c1901d07b5d
    Port:           <none>
    Host Port:      <none>
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    2
      Started:      Tue, 17 May 2022 17:44:40 +0530
      Finished:     Tue, 17 May 2022 17:44:40 +0530
    Ready:          False
    Restart Count:  4
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-7fpjd (ro)
  api:
    Container ID:   docker://ca8818c4d3693884f6413649eb071fa3cd7aaa4adbf7cb7907e02b60746bebcd
    Image:          vfarcic/go-demo-2
    Image ID:       docker-pullable://vfarcic/go-demo-2@sha256:4af87aa5e69f4f18aa2204abb054845d525d9512f464811d58d6766f5a6ab1a3
    Port:           <none>
    Host Port:      <none>
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    2
      Started:      Tue, 17 May 2022 17:44:43 +0530
      Finished:     Tue, 17 May 2022 17:44:55 +0530
    Ready:          False
    Restart Count:  3
    Environment:
      DB:  localhost
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-7fpjd (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  kube-api-access-7fpjd:
    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  2m14s                 default-scheduler  Successfully assigned default/go-demo-2 to minikube
  Normal   Pulled     2m10s                 kubelet            Successfully pulled image "vfarcic/go-demo-2" in 3.037850919s
  Normal   Started    118s (x3 over 2m13s)  kubelet            Started container db
  Normal   Pulling    118s (x2 over 2m13s)  kubelet            Pulling image "vfarcic/go-demo-2"
  Normal   Started    114s (x2 over 2m10s)  kubelet            Started container api
  Normal   Created    114s (x2 over 2m10s)  kubelet            Created container api
  Normal   Pulled     114s                  kubelet            Successfully pulled image "vfarcic/go-demo-2" in 3.270987501s
  Warning  BackOff    102s (x5 over 2m9s)   kubelet            Back-off restarting failed container
  Warning  BackOff    102s                  kubelet            Back-off restarting failed container
  Normal   Pulled     90s (x4 over 2m13s)   kubelet            Container image "mongo:3.3" already present on machine
  Normal   Created    90s (x4 over 2m13s)   kubelet            Created container db