Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Remove ExternalDNS contour ingress workaround #635

Merged
merged 3 commits into from
Jun 30, 2020

Conversation

knrt10
Copy link
Member

@knrt10 knrt10 commented Jun 17, 2020

This PR closes #589. It has been tested.

Component Tested

  • metallb
  • contour
  • external-dns
  • cert-manager
  • dex
  • gangway
  • httpbin

Copy link
Member

@ipochi ipochi left a comment

Choose a reason for hiding this comment

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

@knrt10 Thanks for the PR.

suggestion: please provide a descriptive commit message.

@knrt10 knrt10 force-pushed the knrt10/fix-contour-ingress-workaround branch 3 times, most recently from 4436f05 to 17ac285 Compare June 17, 2020 12:28
@surajssd
Copy link
Member

@knrt10 Just one comment, we have a component httpbin for the same purpose you have deployed nginx.

@knrt10 knrt10 force-pushed the knrt10/fix-contour-ingress-workaround branch 2 times, most recently from babaa68 to e805e58 Compare June 18, 2020 08:39
@surajssd
Copy link
Member

@knrt10 just a small spell mistake in the commit message:

-Due to upstream issue in contour, address fiels was not setting on
-ingress resource. We introduces a workaround to solve that issue.
+Due to upstream issue in contour, address fields were not setting on
+ingress resource. We introduced a workaround to solve that issue.

@knrt10
Copy link
Member Author

knrt10 commented Jun 18, 2020

@surajssd applied the httpbin component too. You can verify now curl dex.kautilya.dev.lokomotive-k8s.net

@knrt10
Copy link
Member Author

knrt10 commented Jun 18, 2020

Removing cluster now

@knrt10 knrt10 force-pushed the knrt10/fix-contour-ingress-workaround branch 2 times, most recently from f4d5702 to 2899f1b Compare June 18, 2020 09:14
Copy link
Member

@ipochi ipochi left a comment

Choose a reason for hiding this comment

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

thanks for the PR @knrt10

There are a couple of things that needs to be taken care of:

Since we remove the ingress_hosts from contour configuration, creation of DNS entries has become a manual process, which we want external-dns to pick up.

Update Ingress manifests for Dex and Gangway with annotation
external-dns.alpha.kubernetes.io/hostname:.

The value of the annotation will be IngressHost field of dex and gangway i.e:
external-dns.alpha.kubernetes.io/hostname: {{ .IngressHost }}.

Also we need to change external-dns component configuration:

Instead of default source = ["service"] , it should be source=["ingress"]

This way when you deploy dex and gangway, external-dns will pick up the hosts in Ingress objects and create all those DNS entries.

@knrt10 knrt10 force-pushed the knrt10/fix-contour-ingress-workaround branch from 2899f1b to b676c29 Compare June 18, 2020 10:55
@knrt10
Copy link
Member Author

knrt10 commented Jun 18, 2020

@ipochi updated. Please review

ipochi
ipochi previously requested changes Jun 18, 2020
Copy link
Member

@ipochi ipochi left a comment

Choose a reason for hiding this comment

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

suggestion: any changes related to dex and gangway should be part of another commit.

@knrt10 knrt10 force-pushed the knrt10/fix-contour-ingress-workaround branch from b676c29 to 3593fb4 Compare June 18, 2020 11:08
@knrt10
Copy link
Member Author

knrt10 commented Jun 18, 2020

Updated

@@ -12,9 +12,6 @@ metadata:
# for information about enabling the PROXY protocol on the ELB to recover
# the original remote IP address.
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
{{- if .Values.ingressHosts }}
external-dns.alpha.kubernetes.io/hostname: '{{- join "," .Values.ingressHosts }}'
Copy link
Member

Choose a reason for hiding this comment

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

I have some doubts whether there should be a field in contour configuration that would create a DNS entry for the envoy service. The new field in contour would act as the value of the external-dns annotation.

Not sure if this is necessary, would like others to chime in.

@iaguis

Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

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

Do we have tests for this functionality? Perhaps we could add some to ensure, that this change set is working as expected?

pkg/components/dex/component.go Outdated Show resolved Hide resolved
@knrt10 knrt10 force-pushed the knrt10/fix-contour-ingress-workaround branch 2 times, most recently from 00a5066 to 0b8adc0 Compare June 22, 2020 13:29
@knrt10
Copy link
Member Author

