-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Add limited config-map support to kube-dns #36775
Conversation
f0d5abd
to
f3adc5d
Compare
Jenkins unit/integration failed for commit f3adc5d9c23f5d66484077f7df949938aa8af55f. Full PR test history. The magic incantation to run this job again is |
d151eeb
to
79c8f51
Compare
@k8s-bot test this |
@k8s-bot e2e test this |
1 similar comment
@k8s-bot e2e test this |
Jenkins GKE smoke e2e failed for commit 79c8f51ac62bbaf399d8debd538d8d8102afd1f0. Full PR test history. The magic incantation to run this job again is |
Jenkins GCI GCE e2e failed for commit 79c8f51ac62bbaf399d8debd538d8d8102afd1f0. Full PR test history. The magic incantation to run this job again is |
Jenkins GCE e2e failed for commit 79c8f51ac62bbaf399d8debd538d8d8102afd1f0. Full PR test history. The magic incantation to run this job again is |
79c8f51
to
a1800d2
Compare
Jenkins Kubemark GCE e2e failed for commit 79c8f51ac62bbaf399d8debd538d8d8102afd1f0. Full PR test history. The magic incantation to run this job again is |
@thockin @nikhiljindal @MrHohn This is the fix that needs to go into 1.5 for federations to work with config flags |
Awesome, thanks! |
// 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) |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove this comment?
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the NamespaceSystem const:
Line 190 in 00458a1
NamespaceSystem string = "kube-system" |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use wait.PollImmediate
There was a problem hiding this comment.
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()), |
There was a problem hiding this comment.
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:
kubernetes/test/e2e/service_latency.go
Line 320 in 33ebe1f
GenerateName: "latency-svc-", |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)}, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
random port
There was a problem hiding this comment.
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.
Mostly minor suggestions and some questions. |
this seems like a big change... is it a bug fix or a feature? |
a1800d2
to
c043981
Compare
Jenkins verification failed for commit c043981b5ce0e77d14aedb9d0f269dfdee49589b. Full PR test history. The magic incantation to run this job again is |
c043981
to
a340294
Compare
d94b2b7
to
19be1d2
Compare
Jenkins GCE etcd3 e2e failed for commit d94b2b7. Full PR test history. The magic incantation to run this job again is |
ok -- images pushed to google_containers, version 1.9 |
k8s-bot test this |
@kubernetes/test-infra-admins Any idea why only 4 pre-submit tests are running against this PR and not the usual 10-15? |
Actually, it looks like it was triggered on https://prow.k8s.io/, but Jenkins might be down. @fejta |
@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. |
@bowei 👍 LGTM |
/lgtm |
@bowei: you can't LGTM your own PR.
In response to [this comment](https://github.com//pull/36775#issuecomment-261692810):
If you have questions or suggestions related to this bot's behavior, please file an issue against the kubernetes/test-infra repository. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue |
@bowei You should push the image for Please do it as soon as possible, kubeadm needs it. |
@luxas Sorry about the inconvenience. I just built and pushed the other three images. |
Thank you @MrHohn! |
@luxas Built and pushed. Sorry for the delay. |
@MrHohn -- thanks for taking care of it for me :-) |
This is an integration bugfix for #36194
This change is