Connection refused for all URLs - TLS and non-TLS - but works as expected when running in kaniko debug #753
Labels
area/behavior
all bugs related to kaniko behavior like running in as root
kind/bug
Something isn't working
needs-reproduction
priority/p3
agreed that this would be good to have, but no one is available at the moment.
work-around-available
Summary
Github repo (context) gets cloned without issues + docker images are pulled without issues when ran SSHing into a
kaniko-project/executor:debug
but does not work otherwise.Actual behavior
Kaniko fails to pull context from github. This can be (and was) circumvented by adding an initcontainer as per #121 (where
alpine/git
pulls the git repo and makes it available through a shared volume). However, in the next stage the Kaniko container still fails to pull any images withconnection refused
. This still fails if the--insecure-pull
flag is added. This is not due to an issue related to credentials in azure (#425) and it doesn't seem to be (at least directly) related to TLS issues (#168 + #200) because I can confirm it works perfectly when running it directly SSH'd in akaniko-project/executor:debug
container.More specifically, if I run a
kaniko-project/executor:debug
container withtail -f /dev/null
as command, and then SSH into it withkubectl exec -it kanikodebug sh
, if I run the exact same command/kaniko/executor --context git://github.com/user/repo --no-push
, it would work perfectly (including the cloning of the repo and the pulling of the images).It's also worth mentioning that if I use run the
kaniko-project/executor:debug
container, and try to run it with the command same build-image command/docker/executor --context ...
(instead oftail -f /dev/null
) then it shows the same strangeconnection refused
behaviour.This was tested in an Azure AKS cluster.
Expected behavior
To see the same behaviour in the Kaniko executor than the one I see when SSHing and running the exact same commands.
To Reproduce
Connection failed when cloning repo
Below is the config file without init container. This will show a connection refused to the git repo. This works if actually running it with Kaniko:debug container (as per the example below). This also loads a config secret from file containing the auth required for kaniko.
Connection failed when pulling image
This is the version that clones the repo and shares it through a volume. This allows for the next step to be reached, but then the docker pull fails with a
connection refused
. The example below is ran with thedebug
container using thecommand: /kaniko/executor
to show that it still fails, but it can be replaced with thelatest
kaniko tag and would show the same behaviour.Debug Container
Now for the strangest part, is to reproduce how the exact same commands actually run perfectly in the debug container. The pod below would create a debug container which runs with
tail -f /dev/null
, so it's possible to connect/ssh into the container usingkubectl exec -it kanikodebug sh
. When connected to the Kaniko image, if the same command/kaniko/executor --context git://github.com/user/repo --no-push
would work as expected without any issues (context will be cloned from repo, and images will be pulled and built without issues).The text was updated successfully, but these errors were encountered: