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

Ingress: Add support for is-default-class on IngressClass #23719

Merged
merged 1 commit into from
Feb 17, 2023

Conversation

meyskens
Copy link
Member

@meyskens meyskens commented Feb 13, 2023

This adds support for the ingressclass.kubernetes.io/is-default-class flag on the IngressClass. If set Cilium ingress wil pick up all ingress objects where no class is set also.

This also adds exposure to enable it in Helm under ingressController.default

Fixes: #23181

Signed-off-by: Maartje Eyskens maartje.eyskens@isovalent.com

Please ensure your pull request adheres to the following guidelines:

  • For first time contributors, read Submitting a pull request
  • All code is covered by unit and/or runtime tests where feasible.
  • All commits contain a well written commit description including a title,
    description and a Fixes: #XXX line if the commit addresses a particular
    GitHub issue.
  • If your commit description contains a Fixes: <commit-id> tag, then
    please add the commit author[s] as reviewer[s] to this issue.
  • All commits are signed off. See the section Developer’s Certificate of Origin
  • Provide a title or release-note blurb suitable for the release notes.
  • Thanks for contributing!

Fixes: #issue-number

Add support for the `ingressclass.kubernetes.io/is-default-class` annotation on Cilium's IngressClass

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Feb 13, 2023
@meyskens meyskens force-pushed the meyskens/ingress-class branch 6 times, most recently from f460e7e to 0663468 Compare February 14, 2023 10:26
@meyskens meyskens marked this pull request as ready for review February 14, 2023 13:19
@meyskens meyskens requested review from a team as code owners February 14, 2023 13:19
Copy link
Member

@nbusseneau nbusseneau left a comment

Choose a reason for hiding this comment

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

CI workflow LGTM, uses pull_request trigger so no specific risk in case of attack via malicious PR (forks do not have access to upstream secrets).

Helm changes are trivial, LGTM.

Comment on lines +65 to +72
- name: Create minikube cluster with multiple nodes
uses: medyagh/setup-minikube@ab221dee176f8eabd8deddf849b5bf1d6244a6e8 # v0.0.11
with:
minikube-version: ${{ env.minikube_version }}
network-plugin: cni
cni: false
wait: false
start-args: --nodes 3 --docker-opt "default-ulimit=nofile=102400:102400"
Copy link
Member

Choose a reason for hiding this comment

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

Is there any specific reason to use Minikube here instead of Kind? Not a problem at all but I'm wondering if the pipeline would not run faster on a Kind-based cluster.

Copy link
Member Author

Choose a reason for hiding this comment

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

Happy to move it to kind (I was wondering the same thing as you...), but it builds upon the previous conformance tests which all use minikube, I only modified this one to use the default behavior

Copy link
Member

Choose a reason for hiding this comment

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

Your call, if not worth the trouble it's OK as is, and consistency with the other conformance workflows is also good. Probably @sayboras just needed Minikube for the other workflows.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll keep it minikube for now and will probably file an issue to consider kind (unless @sayboras has a reason)

Copy link
Member

Choose a reason for hiding this comment

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

Last time I can't get kind + metallb (required for LB service) to work from host (i.e. github runner), so I just use minikube with handy minikube tunnel command.

Recently, I noticed that we have labs prepared with Kind + MetalLB, so it's worth to give it a crack again.

Copy link
Member

Choose a reason for hiding this comment

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

as discussed offline, we can tackle this separately, we might even use LB IPAM feature if possible.

@ldelossa
Copy link
Contributor

@meyskens can you please fill me in on motivation for this? I understand the change, but just looking for a bit more context.

@meyskens meyskens added the release-note/minor This PR changes functionality that users may find relevant to operating Cilium. label Feb 14, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Feb 14, 2023
@meyskens
Copy link
Member Author

This PR came out of #23181 (which was passed onto be by my team as good first issue).
As far as I understand the motivation (@sayboras feel free to add onto this if I missed something) is to add the ability for the user to say they want Cilium as their default ingress controller which is useful when not setting the ingressClassName on all ingress objects. In which case the default one will always pick it up. This was standardized with an annotation in the Kubernetes spec (info at https://kubernetes.io/docs/concepts/services-networking/ingress/#default-ingress-class) however we did not implement this yet thus lacking an upstream compatibility with the ingress API.

Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

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

I found a couple of typos, but looks good otherwise from my side. Thanks!

Documentation/network/servicemesh/installation.rst Outdated Show resolved Hide resolved
Documentation/network/servicemesh/installation.rst Outdated Show resolved Hide resolved
operator/pkg/ingress/ingress_class.go Outdated Show resolved Hide resolved
Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

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

Thanks!

operator/pkg/ingress/ingress.go Outdated Show resolved Hide resolved
@meyskens meyskens force-pushed the meyskens/ingress-class branch 2 times, most recently from 56ce9a1 to 651c6c1 Compare February 16, 2023 08:15
Copy link
Contributor

@squeed squeed left a comment

Choose a reason for hiding this comment

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

One minor thing, then LGTM!

operator/pkg/ingress/ingress.go Outdated Show resolved Hide resolved
This adds support for the ingressclass.kubernetes.io/is-default-class flag on the IngressClass.
If set Cilium ingress wil pick up all ingress objects where no class is set also.

This also adds exposure to enable it in Helm under ingressController.default

Fixes: cilium#23181

Signed-off-by: Maartje Eyskens <maartje.eyskens@isovalent.com>
Copy link
Contributor

@squeed squeed left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Member

@sayboras sayboras left a comment

Choose a reason for hiding this comment

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

Thanks a lot for taking up this task, LGTM ✔️

@sayboras
Copy link
Member

/test

@sayboras
Copy link
Member

Suite-k8s-1.16.K8sUpdates Tests upgrade and downgrade from a Cilium stable image to master failure due to the below error. I don't think it's related to the changes here (only on operator and Ingress).

Re-run to confirm the flake.

DNS entry is not ready after timeout
Expected
    <*errors.errorString | 0xc0006f6fb0>: {
        s: "DNS 'app1-service.default.svc.cluster.local' is not ready after timeout: 7m0s timeout expired",
    }
to be nil

@sayboras
Copy link
Member

/test-1.16-4.19

@sayboras
Copy link
Member

Reviews are in, all tests passed (ci-verifier test is not required for this change). Mark this ready to merge.

@sayboras sayboras added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Feb 17, 2023
@pchaigno
Copy link
Member

pchaigno commented Feb 17, 2023

Suite-k8s-1.16.K8sUpdates Tests upgrade and downgrade from a Cilium stable image to master failure due to the below error. I don't think it's related to the changes here (only on operator and Ingress).

@sayboras Do we already have a flake issue for that?

@pchaigno pchaigno removed the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Feb 17, 2023
@sayboras
Copy link
Member

Suite-k8s-1.16.K8sUpdates Tests upgrade and downgrade from a Cilium stable image to master failure due to the below error. I don't think it's related to the changes here (only on operator and Ingress).

Do we already have a flake issue for that?

Good point, confirmed that its a flake as re-run was good. Here is it #23845

@sayboras sayboras added ready-to-merge This PR has passed all tests and received consensus from code owners to merge. area/servicemesh GH issues or PRs regarding servicemesh labels Feb 17, 2023
@pchaigno
Copy link
Member

Thanks Tam!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/servicemesh GH issues or PRs regarding servicemesh ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/minor This PR changes functionality that users may find relevant to operating Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CFP: Support default Ingress Class mode
7 participants