containerd / containerd/nerdctl

Make use of k8s cluster dns service for custom network

Open
#2,057 4 comments 0 reactions 1 assignee Claimed by @fahedouch View on GitHub
area/kubernetes area/network enhancement
Dominant language
Go
Stars
10.4k
Forks
826
Avg merge
1d 23h
Merged PRs (30d)
44

Description

### Description

I'm trying to run simple container:
`nerdctl run --rm --network mynet -it alpine`
'mynet' is defined for local k8s cluster (in /etc/cni/net.d/ directory).
Cluster has some coredns service exposed for running containers in corresponding domain search/nameserver directives of /etc/resolv.conf.
But, nerdctl take dns(resolv.conf) from host machine, not from custom network(coredns).
According to docs [DNS services](https://docs.docker.com/config/containers/container-networking/#dns-services), that's not completely right.

### Steps to reproduce the issue

1. run `nerdctl run --rm --network mynet -it alpine`
3. inside of running container ping some name available in cluster `.default.svc.cluster.local`
4. Success

### Describe the results you received and expected

Host unavailable.

### What version of nerdctl are you using?

v1.2.0

### Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

### Host information

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.