The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

347175 (6) [Avatar] Offline
#1
5.6.2 Discovering pods through DNS: kubectl run dnsutils => STATUS=CrashLoopBackOff

 ??   >kubectl run dnsutils --image=tutum/dnsutils --generator=run-pod/v1 \ --command -- sleep infinity
pod "dnsutils" created

 ??   >kubectl get po
NAME                         READY     STATUS             RESTARTS   AGE
dnsutils                     0/1       CrashLoopBackOff   1          50s

 ??   >kubectl describe po dnsutils
Name:		dnsutils
Namespace:	default
Node:		gke-example-cluster-default-pool-810cbce1-d4j1/10.128.0.13
Start Time:	Tue, 26 Sep 2017 13:57:58 -0700
Labels:		run=dnsutils
Annotations:	kubernetes.io/limit-ranger=LimitRanger plugin set: cpu request for container dnsutils
Status:		Running
IP:		10.8.1.11
Containers:
  dnsutils:
    Container ID:	docker://45e1d2674cc16a4c82f8bc692853443174df0515d0a37b50e73a568b14679162
    Image:		tutum/dnsutils
    Image ID:		docker-pullable://tutum/dnsutils@sha256:d2244ad47219529f1003bd1513f5c99e71655353a3a63624ea9cb19f8393d5fe
    Port:		<none>
    Args:
       --command
      sleep
      infinity
    State:	Waiting
      Reason:	CrashLoopBackOff
    Last State:	Terminated
      Reason:	ContainerCannotRun
      Message:	oci runtime error: container_linux.go:247: starting container process caused "exec: \" --command\": executable file not found in $PATH"

      Exit Code:	127
      Started:		Tue, 26 Sep 2017 13:58:43 -0700
      Finished:		Tue, 26 Sep 2017 13:58:43 -0700
    Ready:		False
    Restart Count:	2
    Requests:
      cpu:		100m
    Environment:	<none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-6gshd (ro)
Conditions:
  Type		Status
  Initialized 	True 
  Ready 	False 
  PodScheduled 	True 
Volumes:
  default-token-6gshd:
    Type:	Secret (a volume populated by a Secret)
    SecretName:	default-token-6gshd
    Optional:	false
QoS Class:	Burstable
Node-Selectors:	<none>
Tolerations:	node.alpha.kubernetes.io/notReady:NoExecute for 300s
		node.alpha.kubernetes.io/unreachable:NoExecute for 300s
