Add ability for custom DNSConfig and DNSPolicy#3899
Add ability for custom DNSConfig and DNSPolicy#3899simonpasquier merged 9 commits intoprometheus-operator:mainfrom
Conversation
b380215 to
b18a8e1
Compare
simonpasquier
left a comment
There was a problem hiding this comment.
do we want to expose dnsPolicy too? cc @prometheus-operator/prometheus-operator-reviewers
If yes I could add this too, @simonpasquier. |
|
I would assume folks would want |
d09b9d7 to
b8f0288
Compare
simonpasquier
left a comment
There was a problem hiding this comment.
Thanks! Only a few nits :)
f62a5aa to
197dc30
Compare
|
Isn't this completely equivalent to the existing deep merge option? This doesn't seem common enough to need dedicated fields. |
|
@coderanger DNS config applies at the pod level, not container level so deep-merge can't work IIUC. |
|
Any plan for merging this? |
|
@nitinpatil1992 Is there a formal process to ask for more reviews to proceed? |
|
We're having discussions about adding deep-merge capabilities for the pod spec which would allow to cover any customization (see #4023). It might be more efficient and flexible in the long run than slowly extending the Prometheus CRD every time a new use case comes around. |
|
Hey! Sorry for the very late feedback but we've discussed #4691 at the last contributors office hours and we agreed that adding support for |
197dc30 to
35f5e52
Compare
|
I am unable to |
08039b6 to
b30e606
Compare
673603a to
3bf1aed
Compare
There was a problem hiding this comment.
I don't think that we need unit tests at this level. On the other side it would be good to check that the API validation works as expected in the e2e tests (example:
prometheus-operator/test/e2e/prometheus_test.go
Line 4376 in 7405049
There was a problem hiding this comment.
@simonpasquier Followed the pattern, I saw with service_monitor_types. Thus I added test for dns_types.
Thanks for the review but I believe needs more work on my side to be reviewable as some tests failing.
Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
Review suggestions Co-authored-by: Simon Pasquier <spasquie@redhat.com>
More review suggestions Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
dc9fe8f to
34b6591
Compare
Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
0b8eef0 to
1c03c32
Compare
|
@paulfantom and @simonpasquier I believe now this PR is ready for review. |
|
@simonpasquier I am working on adding these cases on e2e too, as per your comment. Let me know though if it is a must have or nice to have for this PR. |
Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
8a563da to
558977b
Compare
pkg/prometheus/agent/statefulset.go
Outdated
| TopologySpreadConstraints: prompkg.MakeK8sTopologySpreadConstraint(finalSelectorLabels, cpf.TopologySpreadConstraints), | ||
| HostAliases: operator.MakeHostAliases(cpf.HostAliases), | ||
| HostNetwork: cpf.HostNetwork, | ||
| DNSPolicy: k8sutil.ConvertDNSPolicy(cpf.DNSPolicy), |
There was a problem hiding this comment.
We should rather only set the fields when they're not nil to avoid undesired side-effects (the same for all controllers).
if cpf.DNSPolicy != nil {
spec.DNSPolicy = appsv1.DNSPolicy(*cpf.DNSPolicy)
}
if cpf.DNSConfig != nil {
spec.DNSConfig = k8sutil.ConvertToK8sDNSConfig(*cpf.DNSConfig)
}There was a problem hiding this comment.
@simonpasquier I don't fully follow where I need to change this. Could you elaborate please?
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
|
@simonpasquier I think last refactor takes into consideration all your comments |
Closes #3836.