-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
test: Use Endpoint instead of EndpointSlice in 1.17 #15010
Conversation
GKE keeps EndpointSlice controller disabled by default on 1.17 clusters. This change causes tests to use `Endpoint` object instead of `EndpointSlice` on 1.17 clusters. Signed-off-by: Maciej Kwiek <maciej@isovalent.com>
test-me-please |
Also required for v1.9: https://datastudio.google.com/s/pp3gaU0V6DQ. |
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.
We have this code that performs the detection of endpoint slices being or not being enabled in the kube-apiserver.
cilium/pkg/k8s/version/version.go
Lines 178 to 205 in 0135e67
func endpointSlicesFallbackDiscovery(client kubernetes.Interface) error { | |
// 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. | |
// | |
// Here we acknowledge the lack of discovery ability as non Fatal and fall back to probing | |
// the API directly. | |
_, err := client.DiscoveryV1beta1().EndpointSlices("default").Get(context.TODO(), "kubernetes", metav1.GetOptions{}) | |
if err == nil { | |
cached.mutex.Lock() | |
cached.capabilities.EndpointSlice = true | |
cached.mutex.Unlock() | |
return nil | |
} | |
if errors.IsNotFound(err) { | |
log.WithError(err).Info("Unable to retrieve EndpointSlices for default/kubernetes. Disabling EndpointSlices") | |
// StatusNotFound is a safe error, EndpointSlices are | |
// disabled and the agent can continue. | |
return nil | |
} | |
// Unknown error, we can't derive whether to enable or disable | |
// EndpointSlices and need to error out. | |
return fmt.Errorf("unable to validate EndpointSlices support: %s", err) | |
} |
We need to understand if that is not enough.
@aanm This bug is currently breaking all GKE builds. Maybe we can merge this and track the apparent bug in the endpoint-slice detection separately? |
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 offline, this is a bug in our tests as we expect the EndpointSlice to be available in 1.17 which is not the case for GKe.
GKE keeps EndpointSlice controller disabled by default on 1.17 clusters.
This change causes tests to use
Endpoint
object instead ofEndpointSlice
on 1.17 clusters.fixes #14996