Skip to content

Put Gateway-API support behind a feature-gate. - #4310

Merged
jetstack-bot merged 4 commits into
cert-manager:masterfrom
jakexks:gateway-feature-gate
Aug 6, 2021
Merged

jetstack-bot merged 4 commits into
cert-manager:masterfrom
jakexks:gateway-feature-gate

Conversation

@jakexks

@jakexks jakexks commented Aug 5, 2021 •

Copy link
Copy Markdown
Member

After discussion in the stand-up and on slack, the gateway-api support is now gated behind --feature-gate=ExperimentalGatewayAPISupport=true

What this PR does / why we need it:

Adds an alpha-level feature gate for enabling the gateway-shim and the gateway HTTPRoute ACME HTTP-01 challenge solver.

Special notes for your reviewer:

The cert-manager controller will now crash with the following error if the feature gate is enabled but the gateway API CRDs are not installed: the Gateway API CRDs do not seem to be present, but ExperimentalGatewayAPISupport is set to true. Please install the gateway-api CRDs.

Release note:

Support for the sig-network Gateway API is gated behind the --feature-gates=ExperimentalGatewayAPISupport=true command line flag on the cert-manager controller

/kind feature

@jetstack-bot jetstack-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 5, 2021
@jakexks
jakexks force-pushed the gateway-feature-gate branch from 6126665 to 36aa9e2 Compare August 5, 2021 13:38
@jakexks

jakexks commented Aug 5, 2021

Copy link
Copy Markdown
Member Author

/kind feature

@jetstack-bot jetstack-bot added kind/feature Categorizes issue or PR as related to a new feature. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Aug 5, 2021
wallrj
wallrj previously requested changes Aug 5, 2021

@wallrj wallrj left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@jakexks

The controller-manager didn't crash when I tested it in the absence of the Gateway API.

$ git describe --all --always --dirty --long
heads/gateway-feature-gate-0-g36aa9e250


