Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dns problem in apline based docker image #442

Closed
WeihanLi opened this issue Apr 12, 2019 · 9 comments
Closed

dns problem in apline based docker image #442

WeihanLi opened this issue Apr 12, 2019 · 9 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@WeihanLi
Copy link

WeihanLi commented Apr 12, 2019

What happened:

I've had a dns problem, the pod container can not resolve the external network dns like github.com.

There's a similar issue in kubernetes repository kubernetes/kubernetes#64924, but I'm not sure the problem is the same with it.

In my case, it only happened on alpine based image, it works on Debian based image in kind k8s cluster, but it works on docker desktop k8s cluster, so I'm consufed.

image

What you expected to happen: I think it should resolve the external dns correctly

How to reproduce it (as minimally and precisely as possible):

you can use this Dockerfile to build a image or use weihanli/accountingapp:latest for alpine based image to have a test

Anything else we need to know?:

Environment:

  • kind version: (use kind version): 0.2.1

  • Kubernetes version: (use kubectl version):

    Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.0", GitCommit:"641856db18352033a0d96dbc99153fa3b27298e5", GitTreeState:"clean", BuildDate:"2019-03-25T15:53:57Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
    Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.4", GitCommit:"c27b913fddd1a6c480c229191a087698aa92f0b1", GitTreeState:"clean", BuildDate:"2019-03-20T16:54:39Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}

  • Docker version: (use docker info):

    Containers: 1
    Running: 1
    Paused: 0
    Stopped: 0
    Images: 36
    Server Version: 18.06.1-ce
    Storage Driver: overlay2
    Backing Filesystem: extfs
    Supports d_type: true
    Native Overlay Diff: true
    Logging Driver: json-file
    Cgroup Driver: cgroupfs
    Plugins:
    Volume: local
    Network: bridge host macvlan null overlay
    Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
    Swarm: inactive
    Runtimes: runc
    Default Runtime: runc
    Init Binary: docker-init
    containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
    runc version: 69663f0bd4b60df09991c08812a60108003fa340
    init version: fec3683
    Security Options:
    seccomp
    Profile: default
    Kernel Version: 5.0.7-050007-generic
    Operating System: Ubuntu 18.04.2 LTS
    OSType: linux
    Architecture: x86_64
    CPUs: 2
    Total Memory: 7.765GiB
    Name: my-ubuntu
    ID: GB5R:7P7A:O4VF:MH5T:NUVS:LQTC:7XGX:FS26:RN6X:32I7:6GGQ:TDNE
    Docker Root Dir: /var/lib/docker
    Debug Mode (client): false
    Debug Mode (server): false
    Registry: https://index.docker.io/v1/
    Labels:
    Experimental: false
    Insecure Registries:
    127.0.0.0/8
    Live Restore Enabled: false

WARNING: No swap limit support

@WeihanLi WeihanLi added the kind/bug Categorizes issue or PR as related to a bug. label Apr 12, 2019
@tao12345666333
Copy link
Member

I guess this problem has nothing to do with kind, it is probably due to the problem of musl based on alpine image. https://bugs.alpinelinux.org/issues/9017

and you can try to use nslookup to get more detail.

@tao12345666333
Copy link
Member

/triage needs-information

@k8s-ci-robot k8s-ci-robot added the triage/needs-information Indicates an issue needs more information in order to work on it. label Apr 12, 2019
@WeihanLi
Copy link
Author

nslookup info
image

@WeihanLi
Copy link
Author

should I close this issue for a alpine related issue?

@tao12345666333
Copy link
Member

right. please see: gliderlabs/docker-alpine#476

@WeihanLi
Copy link
Author

OK, thanks @tao12345666333

@BenTheElder
Copy link
Member

You may need kubernetes/kubernetes@4274c42 if you're using go in your Alpine image.

@BenTheElder
Copy link
Member

Or rather: an etc/nsswitch.conf entry. Your Debian image most likely has one.

@BenTheElder
Copy link
Member

kubernetes/kubernetes#69238 and kubernetes/kubernetes#69195 have some more discussion. This issue is generic to alpine (non glibc) images with go binaries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests

4 participants