-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
k8s: Provide fallback for EndpointSlices detection if discovery API is not available #11253
Conversation
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 👍
nit: could you clarify if Update
would get called again? The description comment for this function doesn't necessarily suggest what is the case... Perhaps copying the info from commit message into a comment would be quite helpful also, especially as this is a pretty special case.
I'll update the comment. It doesn't really make sense to call |
67f41e6
to
51b78b6
Compare
test-me-please
|
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.
Discussed with Thomas offline. This requires a flag that does the discovery on a conditional basis
51b78b6
to
eb53fe1
Compare
test-me-please |
eb53fe1
to
46403af
Compare
test-me-please |
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.
To be fair I only noticed the typos because I opened the PR on my IDE.
// K8sAPIDiscoveryEnabled returns true if API discovery of API groups and | ||
// resources is enabled | ||
func (d *DefaultConfiguration) K8sAPIDiscoveryEnabled() bool { | ||
return defaults.K8sEnableAPIDiscovery |
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.
Is this right? Shouldn't this be the value specified by the user?
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.
Yes, this represents the default configuration when no user options are available. This also clearly documents in which cases that happens instead of just relying on pkg/option
which is uninitialized in several cases.
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.
CLI/docs changes LGTM.
Discovery of API groups requires the API services of the apiserver to be healthy. Such API services can depend on the readiness of regular pods which require Cilium to function correctly. By treating failure to discover API groups as fatal, a critial loop can be entered in which Cilium cannot start because the API groups can't be discovered and th API groups will only become discoverable once Cilium is up. Warn about the lack of discovery ability and fall back to probing the API directly. Signed-off-by: Thomas Graf <thomas@cilium.io>
The discovery request consists of several API calls to the apiserver. It has already been observed that the k8s client can stsrt throttling during startup phase. Disable the use of the discovery API by default and rely on individual API probing but allow users to benefit from it by opting into it. Signed-off-by: Thomas Graf <thomas@cilium.io>
46403af
to
9f48402
Compare
test-me-please |
@tgraf @aanm did we intend to mark this for backport to v1.7? Context:
|
@joestringer yes, it should be marked for backport. |
I will backport it in #11233 |
Discovery of API groups requires the API services of the apiserver to be healthy. Such API services can depend on the readiness of regular pods which require Cilium to function correctly. By treating failure to discover API groups as fatal, a critial loop can be entered in which Cilium cannot start because the API groups can't be discovered and the API groups will only become discoverable once Cilium is up.
Warn about the lack of discovery ability and fall back to probing the API directly.