Accessing gateway-tyk-oss-tyk-gateway pod

I followed the instruction at for a quick start setup using helm chart to configure a Tyk Open Source API gateway. I got the pods up running. However when trying to access the pod gateway-tyk-oss-tyk-gateway-7dd5c9d6c6-mvqr5, I ran into the issue below:

$ kubectl -n tyk-oss get pods
NAME READY STATUS RESTARTS AGE
gateway-tyk-oss-tyk-gateway-7dd5c9d6c6-mvqr5 1/1 Running 0 22h
tyk-redis-master-0 1/1 Running 0 22h
tyk-redis-replicas-0 1/1 Running 0 22h
tyk-redis-replicas-1 1/1 Running 0 22h
tyk-redis-replicas-2 1/1 Running 0 22h

$ kubectl -n tyk-oss exec -it gateway-tyk-oss-tyk-gateway-7dd5c9d6c6-mvqr5 bash
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] – [COMMAND] instead.
Defaulted container “gateway-tyk-gateway” out of: gateway-tyk-gateway, setup-directories (init)
error: Internal error occurred: error executing command in container: Internal error occurred: error executing command in container: Internal error occurred: error executing command in container: failed to exec in container: failed to start exec “3ae6fb9ab27c5f8328b10b71102bcf5519a667de94799956d96f54c751e91fc5”: OCI runtime exec failed: exec failed: unable to start container process: exec: “bash”: executable file not found in $PATH: unknown

Please let me know how I can access the pod. Thanks!

@Ga_Tre Hello and welcome to the community :tada:

The error looks like the bash executable cannot be found in the $PATH environment variable within the container. Either bash isn’t installed on the container image or the $PATH points to a wrong location

This isn’t a Tyk-specific issue but here are a couple of suggestions:

  • Check the container image for bash
  • Verify the container $PATH or simply override the env var
  • Try using a different shell sh or zsh

Thanks for responding @Olu. I’m using the helm chart with the container that Tyk provided. I tried sh, zsh, /bin/bash, etc. and none of them worked. I even tried ls command and it didn’t work either.

Asked internally if a shell is bundled with the image and it turns out it’s not anymore (as of v5.5.0).

image

So it means you may have to create an image with an associated shell in it or use a tool like cdebug to access the file system and run shell commands for distro-less container images

Thanks @Olu for the info.