Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Conversation

@Random-Liu
Copy link
Member

Add sandbox /etc/hosts and mount it inside each container of the sandbox.

Currently, in Kubelet,

  • For /etc/hosts, we mount it when the sandbox is not using host network, and rely on the runtime to maintain it if the sandbox is using host network.
  • For /etc/resolv.conf, we rely on the runtime to maintain it (dockershim overwrites it after creates sandbox container).

From the perspective of a runtime, it's weird that we only maintain the file in some cases, and not in other cases.

So in this PR, I'll let cri-containerd always maintain /etc/hosts no matter the sandbox is using host network or not.

In the future, we should make it consistent:

  1. Either let kubelet manage all those files;
  2. Let runtime manage all those files.

/cc @yujuhong

@Random-Liu
Copy link
Member Author

@Crazykev This PR is very similar with yours. Please take a look at this PR and address the comments in your PR correspondingly.

@Random-Liu Random-Liu added this to the v0.1.0-rc2 milestone Jun 1, 2017
@Random-Liu Random-Liu force-pushed the always-add-etc-hosts branch from f216d44 to 6c4a7a8 Compare June 1, 2017 21:29
@Random-Liu Random-Liu mentioned this pull request Jun 2, 2017
42 tasks
@Crazykev
Copy link
Contributor

Crazykev commented Jun 5, 2017

@Random-Liu THX, good to see CopyFile in Os interface, should I wait this PR get merged first?

@Random-Liu
Copy link
Member Author

@Crazykev You could fetch this commit to your PR, and send out.

Will merge your PR after this one.

Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Random-Liu
Copy link
Member Author

Apply LGTM based on #60 (review).

@Random-Liu Random-Liu added the lgtm label Jun 6, 2017
@Random-Liu Random-Liu merged commit d094968 into containerd:master Jun 6, 2017
@Random-Liu Random-Liu deleted the always-add-etc-hosts branch June 6, 2017 18:37
lanchongyizu pushed a commit to lanchongyizu/cri-containerd that referenced this pull request Sep 3, 2017
dcantah pushed a commit to dcantah/cri that referenced this pull request Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants