SumoLogic/sumologic-kubernetes-tools

Template can be flakey

Closed this issue · 3 comments

Sometimes, the template function is a bit flakey. Reruns seem to work. For example, I ran this command the following:

kubectl run tools --generator=run-pod/v1 -it --rm   --restart=Never  --image sumologic/kubernetes-tools:master -- template --namespace 'sumologic' --name-template 'collection' --set sumologic.accessId=REDACTED --set sumologic.accessKey= REDACTED --set sumologic.clusterName=frank-eks --set falco.enabled=true --set image.tag=1.1.0-beta.2 --version=1.1.0-beta.2 > non-helm.yaml

Which produced the following output:

Flag --generator has been deprecated, has no effect and will be removed in the future.
If you don't see a command prompt, try pressing enter.
Error attaching, falling back to logs: Internal error occurred: error attaching to container: container not running (ebb38b841b6a0e44cdc00447edc304f43bf300ee4e4186e1db0f87ed9773f827)

I re ran the same command immediately after and it worked...

Is it reproducible? (I see it first time)
Maybe the error occurs if image is not present in the k8s yet

Yup. Happens for me after k8s image is pulled. Was happening on and off on Friday.

As we are going to use pod template, I will set kubectl to wait for pod to be Ready:

  # Wait for the pod "busybox1" to contain the status condition of type "Ready".
  kubectl wait --for=condition=Ready pod/busybox1