feat(k8s): discovery uses EndpointSlices instead of Endpoints#740
feat(k8s): discovery uses EndpointSlices instead of Endpoints#740andrewazores merged 11 commits intocryostatio:mainfrom
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 ✅ |
0bf3a25 to
d01b031
Compare
d01b031 to
823aa15
Compare
|
/build_test |
|
Workflow started at 4/17/2025, 4:15:02 PM. View Actions Run. |
|
No OpenAPI schema changes detected. |
|
No GraphQL schema changes detected. |
|
CI build and push: All tests pass ✅ |
happens when an EndpointSlice object has no Ports, for example the cryostat-agent headless callback service
|
/build_test |
|
Workflow started at 5/14/2025, 11:34:41 AM. View Actions Run. |
|
No GraphQL schema changes detected. |
|
No OpenAPI schema changes detected. |
|
CI build and push: All tests pass ✅ |
Welcome to Cryostat! 👋
Before contributing, make sure you have:
mainbranch[chore, ci, docs, feat, fix, test]To recreate commits with GPG signature
git fetch upstream && git rebase --force --gpg-sign upstream/mainFixes: #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'sMakefiletomake sample_appto 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.enabledswitch)EndpointSlicesdiscovery. 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 scalecommand on different sample applications in each namespace to test the behaviour It should behave the same way as usual with target lost/found events.