Events:
  FirstSeen	LastSeen	Count	From							SubObjectPath			Type		Reason		Message
  ---------	--------	-----	----							-------------			--------	------		-------
  1m		1m		1	default-scheduler									Normal		Scheduled	Successfully assigned dnsutils to gke-example-cluster-default-pool-810cbce1-d4j1
  1m		1m		1	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1	spec.containers{dnsutils}	Normal		Pulling		pulling image "tutum/dnsutils"
  49s		49s		1	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1	spec.containers{dnsutils}	Normal		Pulled		Successfully pulled image "tutum/dnsutils"
  49s		49s		1	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1	spec.containers{dnsutils}	Normal		Created		Created container with id 2d5b4b413dcdab41601111e36204ea647d3b394b86937338bd449f2619c64723
  49s		49s		1	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1	spec.containers{dnsutils}	Warning		Failed		Failed to start container with id 2d5b4b413dcdab41601111e36204ea647d3b394b86937338bd449f2619c64723 with error: rpc error: code = 2 desc = failed to start container "2d5b4b413dcdab41601111e36204ea647d3b394b86937338bd449f2619c64723": Error response from daemon: {"message":"oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\" --command\\\": executable file not found in $PATH\"\n"}
  49s		49s		1	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1					Warning		FailedSync	Error syncing pod, skipping: failed to "StartContainer" for "dnsutils" with rpc error: code = 2 desc = failed to start container "2d5b4b413dcdab41601111e36204ea647d3b394b86937338bd449f2619c64723": Error response from daemon: {"message":"oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\" --command\\\": executable file not found in $PATH\"\n"}: "Start Container Failed"

  47s	47s	1	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1	spec.containers{dnsutils}	Warning	Failed		Failed to start container with id 9fe022cd50dd1433ba05546e7c451e33181101b97778060ad0dac5528833123d with error: rpc error: code = 2 desc = failed to start container "9fe022cd50dd1433ba05546e7c451e33181101b97778060ad0dac5528833123d": Error response from daemon: {"message":"oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\" --command\\\": executable file not found in $PATH\"\n"}
  47s	47s	1	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1	spec.containers{dnsutils}	Normal	Created		Created container with id 9fe022cd50dd1433ba05546e7c451e33181101b97778060ad0dac5528833123d
  47s	47s	1	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1					Warning	FailedSync	Error syncing pod, skipping: failed to "StartContainer" for "dnsutils" with rpc error: code = 2 desc = failed to start container "9fe022cd50dd1433ba05546e7c451e33181101b97778060ad0dac5528833123d": Error response from daemon: {"message":"oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\" --command\\\": executable file not found in $PATH\"\n"}: "Start Container Failed"

  46s	46s	1	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1		Warning	FailedSync	Error syncing pod, skipping: failed to "StartContainer" for "dnsutils" with CrashLoopBackOff: "Back-off 10s restarting failed container=dnsutils pod=dnsutils_default(608ea5c5-a2fd-11e7-89c4-42010a800182)"

  34s	34s	1	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1	spec.containers{dnsutils}	Normal	Created		Created container with id 45e1d2674cc16a4c82f8bc692853443174df0515d0a37b50e73a568b14679162
  34s	34s	1	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1	spec.containers{dnsutils}	Warning	Failed		Failed to start container with id 45e1d2674cc16a4c82f8bc692853443174df0515d0a37b50e73a568b14679162 with error: rpc error: code = 2 desc = failed to start container "45e1d2674cc16a4c82f8bc692853443174df0515d0a37b50e73a568b14679162": Error response from daemon: {"message":"oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\" --command\\\": executable file not found in $PATH\"\n"}
  34s	34s	1	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1					Warning	FailedSync	Error syncing pod, skipping: failed to "StartContainer" for "dnsutils" with rpc error: code = 2 desc = failed to start container "45e1d2674cc16a4c82f8bc692853443174df0515d0a37b50e73a568b14679162": Error response from daemon: {"message":"oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\" --command\\\": executable file not found in $PATH\"\n"}: "Start Container Failed"

  19s	19s	1	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1		Warning	FailedSync	Error syncing pod, skipping: failed to "StartContainer" for "dnsutils" with CrashLoopBackOff: "Back-off 20s restarting failed container=dnsutils pod=dnsutils_default(608ea5c5-a2fd-11e7-89c4-42010a800182)"

  46s	19s	2	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1	spec.containers{dnsutils}	Warning	BackOff		Back-off restarting failed container
  48s	6s	3	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1	spec.containers{dnsutils}	Normal	Pulled		Container image "tutum/dnsutils" already present on machine
  5s	5s	1	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1	spec.containers{dnsutils}	Normal	Created		Created container with id 49b334eae062263eb4eafa7c9851ce41c9981c5adfd96f25205e4ac5076e5847
  5s	5s	1	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1	spec.containers{dnsutils}	Warning	Failed		Failed to start container with id 49b334eae062263eb4eafa7c9851ce41c9981c5adfd96f25205e4ac5076e5847 with error: rpc error: code = 2 desc = failed to start container "49b334eae062263eb4eafa7c9851ce41c9981c5adfd96f25205e4ac5076e5847": Error response from daemon: {"message":"oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\" --command\\\": executable file not found in $PATH\"\n"}
  5s	5s	1	kubelet, gke-example-cluster-default-pool-810cbce1-d4j1					Warning	FailedSync	Error syncing pod, skipping: failed to "StartContainer" for "dnsutils" with rpc error: code = 2 desc = failed to start container "49b334eae062263eb4eafa7c9851ce41c9981c5adfd96f25205e4ac5076e5847": Error response from daemon: {"message":"oci runtime error: container_linux.go:247: starting container process caused \"exec: \\\" --command\\\": executable file not found in $PATH\"\n"}: "Start Container Failed"
Marko Lukša (70) [Avatar] Offline
#2
5.6.2 Discovering pods through DNS: kubectl run dnsutils =&gt; STATUS=CrashLoopBackOff
The problem is in the backslash (\). You either need to add a newline after it, or simply skip the backslash if you're typing the whole command in a single line.