How to ssh into a Traefik pod?

3/12/2019

I am using GKE. I've launched the following traefik deployment through kubectl:

https://github.com/containous/traefik/blob/master/examples/k8s/traefik-deployment.yaml

The pod runs on the kube-system namespace. I'm not able to ssh into the pod.

kubectl get po -n kube-system traefik-ingress-controller-5bf599f65d-fl9gx 1/1 Running 0 30m

kubectl exec -it traefik-ingress-controller-5bf599f65d-fl9gx -n kube-system -- '\bin\bash' rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"\\\\bin\\\\bash\": executable file not found in $PATH" command terminated with exit code 126

Am I missing something? The same thing for '-- sh' too.

-- Sharath Kumar
google-kubernetes-engine
kubernetes
traefik

2 Answers

3/12/2019

rather use forward slashed / (your example has a backslash) such as in

kubectl exec -it traefik-ingress-controller-5bf599f65d-fl9gx -n kube-system -- '/bin/bash'

If this does still not work, try a different shell such as

kubectl exec -it traefik-ingress-controller-5bf599f65d-fl9gx -n kube-system -- '/bin/sh'
-- Andre Albert
Source: StackOverflow

3/18/2019

So, apparently the default traefik image is an amd64 version. I had to use the alpine version to ssh into it using: kubectl exec -it _podname_ -- sh

-- Sharath Kumar
Source: StackOverflow