-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat(k8s): discovery uses EndpointSlices instead of Endpoints #740
base: main
Are you sure you want to change the base?
Conversation
7ecf948
to
7067272
Compare
/build_test |
Workflow started at 12/20/2024, 9:28:27 AM. View Actions Run. |
No GraphQL schema changes detected. |
No OpenAPI schema changes detected. |
CI build and push: At least one test failed ❌ |
^ failures are expected at this point since there are two side-by-side Kubernetes discovery mechanisms. Once this is reviewed and I clean it up those tests should go back to passing. |
7067272
to
8c3c606
Compare
/build_test |
Workflow started at 3/21/2025, 4:18:21 PM. View Actions Run. |
No GraphQL schema changes detected. |
No OpenAPI schema changes detected. |
CI build and push: At least one test failed ❌ |
/build_test |
Workflow started at 3/21/2025, 4:33:25 PM. View Actions Run. |
No OpenAPI schema changes detected. |
No GraphQL schema changes detected. |
CI build and push: All tests pass ✅ |
Welcome to Cryostat! 👋
Before contributing, make sure you have:
main
branch[chore, ci, docs, feat, fix, test]
To recreate commits with GPG signature
git fetch upstream && git rebase --force --gpg-sign upstream/main
Fixes: #717
Description of the change:
Replaces the Kubernetes API discovery mechanism's usage of the older Endpoints with the newer EndpointSlices. This should be functionally identical to the end Cryostat user and should record the same results in the database, it's only a slight internal logic change.
For early review and testing purposes, this PR currently retains the oldEndpoints
-based implementation and adds the newEndpointSlices
-based implementation as a separate discovery plugin/realm, which is enabled by a different config property. This is so that it's possible to enable both at the same time on the same Cryostat instance and verify that they behave identically. Once that is validated then I will clean up this PR so that the new implementation simply replaces the old one as an internal implementation detail.Motivation for the change:
This is a newer Kubernetes API feature and may have some performance benefits (fewer discovery update events?).~~ It opens the door for future improvements like using the EndpointSlices' readiness property to either gate target discoveryability, or to include that readiness data in the target record.~~ The EndpointSlices' "conditions" are embedded into the target definition as Cryostat annotations, ie. the target's readiness state can be determined.
How to manually test:
cryostat
,apps1
, andapps2
. In each, use the Operator'sMakefile
tomake sample_app
to install a sample application to each namespacekubectl scale -n apps2 deployment quarkus-test --replicas=2
$ helm install --set core.image.repository=quay.io/andrewazores/cryostat --set core.image.tag=endpoint-slices-4 --set core.route.enabled=true --set core.discovery.kubernetes.namespaces='{cryostat,apps1,apps2}' --set core.discovery.kubernetes.enabled=true cryostat ./charts/cryostat
(if not using OpenShift, turn off thecore.route.enabled
switch)EndpointSlices
discovery. When using the new discovery mechanism there should also be Cryostat annotations visible in the Topology view indicating the slices' conditions, ie readiness/serving/terminating:kubectl scale
command on different sample applications in each namespace to test the behaviour It should behave the same way as usual with target lost/found events.