Skip to content

Unable to connect to pod's container IP; works in Docker #3915

Answered by ChristianCiach
budney asked this question in Q&A
Discussion options

You must be logged in to vote

I got it!

Look at the files inside /srv/dnscache/root/ip:

Docker:

/srv/dnscache/root/ip # ls
127.0.0.1  192

K3s:

/srv/dnscache/root/ip # ls
10?10      127.0.0.1

As @brandond correctly stated in #3915 (comment), these file names describe the prefixes of the ip addresses that the dnscache process responds to.

So, where does the broken 10?10 come from? Actually from the entrypoint script at /start.sh, which does this:

        NET=$( netstat -rn | egrep UG | awk '{print $2}' | cut -f1 -d. )
        touch "/srv/$SERVICE/root/ip/$NET"`

The issue is that the first line actually returns 10 twice in K3s, with a line break in between.

So, in the end it comes down to a buggy entrypoint script of …

Replies: 10 comments 10 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ChristianCiach
Comment options

Comment options

You must be logged in to vote
2 replies
@ChristianCiach
Comment options

@ChristianCiach
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@ChristianCiach
Comment options

@budney
Comment options

@ChristianCiach
Comment options

@brandond
Comment options

@ChristianCiach
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by brandond
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #3912 on August 26, 2021 15:47.