Skip to content

Conversation

@mvachhar
Copy link
Contributor

@mvachhar mvachhar commented Dec 13, 2025

Do not merge until #1131 is merged

This 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.

@mvachhar mvachhar added this to the GW R2 milestone Dec 13, 2025
@mvachhar mvachhar self-assigned this Dec 13, 2025
@mvachhar mvachhar added dont-merge Do not merge this Pull Request ci:-upgrade Disable VLAB upgrade tests ci:-vlab Disable VLAB tests labels Dec 13, 2025
@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct-4 branch 2 times, most recently from 5664045 to 9ef72be Compare December 13, 2025 22:26
@mvachhar mvachhar added dont-merge Do not merge this Pull Request and removed dont-merge Do not merge this Pull Request ci:-upgrade Disable VLAB upgrade tests ci:-vlab Disable VLAB tests labels Dec 13, 2025
@mvachhar mvachhar marked this pull request as ready for review December 13, 2025 22:40
@mvachhar mvachhar requested a review from a team as a code owner December 13, 2025 22:40
Copy link
Contributor

Copilot AI left a 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

@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct-4 branch from 9ef72be to 0d9f906 Compare December 13, 2025 22:45
@mvachhar mvachhar changed the title Pr/mvachhar/k8s direct 4 Add status k8s converters and k8s status update code Dec 14, 2025
@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct-4 branch from b0c6d7a to 2fd7b2f Compare December 14, 2025 14:26
Base automatically changed from pr/mvachhar/k8s-direct-3 to main December 14, 2025 15:04
@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct-4 branch from 2fd7b2f to a56b8d3 Compare December 14, 2025 18:11
@mvachhar mvachhar removed the dont-merge Do not merge this Pull Request label Dec 14, 2025
@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct-4 branch 4 times, most recently from 6c946d3 to fa03fcf Compare December 15, 2025 16:08
@mvachhar mvachhar requested a review from Copilot December 15, 2025 16:15
Copy link
Contributor

Copilot AI left a 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

@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct-4 branch 2 times, most recently from 0e730fe to 4547758 Compare December 15, 2025 16:42
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]>
@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct-4 branch from 4547758 to ef45481 Compare December 15, 2025 16:43
@mvachhar mvachhar added the enhancement New feature or request label Dec 15, 2025
@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct-4 branch from ef45481 to 57bd770 Compare December 15, 2025 17:13
@mvachhar mvachhar added the dont-merge Do not merge this Pull Request label Dec 15, 2025
@mvachhar
Copy link
Contributor Author

Added don't merge while addressing @Frostman's verbal comment that we should replace status not patch it.

@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct-4 branch from 57bd770 to f5e2ac7 Compare December 15, 2025 20:02
@mvachhar mvachhar removed the dont-merge Do not merge this Pull Request label Dec 15, 2025
@Frostman
Copy link
Member

K8s interaction lgtm

Copy link
Collaborator

@daniel-noland daniel-noland left a 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]>
@mvachhar mvachhar force-pushed the pr/mvachhar/k8s-direct-4 branch from f5e2ac7 to 785409c Compare December 15, 2025 22:45
@mvachhar mvachhar enabled auto-merge December 15, 2025 23:17
@mvachhar mvachhar added this pull request to the merge queue Dec 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 16, 2025
@mvachhar mvachhar added this pull request to the merge queue Dec 16, 2025
Merged via the queue into main with commit 720ba71 Dec 16, 2025
30 of 32 checks passed
@mvachhar mvachhar deleted the pr/mvachhar/k8s-direct-4 branch December 16, 2025 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants