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

Add limited config-map support to kube-dns #36775

Merged
merged 2 commits into from
Nov 19, 2016

Conversation

bowei
Copy link
Member

@bowei bowei commented Nov 14, 2016

This is an integration bugfix for #36194

kube-dns

Added --config-map and --config-map-namespace command line options. 
If --config-map is set, kube-dns will load dynamic configuration from the config map 
referenced by --config-map-namespace, --config-map. The config-map supports
the following properties: "federations".

--federations flag is now deprecated. Prefer to set federations via the config-map.
Federations can be configured by settings the "federations" field to the value currently 
set in the command line.

Example:

  kind: ConfigMap
  apiVersion: v1
  metadata:
    name: kube-dns
    namespace: kube-system
  data:
    federations: abc=def

This change is Reviewable

@k8s-github-robot k8s-github-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. release-note-label-needed labels Nov 14, 2016
@k8s-ci-robot
Copy link
Contributor

Jenkins unit/integration failed for commit f3adc5d9c23f5d66484077f7df949938aa8af55f. Full PR test history.

The magic incantation to run this job again is @k8s-bot unit test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@ixdy ixdy assigned nikhiljindal and unassigned ixdy Nov 14, 2016
@bowei bowei force-pushed the kube-dns-config-map branch 5 times, most recently from d151eeb to 79c8f51 Compare November 15, 2016 01:12
@bowei
Copy link
Member Author

bowei commented Nov 15, 2016

@k8s-bot test this

@bowei
Copy link
Member Author

bowei commented Nov 15, 2016

@k8s-bot e2e test this

1 similar comment
@bowei
Copy link
Member Author

bowei commented Nov 15, 2016

@k8s-bot e2e test this

@k8s-ci-robot
Copy link
Contributor

Jenkins GKE smoke e2e failed for commit 79c8f51ac62bbaf399d8debd538d8d8102afd1f0. Full PR test history.

The magic incantation to run this job again is @k8s-bot cvm gke e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins GCI GCE e2e failed for commit 79c8f51ac62bbaf399d8debd538d8d8102afd1f0. Full PR test history.

The magic incantation to run this job again is @k8s-bot gci gce e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins GCE e2e failed for commit 79c8f51ac62bbaf399d8debd538d8d8102afd1f0. Full PR test history.

The magic incantation to run this job again is @k8s-bot cvm gce e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins Kubemark GCE e2e failed for commit 79c8f51ac62bbaf399d8debd538d8d8102afd1f0. Full PR test history.

The magic incantation to run this job again is @k8s-bot kubemark e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@bowei
Copy link
Member Author

bowei commented Nov 15, 2016

@thockin @nikhiljindal @MrHohn

This is the fix that needs to go into 1.5 for federations to work with config flags

@nikhiljindal
Copy link
Contributor

Awesome, thanks!
I will review this later tonight.
cc @kubernetes/sig-cluster-federation

// ExecCommandInContainer execute a command in the specified container.
func (f *Framework) ExecCommandInContainer(podName, containerName string, cmd ...string) string {
stdout, stderr, err := f.ExecCommandInContainerWithFullOutput(podName, containerName, cmd...)
Logf("Exec stderr: %q", stderr)
Copy link
Contributor

Choose a reason for hiding this comment

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

Add some context to this error message like "Exec stderr while executing cmd %s in container %s in pod %s"?

Copy link
Member Author

Choose a reason for hiding this comment

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

the Exec* family of command already dumps this information into the log (ExecWithOptions logs its arguments). I don't really want to duplicate it.

func (f *Framework) ExecCommandInContainer(podName, containerName string, cmd ...string) string {
stdout, stderr, err := f.ExecCommandInContainerWithFullOutput(podName, containerName, cmd...)
Logf("Exec stderr: %q", stderr)
Expect(err).NotTo(HaveOccurred(), "fail to execute command")
Copy link
Contributor

Choose a reason for hiding this comment

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

Also print the command, container and pod for which this failed

Copy link
Member Author

Choose a reason for hiding this comment

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

done

HealthzPort int
DNSBindAddress string
DNSPort int
// Federations maps federation names to their registered domain names.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove this comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

It duplicates the usage in the flags description below and increases the maintenance cost.


Federations: make(map[string]string),

ConfigMapNs: "kube-system",
Copy link
Contributor

Choose a reason for hiding this comment

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

Use the NamespaceSystem const:

NamespaceSystem string = "kube-system"
?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

" domain names to which this cluster belongs. Example:"+
" \"myfederation1=example.com,myfederation2=example2.com,myfederation3=example.com\"."+
" It is an error to set both the federations and config-map flags.")
fs.MarkDeprecated("federations", "use ConfigMap instead. Will be removed in future version")
Copy link
Contributor

Choose a reason for hiding this comment

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

use ConfigMap -> use config-map

Copy link
Member Author

Choose a reason for hiding this comment

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

done

}

