Skip to content
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

Support the "ephemeralcontainers" subresource in edit, get, patch, and replace #117490

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dlipovetsky
Copy link
Contributor

@dlipovetsky dlipovetsky commented Apr 19, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

Allows kubectl users to use commands with the ephemeralcontainers subresource.

For example, kubectl debug does not allow a user to patch the ephemeral container's security context. An alternative is to use kubectl patch, e..g.: As of 1.27, kubectl debug allows the user to use "profiles" to set the ephemeral container's security context. But kubectl patch is useful for additional customization of ephemeral containers, and that's enabled by this PR.

kubectl patch pod/example --subresource=ephemeralcontainers --patch '{"spec":{"ephemeralContainers":[{"image":"docker.io/busybox:1.36.0","name":"test","command":["sleep"
],"args":["infinity"],"tty":true,"stdin":true,"securityContext":{"capabilities":{"add":["SYS_PTRACE"]}},"targetContainerName":"example"}]}}'

The above example works with this PR, but fails in master.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

I'm not sure that the "supported subresources" constraint is necessary. If I can make a case for removing it, I'll file a separate PR.

Does this PR introduce a user-facing change?

Added the `ephemeralcontainers` subresource to the kubectl `edit`, `get`, `patch`, and `replace` commands. 

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


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. 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. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 19, 2023
@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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. 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 Apr 19, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dlipovetsky
Once this PR has been reviewed and has the lgtm label, please assign eddiezane for approval. For more information see the Kubernetes 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

@dlipovetsky
Copy link
Contributor Author

/cc @verb

@k8s-ci-robot k8s-ci-robot requested a review from verb April 19, 2023 21:30
@dlipovetsky
Copy link
Contributor Author

/test pull-kubernetes-e2e-kind

@k8s-triage-robot
Copy link

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

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten 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 sig-contributor-experience at kubernetes/community.

/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 Jan 19, 2024
@dlipovetsky
Copy link
Contributor Author

/remove-lifecycle stale

I've added this PR to the sig-CLI office hours agenda for this week.

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 23, 2024
@dlipovetsky
Copy link
Contributor Author

From @soltysh in today's SIG CLI office hours: This PR needs to consider the KEP that introduced the --subresources flag (https://github.com/kubernetes/enhancements/tree/master/keps/sig-cli/2590-kubectl-subresource#summary). The PR makes sense if ephemeralcontainers is a subresource in the same way that status and scale are, and whether they are or not is not clear.

Also from today's SIG CLI office hours: @ardaguclu mentioned a proposed KEP (kubernetes/enhancements#4293) to provide "custom" profiles to kubectl debug. If the KEP is accepted, it likely satisfies the use case that motivates this PR. But this PR might be valid even if the KEP is implemented.

@k8s-triage-robot
Copy link

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

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten 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 sig-contributor-experience at kubernetes/community.

/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 Apr 23, 2024
@k8s-triage-robot
Copy link

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

This bot triages PRs according to the following rules:

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

You can:

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

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 23, 2024
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. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

None yet

3 participants