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

Adding PodDNSConfig #3077

Merged
merged 2 commits into from
Jun 27, 2024
Merged

Conversation

yuriolisa
Copy link
Contributor

Description:

Enabling PodDnsConfig for OpenTelemetry Collector, TargetAllocator and OpAMPBridge.
Link to tracking Issue(s):

Testing:

Documentation:

@yuriolisa yuriolisa requested a review from a team June 26, 2024 10:45
Copy link
Contributor

@swiatekm swiatekm left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -105,6 +105,8 @@ type OpAMPBridgeSpec struct {
// https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
// +optional
TopologySpreadConstraints []v1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
// PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.
Copy link
Contributor

Choose a reason for hiding this comment

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

@yuriolisa should we also make it possible to configure DNSPolicy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jaronoff97, actually not, because all the three possible values are contemplated here following the precedence.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just adding that I prefer this approach because it helps the end user avoid configuration mistakes.

Copy link
Contributor

Choose a reason for hiding this comment

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

is there any other case where the user would want to set the DNSPolicy separately?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO, no. It's just to offer a safe place to deliver the combination of HostNetwork, DNSPolicy, and DNSConfig.

dnsPolicy := corev1.DNSClusterFirst
if hostNetwork {
dnsPolicy = corev1.DNSClusterFirstWithHostNet
}
// If local DNS configuration is set, takes precedence of hostNetwork.
if dnsConfig.Nameservers != nil {
dnsPolicy = corev1.DNSNone
Copy link
Contributor

Choose a reason for hiding this comment

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

it's also possible that someone would want to use nameservers but not have the DNSPolicy set to be None https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config though yeah this probably doesn't make a ton of sense... let's do this for now and if someone really wants the customization we can cross that bridge when we get to it.

@jaronoff97 jaronoff97 merged commit 5c6bf59 into open-telemetry:main Jun 27, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide Access to Pod DNSConfig
3 participants