knrt10 commented Jun 25, 2020

@invidian what tests do you suggest for this?

@invidian
Copy link
Member

@invidian what tests do you suggest for this?

We should test, that the ingress host (either newly created one as part of testing or one from other component) resolves to the IP address in Ingress object.

@knrt10 knrt10 force-pushed the knrt10/fix-contour-ingress-workaround branch from 0b8adc0 to d1e3b6c Compare June 26, 2020 10:32
@knrt10
Copy link
Member Author

knrt10 commented Jun 26, 2020

@invidian can you please review

@knrt10 knrt10 force-pushed the knrt10/fix-contour-ingress-workaround branch 3 times, most recently from bf8c21f to 4cdf7c8 Compare June 28, 2020 07:25
Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

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

Thanks @knrt10 for adding tests, the implementation looks almost correct to me. I added some comments what needs to be changed, but nothing major. Overall things looks good, nice work :) Please have a look.

Also note, that currently the CI do not gets triggered, so please run tests locally to make sure things are working as expected, until we fix the CI.

test/ingress/packet_test/match_host_test.go Outdated Show resolved Hide resolved
test/ingress/packet_test/match_host_test.go Outdated Show resolved Hide resolved
test/ingress/packet_test/match_host_test.go Show resolved Hide resolved
@knrt10
Copy link
Member Author

knrt10 commented Jun 29, 2020

Thanks @invidian for reviewing. Updating the PR

@knrt10 knrt10 force-pushed the knrt10/fix-contour-ingress-workaround branch from 4cdf7c8 to 89273cd Compare June 29, 2020 08:59
@knrt10 knrt10 requested a review from invidian June 29, 2020 08:59
@knrt10
Copy link
Member Author

knrt10 commented Jun 29, 2020

Screenshot 2020-06-29 at 2 28 58 PM

e2e tests works fine.

@knrt10 knrt10 force-pushed the knrt10/fix-contour-ingress-workaround branch from 89273cd to 0c5283b Compare June 29, 2020 09:01
Due to upstream issue in contour, address fields were not setting on
ingress resource. We introduced a workaround to solve that issue.

Previously we were explicitly using `IngressHosts` to work with
external-dns. Now since the upstream issue has been fixed in contour we
have removed optional field `IngressHosts`.

See projectcontour/contour#403
and 71c19e0

Signed-off-by: knrt10 <kautilya@kinvolk.io>
Since `ingress_hosts` from contour configuration is removed, now we have
added a new annotation for external-dns to pickup and add it
automatically to DNS entries.

external-dns default source is changes to `ingress`.

Signed-off-by: knrt10 <kautilya@kinvolk.io>
@knrt10 knrt10 force-pushed the knrt10/fix-contour-ingress-workaround branch from 0c5283b to 2306e5e Compare June 29, 2020 11:30
@knrt10 knrt10 requested a review from invidian June 29, 2020 11:30
invidian
invidian previously approved these changes Jun 29, 2020
Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @knrt10 for addressing the review comments in timely manner. I'd wait with merging until we fix the CI though, to make sure tests also work there.

@knrt10
Copy link
Member Author

knrt10 commented Jun 30, 2020

@invidian can you please approve, stale review got removed on latest push to check CI

invidian
invidian previously approved these changes Jun 30, 2020
Signed-off-by: knrt10 <kautilya@kinvolk.io>
@invidian invidian force-pushed the knrt10/fix-contour-ingress-workaround branch from 82fb910 to 57d9314 Compare June 30, 2020 05:17
@invidian
Copy link
Member

@knrt10 I pushed again last commit to trigger the CI one more time, as while doing some other tests I unpaused PacketARM pipeline, which is going to fail.

@knrt10
Copy link
Member Author

knrt10 commented Jun 30, 2020

@invidian PacketARM did not get trigerred.

Copy link
Member

@ipochi ipochi left a comment

Choose a reason for hiding this comment

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

LGTM.

Thanks and good work @knrt10

@knrt10 knrt10 merged commit b54382f into master Jun 30, 2020
@knrt10 knrt10 deleted the knrt10/fix-contour-ingress-workaround branch June 30, 2020 08:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove ExternalDNS contour ingress workaround
4 participants