func (t *dnsConfigMapTest) validateFederation() {
const timeout = time.Duration(10) * time.Second
Copy link
Contributor

Choose a reason for hiding this comment

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

We recommend using wait.ForeverTestTimeout in all tests

Copy link
Member Author

Choose a reason for hiding this comment

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

done

ok := false
var actual []string

for time.Since(startTime) < timeout {
Copy link
Contributor

Choose a reason for hiding this comment

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

Use wait.PollImmediate

Copy link
Member Author

Choose a reason for hiding this comment

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

done

},
ObjectMeta: api.ObjectMeta{
Namespace: t.f.Namespace.Name,
Name: "e2e-dns-configmap-" + string(uuid.NewUUID()),
Copy link
Contributor

Choose a reason for hiding this comment

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

You can set GenerateName. Example:

GenerateName: "latency-svc-",

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Containers: []api.Container{
{
Name: "util",
Image: "gcr.io/google_containers/dnsutils:e2e",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this tag documented somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

you mean :e2e? Not sure, but this is already used by the other dns related tests

Spec: api.ServiceSpec{
Selector: map[string]string{"app": "e2e-dns-configmap"},
Ports: []api.ServicePort{
{Protocol: "TCP", Port: 10101, TargetPort: intstr.FromInt(10101)},
Copy link
Contributor

Choose a reason for hiding this comment

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

Is 10101 a random port you picked or is it specific?

Copy link
Member Author

Choose a reason for hiding this comment

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

random port

Copy link
Contributor

Choose a reason for hiding this comment

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

optional nit: you can make it a const at top and add a comment saying its random.

@nikhiljindal
Copy link
Contributor

Mostly minor suggestions and some questions.
Thanks @bowei for including great tests as well!

@liggitt
Copy link
Member

liggitt commented Nov 16, 2016

this seems like a big change... is it a bug fix or a feature?

@bowei
Copy link
Member Author

bowei commented Nov 17, 2016

@liggitt yes, this is a bug fix (see #36194)

@k8s-ci-robot
Copy link
Contributor

Jenkins verification failed for commit c043981b5ce0e77d14aedb9d0f269dfdee49589b. Full PR test history.

The magic incantation to run this job again is @k8s-bot verify test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 19, 2016
@k8s-ci-robot
Copy link
Contributor

Jenkins GCE etcd3 e2e failed for commit d94b2b7. Full PR test history.

The magic incantation to run this job again is @k8s-bot gce etcd3 e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@bowei
Copy link
Member Author

bowei commented Nov 19, 2016

ok -- images pushed to google_containers, version 1.9

@bowei
Copy link
Member Author

bowei commented Nov 19, 2016

k8s-bot test this

@saad-ali
Copy link
Member

@kubernetes/test-infra-admins Any idea why only 4 pre-submit tests are running against this PR and not the usual 10-15?

@ixdy
Copy link
Member

ixdy commented Nov 19, 2016

I don't see any test results for 19be1d2. @spxtr did we miss a webhook?

@ixdy
Copy link
Member

ixdy commented Nov 19, 2016

Actually, it looks like it was triggered on https://prow.k8s.io/, but Jenkins might be down. @fejta

@bowei
Copy link
Member Author

bowei commented Nov 19, 2016

@dims @saad-ali lgtm?

@bowei
Copy link
Member Author

bowei commented Nov 19, 2016

@smarterclayton -- Is it not possible for the pod author to restrict access to a specific config-map? For example, in this case, the pod yaml would grant kubedns access to kube-system:kube-dns config map only. Requests to other config-maps by API would be rejected.

@dims
Copy link
Member

dims commented Nov 19, 2016

@bowei 👍 LGTM

@bowei
Copy link
Member Author

bowei commented Nov 19, 2016

/lgtm

@k8s-ci-robot
Copy link
Contributor

@bowei: you can't LGTM your own PR.

In response to [this comment](https://github.com//pull/36775#issuecomment-261692810):

/lgtm

If you have questions or suggestions related to this bot's behavior, please file an issue against the kubernetes/test-infra repository.

@bowei
Copy link
Member Author

bowei commented Nov 19, 2016

@dims @saad-ali it needs to be /lgtm

@thockin thockin added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 19, 2016
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@luxas
Copy link
Member

luxas commented Nov 25, 2016

@bowei You should push the image for arm, arm64 and ppc64le as well.

Please do it as soon as possible, kubeadm needs it.
Thanks

@MrHohn
Copy link
Member

MrHohn commented Nov 25, 2016

@luxas Sorry about the inconvenience. I just built and pushed the other three images.

@luxas
Copy link
Member

luxas commented Nov 25, 2016

Thank you @MrHohn!

@luxas
Copy link
Member

luxas commented Nov 26, 2016

@bowei @MrHohn Sorry to disturb once more, but I noticed dnsmasq-metrics-ARCH:1.0 isn't pushed for the other architectures...
Please push them as well

@MrHohn
Copy link
Member

MrHohn commented Nov 27, 2016

@luxas Built and pushed. Sorry for the delay.

@bowei
Copy link
Member Author

bowei commented Nov 27, 2016

@MrHohn -- thanks for taking care of it for me :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet