-
Notifications
You must be signed in to change notification settings - Fork 6
Add status k8s converters and k8s status update code #1138
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
Conversation
5664045 to
9ef72be
Compare
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.
Pull request overview
This PR adds status update functionality to the gateway agent CRD in Kubernetes agentless mode. The implementation enables periodic status reporting and fixes a bug where the same configuration generation would be repeatedly applied.
Key changes:
- Introduces separate K8s client tasks for configuration watching and status updates
- Adds status conversion infrastructure to translate internal dataplane status to K8s format
- Implements status patching mechanism with periodic updates
Reviewed changes
Copilot reviewed 16 out of 25 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| mgmt/src/processor/launch.rs | Adds K8sClient initialization and spawns separate tasks for config watching and status updates |
| mgmt/src/processor/k8s_client.rs | Implements K8sClient struct with methods for config watching, status updates, and generation tracking |
| k8s-intf/src/client.rs | Adds patch_gateway_status function to update K8s gateway status |
| k8s-intf/build.rs | Fixes type conversions for unsigned integer fields in generated code |
| config/src/internal/status/mod.rs | Adds test infrastructure and TypeGenerator implementations for status types |
| config/src/converters/k8s/status/*.rs | Implements conversions from internal status types to K8s format |
| config/src/converters/k8s/mod.rs | Reorganizes module structure to separate config and status conversions |
| config/src/converters/k8s/config/*.rs | Updates imports after module reorganization |
| config/Cargo.toml | Adds chrono dependency for timestamp handling |
9ef72be to
0d9f906
Compare
b0c6d7a to
2fd7b2f
Compare
2fd7b2f to
a56b8d3
Compare
6c946d3 to
fa03fcf
Compare
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.
Pull request overview
Copilot reviewed 19 out of 28 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
mgmt/src/processor/k8s_client.rs:1
- Setting k8s_status_handle to None here is inconsistent with the handling of other task handles. The processor_handle and k8s_config_handle are not explicitly set to None after they complete. Either all handles should be set to None for consistency, or this line should be removed since the loop break condition at line 285 already checks is_none() for all handles.
// SPDX-License-Identifier: Apache-2.0
0e730fe to
4547758
Compare
Due to shortocmings in openapi v3's integer types, kopium does not generate the correct types for u64 fields. Fix this. Signed-off-by: Manish Vachharajani <[email protected]>
Moves all the code to convert configuration objects to/from k8s into a subdirectory in preparation for code to convert to/from k8s status objects. Signed-off-by: Manish Vachharajani <[email protected]>
Signed-off-by: Manish Vachharajani <[email protected]>
4547758 to
ef45481
Compare
ef45481 to
57bd770
Compare
|
Added don't merge while addressing @Frostman's verbal comment that we should replace status not patch it. |
Signed-off-by: Manish Vachharajani <[email protected]>
57bd770 to
f5e2ac7
Compare
|
K8s interaction lgtm |
daniel-noland
left a comment
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.
I don't love the number of free functions, but on the whole I would call this a solid improvement.
I think this type of code would be more clear and significantly more flexible if we put some of these methods on structs / traits.
I also see what you mean about needing some functions from tokio regarding task completion.
I will look into that, but I don't want to hold up the good in search of perfect so I will approve for now but look into improvement options for later
Adds a tokio task to periodically update the status directly with the k8s API. Also patches the status whenever a new config generation is applied. Also fixes an issue where the same config generation was repeatedly applied. Signed-off-by: Manish Vachharajani <[email protected]>
ring is fine for rustls but aws-lc-rs has better formal verification and is now preferred. This commit also adds the OpenSSL license to permitted licenses since aws-lc-rs uses code with this license. This commit also adds the OpenSSL and SSLeay statement to NOTICE. Signed-off-by: Manish Vachharajani <[email protected]>
f5e2ac7 to
785409c
Compare
Do not merge until #1131 is mergedThis PR adds status updates to the gateway agent CRD objects. It also fixes a small bug related to repeated application of the same config generation.
Testing is once again manual as this mode is not active by default in vlab tests. We should switch vlab to agentless mode after this PR merges.
or if desired for this PR itself.