-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Remove hard-coded namespace from k8s config #5482
Conversation
Can one of the admins verify this patch? |
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.
Thank you for this contribution! I'll give this a try to make sure the client behaves as expected. Left a comment on the code. Also feel free to add an entry to CHANGELOG.asciidoc
return kubeAnnotatorConfig{ | ||
InCluster: true, | ||
SyncPeriod: 1 * time.Second, | ||
CleanupTimeout: 60 * time.Second, | ||
Namespace: "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.
I think it's best if we remove Namespace
field from kubeAnnotatorConfig
, and move all references to client.Namespace
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.
Yeah, I considered doing that initially as well. Will adjust now!
jenkins, test it please |
Can one of the admins verify this patch? |
The default namespace should be populated by the Kubernetes client. In the case of in-cluster config, the namespace will be read from the /var/run/secrets/kubernetes.io/serviceaccount/namespace file. (Note that this assumes the ServiceAccount admission controller is in use.) In the case of parsing a k8s configuration file, the default namespace is set to the client default of "default". Minor spelling correction of Kubernetes and some additional error information was changed as well. Closes elastic#5378
357df18
to
e20beda
Compare
Just gave this a try, works for me, thank you 🎉 |
See commit text for more details. I haven't actually tested this yet, but looking at the client code I can't see how this would fail in any previously working scenario. @tarasglek care to verify all is well now?
(#5378)