Skip to content

Add support for extensions in the deploy-to-kube script#204

Closed
igooch wants to merge 3 commits intokubernetes-sigs:mainfrom
igooch:deploy-extensions
Closed

Add support for extensions in the deploy-to-kube script#204
igooch wants to merge 3 commits intokubernetes-sigs:mainfrom
igooch:deploy-extensions

Conversation

@igooch
Copy link
Copy Markdown
Contributor

@igooch igooch commented Dec 9, 2025

The deploy-to-kube script is a critical tool for development, but its initial implementation was too rigid, making it difficult to deploy different controller configurations, such as enabling the extension controllers. The script lacked the ability to selectively apply manifests, and its monolithic structure made it hard to maintain and extend.

This PR addresses these issues by refactoring the deploy-to-kube script to be more modular, readable, and allow for deploying the controller with extensions enabled.

Key Changes:

  • Added --extensions flag: A new --extensions flag allows developers to easily deploy the controller with the extension manifests enabled.
  • Code Refactor: The entire script has been refactored into separate, well-documented functions (gather_manifests, process_manifests, apply_manifests). This improves readability, maintainability, and makes future modifications easier.

Notes for reviewer:

To deploy to the agent-sandbox controller with extensions enabled onto your cluster using your local development code run:
./dev/tools/push-images --image-prefix={YOUR_REPO_PATH/} and then
./dev/tools/deploy-to-kube --image-prefix={YOUR_REPO_PATH/} --extensions.

Alternatively, use EXTENSIONS=true make deploy-kind to create and deploy onto a Kind cluster.

Fixes #120

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 9, 2025
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @igooch. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 9, 2025
@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 9, 2025

Deploy Preview for agent-sandbox canceled.

Name Link
🔨 Latest commit 9932c97
🔍 Latest deploy log https://app.netlify.com/projects/agent-sandbox/deploys/698a37e4a6ff3a0008105d20

@igooch
Copy link
Copy Markdown
Contributor Author

igooch commented Dec 9, 2025

@tomergee @sdowell @justinsb PTAL

Comment thread dev/tools/deploy-to-kube

def main(args):
repo_root = utils.get_repo_root()
def gather_manifests(manifests_path):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason I feel the original implementation is cleaner? Do we need to spilt it into 3 functions? For readability, maybe we can just add a comment on top of the main function to describe what the code was doing and regard that as enough?

Or if you have a reason for why splitting it into 3 functions is better?

Copy link
Copy Markdown
Contributor

@justinsb justinsb Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this new approach very nice, the functions are self-documenting and they also have extensive function documents. I also hope that we might be able to move more of the functions into shared helpers, so this feels like a good step towards that.

I think that you should compare the original implementation with support for extensions to the new code. I can see how once we add extensions the original implementation will get messier.

Personally I think it's a good step in the right direction, I'd like to see e.g. whether we could make process_manifests more generic, but that's not a blocker for this work, more just my (personally) preferred direction for the future.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! @justinsb

@janetkuo
Copy link
Copy Markdown
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 16, 2025
Comment thread dev/tools/deploy-to-kube Outdated
continue

# When extensions is enabled, we use a the extensions controller manifest instead.
if args.extensions and filename == "controller.yaml" and kind == "StatefulSet":
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is slightly brittle if the file is renamed or if multiple controller files exist. This also assumes file names follow certain convention (e.g. start with extensions). Also, we might change the controller to a Deployment in #191.

Also, we plan to change controller manifests in core/extensions in the future: #192

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated to use the metadata name instead of the file name. Ready for re-review.

Comment thread dev/tools/deploy-to-kube Outdated
@igooch igooch force-pushed the deploy-extensions branch from caeea0f to cfc3d78 Compare February 9, 2026 19:28
@peterzhongyi
Copy link
Copy Markdown
Contributor

Looks good to me!

@janetkuo janetkuo self-assigned this Feb 17, 2026
Copy link
Copy Markdown
Member

@janetkuo janetkuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 17, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: igooch, janetkuo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 17, 2026
@janetkuo
Copy link
Copy Markdown
Member

@igooch would you take a look at the test failures?

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@igooch: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
presubmit-agent-sandbox-e2e-test 9932c97 link true /test presubmit-agent-sandbox-e2e-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@janetkuo janetkuo assigned igooch and unassigned janetkuo Feb 19, 2026
@janetkuo
Copy link
Copy Markdown
Member

@igooch please reassign to me after the test failure is fixed

@k8s-triage-robot
Copy link
Copy Markdown

The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 30d of inactivity, lifecycle/stale is applied
  • After 15d of inactivity since lifecycle/stale was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to us at Agent Sandbox.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 21, 2026
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 21, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@barney-s
Copy link
Copy Markdown
Collaborator

barney-s commented Apr 2, 2026

is this still valid (required) ? @igooch ?
If so please rebase

@barney-s
Copy link
Copy Markdown
Collaborator

barney-s commented Apr 2, 2026

Closing this out since it is stale

@aditya-shantanu
Copy link
Copy Markdown
Collaborator

/close

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@aditya-shantanu: Closed this PR.

Details

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Manifest for deploying with controller extensions

8 participants