$ kubectl logs -n cert-manager deploy/cert-manager 
I0805 13:50:04.660485       1 feature_gate.go:243] feature gates: &{map[ExperimentalCertificateSigningRequestControllers:true]}
I0805 13:50:04.660698       1 start.go:75] cert-manager "msg"="starting controller"  "git-commit"="36aa9e250177a92e681c9f67d6a7ceb41d9c4fab" "version"="1628171195"
W0805 13:50:04.660756       1 client_config.go:615] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
I0805 13:50:04.662596       1 controller.go:265] cert-manager/controller/build-context "msg"="configured acme dns01 nameservers" "nameservers"=["10.0.0.16:53"] 
I0805 13:50:04.663513       1 options.go:423] cert-manager "msg"="enabling all experimental certificatesigningrequest controllers"  
I0805 13:50:04.663713       1 controller.go:85] cert-manager/controller "msg"="enabled controllers: [certificaterequests-approver certificaterequests-issuer-acme certificaterequests-issuer-ca certificaterequests-issuer-selfsigned certificaterequests-issuer-vault certificaterequests-issuer-venafi certificates-issuing certificates-key-manager certificates-metrics certificates-readiness certificates-request-manager certificates-revision-manager certificates-trigger certificatesigningrequests-issuer-acme certificatesigningrequests-issuer-ca certificatesigningrequests-issuer-selfsigned certificatesigningrequests-issuer-vault certificatesigningrequests-issuer-venafi challenges clusterissuers ingress-shim issuers orders]"  
I0805 13:50:04.664161       1 controller.go:115] cert-manager/controller "msg"="starting leader election"  
I0805 13:50:04.665379       1 leaderelection.go:243] attempting to acquire leader lease kube-system/cert-manager-controller...
I0805 13:50:04.666488       1 controller.go:105] cert-manager/controller "msg"="starting metrics server"  "address"={"IP":"::","Port":9402,"Zone":""}
I0805 13:50:04.697836       1 leaderelection.go:253] successfully acquired lease kube-system/cert-manager-controller
I0805 13:50:04.698765       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="clusterissuers" 
I0805 13:50:04.698873       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="orders" 
I0805 13:50:04.699013       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificates-key-manager" 
I0805 13:50:04.698906       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificaterequests-issuer-ca" 
I0805 13:50:04.699084       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificatesigningrequests-issuer-venafi" 
I0805 13:50:04.699122       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificates-request-manager" 
I0805 13:50:04.699163       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificaterequests-approver" 
I0805 13:50:04.699238       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificatesigningrequests-issuer-acme" 
I0805 13:50:04.699263       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificaterequests-issuer-selfsigned" 
I0805 13:50:04.699291       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificatesigningrequests-issuer-vault" 
I0805 13:50:04.699338       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificaterequests-issuer-vault" 
I0805 13:50:04.699409       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificaterequests-issuer-venafi" 
I0805 13:50:04.698974       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificaterequests-issuer-acme" 
I0805 13:50:04.806845       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="issuers" 
I0805 13:50:04.806915       1 controller.go:163] cert-manager/controller "msg"="not starting controller as it's disabled" "controller"="gateway-shim" 
I0805 13:50:04.806942       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="challenges" 
I0805 13:50:04.807132       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificates-revision-manager" 
I0805 13:50:04.807186       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificates-metrics" 
I0805 13:50:04.807242       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificatesigningrequests-issuer-ca" 
I0805 13:50:04.807338       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="ingress-shim" 
I0805 13:50:04.807596       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificates-issuing" 
I0805 13:50:04.809299       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificates-trigger" 
I0805 13:50:04.809682       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificatesigningrequests-issuer-selfsigned" 
I0805 13:50:04.811423       1 controller.go:186] cert-manager/controller "msg"="starting controller" "controller"="certificates-readiness" 
E0805 13:50:04.818364       1 reflector.go:138] external/io_k8s_client_go/tools/cache/reflector.go:167: Failed to watch *v1alpha1.HTTPRoute: failed to list *v1alpha1.HTTPRoute: the server could not find the requested resource (get httproutes.networking.x-k8s.io)
E0805 13:50:05.847301       1 reflector.go:138] external/io_k8s_client_go/tools/cache/reflector.go:167: Failed to watch *v1alpha1.HTTPRoute: failed to list *v1alpha1.HTTPRoute: the server could not find the requested resource (get httproutes.networking.x-k8s.io)
E0805 13:50:08.222605       1 reflector.go:138] external/io_k8s_client_go/tools/cache/reflector.go:167: Failed to watch *v1alpha1.HTTPRoute: failed to list *v1alpha1.HTTPRoute: the server could not find the requested resource (get httproutes.networking.x-k8s.io)
E0805 13:50:13.873670       1 reflector.go:138] external/io_k8s_client_go/tools/cache/reflector.go:167: Failed to watch *v1alpha1.HTTPRoute: failed to list *v1alpha1.HTTPRoute: the server could not find the requested resource (get httproutes.networking.x-k8s.io)
E0805 13:50:20.466389       1 reflector.go:138] external/io_k8s_client_go/tools/cache/reflector.go:167: Failed to watch *v1alpha1.HTTPRoute: failed to list *v1alpha1.HTTPRoute: the server could not find the requested resource (get httproutes.networking.x-k8s.io)
E0805 13:50:34.869864       1 reflector.go:138] external/io_k8s_client_go/tools/cache/reflector.go:167: Failed to watch *v1alpha1.HTTPRoute: failed to list *v1alpha1.HTTPRoute: the server could not find the requested resource (get httproutes.networking.x-k8s.io)
E0805 13:51:18.119829       1 reflector.go:138] external/io_k8s_client_go/tools/cache/reflector.go:167: Failed to watch *v1alpha1.HTTPRoute: failed to list *v1alpha1.HTTPRoute: the server could not find the requested resource (get httproutes.networking.x-k8s.io)
E0805 13:52:00.795658       1 reflector.go:138] external/io_k8s_client_go/tools/cache/reflector.go:167: Failed to watch *v1alpha1.HTTPRoute: failed to list *v1alpha1.HTTPRoute: the server could not find the requested resource (get httproutes.networking.x-k8s.io)
E0805 13:52:53.014760       1 reflector.go:138] external/io_k8s_client_go/tools/cache/reflector.go:167: Failed to watch *v1alpha1.HTTPRoute: failed to list *v1alpha1.HTTPRoute: the server could not find the requested resource (get httproutes.networking.x-k8s.io)


