Adding 'kubectl' container to pipeline not working

the ‘cat’ command exited immediately, causing the ‘kubectl’ container to exit immediately, which caused the pipline to exit, so i switched to the ‘sleep’ command … which works to keep the container alive … but it just seems to hang the length of time I’ve set the sleep for.

as i’ve performed various troubleshooting it sometimes gets to the ‘sh’ command and just hangs there.

the plugin documentation, Kubernetes, mentions a hanging issue and says to try adding:

spec.securityContext:
  runAsUser: 1000

which resulted in seeing what looks like debug output from my other commands but didn’t ever run the kubectl command i was hoping to see to verify i was successfully running something in the kubectl container.

of my 3 containers the docker container needs the privileged securityContext whereas the others don’t, i also tried reordering them moving the docker container to be last, but order didn’t seem to matter, assigning them all privileged caused more errors

1 Like