Skip to content

Conversation

remyleone
Copy link

@remyleone remyleone commented Aug 21, 2025

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR adds support for compiling kubectl to webassembly. With both js and wasip1.

From a product perspective, having a kubectl inside a browser to perform some actions would be quite cool and would also help for training environment :) It would allow to spawn from the browser a version of kubectl that would not require an external shell/VM to run. It would be run in the browser.

Which issue(s) this PR is related to:

#128853

Special notes for your reviewer:

This is preliminary work to ensure that the compilation step is passing. Maybe other PRs will come to fix particular behaviours that are happening in the context.

I'm not familiar about how to specify a new target only for webassembly and kubectl. Obviously it makes no sense to have kubelet and other binaries supported in this OS/Arch for the time being.

At the time being there are two issues:

  1. For GOOS=js we do not have access to the filesystem and that is a problem because kubectl needs to do a syscall to open a kubeconfig on the filesystem. One possible solution would be to have kubectl reading the entire kubeconfig from an environement variable inside the webassembly. This would be distinct from today as currently kubectl only reads path and perform an open. We would need to have an environment variable such as KUBECONFIG_INLINE/KUBECONFIG_RAW.
  2. For GOOS=wasip1 we do not have access to the terminal therefore all the code in moby/term would not work natively and it would need to be handle by polyfills in the browser. This would theoretically remove the need to have support for loading kubeconfig from an environment variable.

Does this PR introduce a user-facing change?

User would be able to run kubectl in a browser that support webassembly which is pretty cool and would open new usage for running commands without requiring any pre-installation regardless of the platform.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

@k8s-ci-robot
Copy link
Contributor

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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. kind/feature Categorizes issue or PR as related to a new feature. labels Aug 21, 2025
@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.34 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.34.0 release.

Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Thu Aug 21 08:00:27 UTC 2025.

@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Aug 21, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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 needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. labels Aug 21, 2025
@k8s-ci-robot k8s-ci-robot added area/kubectl sig/cli Categorizes an issue or PR as relevant to SIG CLI. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Aug 21, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in SIG CLI Aug 21, 2025
@remyleone
Copy link
Author

Upstream PR for term moby/term#49

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 25, 2025
@k8s-ci-robot k8s-ci-robot added sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. labels Aug 25, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: remyleone
Once this PR has been reviewed and has the lgtm label, please assign liggitt for approval. For more information see the Code Review Process.

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

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
Copy link
Contributor

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

Test name Commit Details Required Rerun command
pull-kubernetes-dependencies c2c063d link true /test pull-kubernetes-dependencies
pull-kubernetes-cmd c2c063d link true /test pull-kubernetes-cmd
pull-kubernetes-e2e-gce c2c063d link true /test pull-kubernetes-e2e-gce
pull-kubernetes-typecheck c2c063d link true /test pull-kubernetes-typecheck
pull-kubernetes-conformance-kind-ga-only-parallel c2c063d link true /test pull-kubernetes-conformance-kind-ga-only-parallel
pull-kubernetes-e2e-kind c2c063d link true /test pull-kubernetes-e2e-kind
pull-kubernetes-e2e-capz-windows-master c2c063d link false /test pull-kubernetes-e2e-capz-windows-master
pull-kubernetes-node-e2e-containerd c2c063d link true /test pull-kubernetes-node-e2e-containerd
pull-kubernetes-linter-hints c2c063d link false /test pull-kubernetes-linter-hints
pull-kubernetes-unit c2c063d link true /test pull-kubernetes-unit
pull-kubernetes-unit-windows-master c2c063d link false /test pull-kubernetes-unit-windows-master
pull-kubernetes-integration c2c063d link true /test pull-kubernetes-integration
pull-kubernetes-verify c2c063d link true /test pull-kubernetes-verify

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.

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.

@aaron-prindle
Copy link
Contributor

/cc @soltysh
/remove-sig api-machinery
/sig cli

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Aug 26, 2025
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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
area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/feature Categorizes issue or PR as related to a new feature. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
Status: Needs Triage
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

3 participants