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 agent dnsPolicy option #1370

Merged
merged 2 commits into from
Apr 27, 2021
Merged

Conversation

faceair
Copy link
Contributor

@faceair faceair commented Jan 25, 2021

@codecov
Copy link

codecov bot commented Jan 25, 2021

Codecov Report

Merging #1370 (48fb210) into master (7c24a0f) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 48fb210 differs from pull request most recent head 21f51da. Consider uploading reports for the commit 21f51da to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1370      +/-   ##
==========================================
+ Coverage   86.72%   86.73%   +0.01%     
==========================================
  Files          91       91              
  Lines        5056     5060       +4     
==========================================
+ Hits         4385     4389       +4     
  Misses        516      516              
  Partials      155      155              
Impacted Files Coverage Δ
pkg/apis/jaegertracing/v1/jaeger_types.go 100.00% <ø> (ø)
pkg/deployment/agent.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c24a0f...21f51da. Read the comment docs.

if a.jaeger.Spec.Agent.HostNetwork != nil {
hostNetwork = *a.jaeger.Spec.Agent.HostNetwork
if dnsPolicy == "" {
dnsPolicy = corev1.DNSClusterFirstWithHostNet
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need to set a default value here? Is that different than if a value simply isn't provided?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to the k8s documentation, if we do not set dnsPolicy to DNSClusterFirstWithHostNet, k8s will use ClusterFirst by default, and the daemonset agent will not be able to resolve the service ip of the collector properly.

Error while dialing dial tcp: lookup jaeger-collector.observability.svc.cluster.local on {hostIP}:53: no such host

Copy link
Contributor

Choose a reason for hiding this comment

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

Does it mean that DaemonSets aren't working at the moment? I think we have e2e tests exercising this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, DaemonSets should not be working now. My company has bypassed this problem by forwarding some dns domains to coredns on the physical machine.
I can try adding the corresponding test case to the e2e test.

Copy link
Contributor

Choose a reason for hiding this comment

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

@kevinearls, we do have this, don't we?

@faceair if you could provide an e2e to prove, that would be awesome!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I modified the existing es2 test case, is this OK?

Copy link
Contributor

Choose a reason for hiding this comment

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

Makefile Show resolved Hide resolved
@kevinearls
Copy link
Contributor

@faceair @jpkrohling We have daemonset_test.go but I have not seen any failures with it. Does this mean there could be a problem with the test?

@obliadp
Copy link

obliadp commented Jan 30, 2021

Would love to see this merged. I'm using the daemonset, and agents are not able to find collector unless I patch with dnsPolicy: ClusterFirstWithHostNet

@faceair faceair force-pushed the add-dns-policy branch 2 times, most recently from ecfc771 to c2cd1b0 Compare January 30, 2021 05:28
@obliadp
Copy link

obliadp commented Mar 11, 2021

Any progress on merging this?

@jpkrohling
Copy link
Contributor

ping @kevinearls

@kevinearls
Copy link
Contributor

@obliadp Can you just fix the spelling of "agent-as-sidecar-with-hostnetowk" in test/e2e/sidecar_test.go?

@obliadp
Copy link

obliadp commented Mar 23, 2021

@obliadp Can you just fix the spelling of "agent-as-sidecar-with-hostnetowk" in test/e2e/sidecar_test.go?

I'm just an interested third party. Your question is probably for @faceair ?

@PuppetA17
Copy link

@obliadp @faceair @kevinearls @jpkrohling
How about this problem? The agent can't configure DNS policy. After setting the host network, the agent can't access the cluster DNS. Manual patching can work, but the patch will be removed by the operator after a period of time

@jpkrohling
Copy link
Contributor

@faceair are you still interested in this PR?

@faceair
Copy link
Contributor Author

faceair commented Apr 14, 2021

Is there anything else that needs to be changed in this pr? I've fixed the typo.

@jpkrohling jpkrohling requested a review from kevinearls April 14, 2021 08:23
@jpkrohling
Copy link
Contributor

@kevinearls could you please review this one again?

Copy link
Contributor

@kevinearls kevinearls left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -70,8 +72,8 @@ func (suite *SidecarTestSuite) AfterTest(suiteName, testName string) {
func (suite *SidecarTestSuite) TestSidecar() {
cleanupOptions := &framework.CleanupOptions{TestContext: ctx, Timeout: timeout, RetryInterval: retryInterval}

firstJaegerInstanceName := "agent-as-sidecar"
firstJaegerInstance := createJaegerAgentAsSidecarInstance(firstJaegerInstanceName, namespace)
firstJaegerInstanceName := "agent-as-sidecar-with-hostnetowk"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit - "agent-as-sidecar-with-hostnetwork"

@jpkrohling
Copy link
Contributor

Thanks for your contribution, @faceair!

@jpkrohling jpkrohling merged commit 5e9b39e into jaegertracing:master Apr 27, 2021
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.

5 participants