-
Notifications
You must be signed in to change notification settings - Fork 3.4k
gateway-api: Check for required CRDs upon startup #28982
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Currently, if the required CRDs are not installed, Cilium Operator will just crash due to the below error. This commit is to perform pre-flight check, and avoid the crash. ``` 2023-11-03T11:53:45.585078169Z level=fatal msg="failed to start: failed to create gateway controller: failed to get API group resources: unable to retrieve the complete list of server APIs: gateway.networking.k8s.io/v1: the server could not find the requested resource" subsys=cilium-operator-generic ``` Signed-off-by: Tam Mach <tam.mach@cilium.io>
/ci-gateway-api |
1 similar comment
/ci-gateway-api |
/test |
meyskens
approved these changes
Nov 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
mhofstetter
added a commit
to mhofstetter/cilium
that referenced
this pull request
Nov 7, 2023
…sing PR cilium#28982 introduced the check for Gateway API CRDs at the startup of the Cilium Operator. If the CRDs aren't present - Gateway API controllers aren't registered the the error is logged. This behaviour might be irritating for the user as the operator doesn't behave as expected. It's only obvious AFTER analysing the logs. Therefore, this commit lets the Operator initialization fail with a more meainingful error message than before. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
mhofstetter
added a commit
to mhofstetter/cilium
that referenced
this pull request
Nov 7, 2023
PR cilium#28982 introduced the check for Gateway API CRDs at the startup of the Cilium Operator. If the CRDs aren't present - Gateway API controllers aren't registered the the error is logged. This behaviour might be irritating for the user as the operator doesn't behave as expected. It's only obvious AFTER analysing the logs. Therefore, this commit lets the Operator initialization fail with a more meainingful error message than before. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
mhofstetter
added a commit
to mhofstetter/cilium
that referenced
this pull request
Nov 7, 2023
PR cilium#28982 introduced a check for Gateway API CRDs at the startup of the Cilium Operator. If the CRDs aren't present - Gateway API controllers aren't registered the error is logged. This behaviour might be irritating for the user as the operator doesn't behave as expected. It's only obvious AFTER analysing the logs. Therefore, this commit lets the Operator initialization fail with a more meainingful error message than before. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
mhofstetter
added a commit
to mhofstetter/cilium
that referenced
this pull request
Nov 7, 2023
PR cilium#28982 introduced a check for Gateway API CRDs at the startup of the Cilium Operator. If the CRDs aren't present - Gateway API controllers aren't registered the error is logged. This behaviour might be irritating for the user as the operator doesn't behave as expected. It's only obvious AFTER analysing the logs. Therefore, this commit lets the Operator initialization fail with a more meainingful error message than before. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
mhofstetter
added a commit
to mhofstetter/cilium
that referenced
this pull request
Nov 28, 2023
With cilium#28982 a check got introduced that disables the Gateway API functionality if the required Gateway API CRDs aren't installed in the cluster. But this check is not executed when the secret sync registrations is performed. This results in failures in the secret-sync: ``` level=error msg="kind must be registered to the Scheme" error="no kind is registered for the type v1.Gateway in scheme \"k8s.io/client-go/kubernetes/scheme/register.go:80\"" logger=controller-runtime.source.EventHandler subsys=controller-runtime ``` Therefore, this commit adds the check to the secret sync registration too. Fixes: cilium#29100 Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
github-merge-queue bot
pushed a commit
that referenced
this pull request
Nov 30, 2023
With #28982 a check got introduced that disables the Gateway API functionality if the required Gateway API CRDs aren't installed in the cluster. But this check is not executed when the secret sync registrations is performed. This results in failures in the secret-sync: ``` level=error msg="kind must be registered to the Scheme" error="no kind is registered for the type v1.Gateway in scheme \"k8s.io/client-go/kubernetes/scheme/register.go:80\"" logger=controller-runtime.source.EventHandler subsys=controller-runtime ``` Therefore, this commit adds the check to the secret sync registration too. Fixes: #29100 Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
pjablonski123
pushed a commit
to pjablonski123/cilium
that referenced
this pull request
Dec 15, 2023
With cilium#28982 a check got introduced that disables the Gateway API functionality if the required Gateway API CRDs aren't installed in the cluster. But this check is not executed when the secret sync registrations is performed. This results in failures in the secret-sync: ``` level=error msg="kind must be registered to the Scheme" error="no kind is registered for the type v1.Gateway in scheme \"k8s.io/client-go/kubernetes/scheme/register.go:80\"" logger=controller-runtime.source.EventHandler subsys=controller-runtime ``` Therefore, this commit adds the check to the secret sync registration too. Fixes: cilium#29100 Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
feature/k8s-gateway-api
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, if the required CRDs are not installed, Cilium Operator will just crash due to the below error. This commit is to perform pre-flight check, and avoid the crash.