$ kubectl get crds
NAME                                  CREATED AT
certificaterequests.cert-manager.io   2021-08-05T13:50:03Z
certificates.cert-manager.io          2021-08-05T13:50:03Z
challenges.acme.cert-manager.io       2021-08-05T13:50:03Z
clusterissuers.cert-manager.io        2021-08-05T13:50:03Z
issuers.cert-manager.io               2021-08-05T13:50:03Z
orders.acme.cert-manager.io           2021-08-05T13:50:03Z

I installed cert-manager using devel/addon/cert-manager/install.sh, which should have enabled the Gateway feature, but the logs suggest that only the CSR feature was enabled.

And despite that, the logs also show failed attempts to watch resources in httproutes.networking.x-k8s.io ...are those related to Gateway API.

This was using Kubernetes 1.22

@jakexks
jakexks force-pushed the gateway-feature-gate branch from 371aa9f to d4c8aea Compare August 5, 2021 14:12
@jakexks

jakexks commented Aug 5, 2021

Copy link
Copy Markdown
Member Author

Thanks @wallrj. It seems helm requires commas to be escaped, and likewise in the bash script, so , has to become \\,

@jakexks

jakexks commented Aug 5, 2021

Copy link
Copy Markdown
Member Author

There should no longer be any error messages related to the gateway-api when the feature gate is disabled.

I will do some more manual testing but the e2e tests should now pass.

/cherry-pick release-1.5

@jetstack-bot

Copy link
Copy Markdown
Contributor

@jakexks: once the present PR merges, I will cherry-pick it on top of release-1.5 in a new PR and assign it to you.

Details

In response to this:

There should no longer be any error messages related to the gateway-api when the feature gate is disabled.

I will do some more manual testing but the e2e tests should now pass.

/cherry-pick release-1.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jakexks

jakexks commented Aug 5, 2021

Copy link
Copy Markdown
Member Author

/test pull-cert-manager-bazel

maelvls added a commit to maelvls/website that referenced this pull request Aug 5, 2021
This is the feature gate name that was picked in
cert-manager/cert-manager#4310.

Signed-off-by: Maël Valais <[email protected]>
@jakexks
jakexks force-pushed the gateway-feature-gate branch from d82d234 to b4af1af Compare August 6, 2021 10:44
@jakexks
jakexks dismissed wallrj’s stale review August 6, 2021 11:00

Fixed addon install script, gateway API is not touched if the feature gate is not enabled.

@jakexks

jakexks commented Aug 6, 2021

Copy link
Copy Markdown
Member Author

/test pull-cert-manager-bazel

@jakexks

jakexks commented Aug 6, 2021

Copy link
Copy Markdown
Member Author

/test pull-cert-manager-e2e-v1-21

The Gateway annotations tests seem to pass fine for me locally 🤔

@jakexks

jakexks commented Aug 6, 2021

Copy link
Copy Markdown
Member Author

/retest

1 similar comment
@jakexks

jakexks commented Aug 6, 2021

Copy link
Copy Markdown
Member Author

/retest

@wallrj wallrj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @jakexks

I tested locally and saw both the exit with error message situation and the successful startup situation.

/lgtm
/approve

Comment thread cmd/controller/app/controller.go Resolved
Comment thread devel/addon/certmanager/install.sh Resolved
Comment thread devel/addon/certmanager/install.sh Resolved
Comment thread cmd/controller/app/options/options.go Resolved
@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 6, 2021
@jetstack-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jakexks, wallrj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wallrj wallrj mentioned this pull request Aug 6, 2021
@jakexks

jakexks commented Aug 6, 2021

Copy link
Copy Markdown
Member Author

/retest

@jetstack-bot
jetstack-bot merged commit f3ec43f into cert-manager:master Aug 6, 2021
@jetstack-bot jetstack-bot added this to the v1.5 milestone Aug 6, 2021
@jetstack-bot

Copy link
Copy Markdown
Contributor

@jakexks: new pull request created: #4320

Details

In response to this:

There should no longer be any error messages related to the gateway-api when the feature gate is disabled.

I will do some more manual testing but the e2e tests should now pass.

/cherry-pick release-1.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants