Commit Graph

28 Commits

Author SHA1 Message Date
Davanum Srinivas d3700ce217 Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: a9593d634c6a053848413e600dadbf974627515f
2022-07-19 20:54:13 -04:00
Lee Verberne 3e07021378 Fix incorrect message when attaching to ephemeral containers
Kubernetes-commit: 8d4ec9ac9dcf45b66111075a1b67043c2885b263
2022-07-15 19:23:24 +02:00
Maciej Szulik 6707e9d96c Improve run and debug attach message upon failure
Kubernetes-commit: 43c2ae479f056f9e420062e11f3251b7095c3108
2022-06-24 09:07:44 +02:00
Jian Zeng f125772691 feat(kubectl): add debug profile applier
Signed-off-by: Jian Zeng <anonymousknight96@gmail.com>

Kubernetes-commit: fd0c15cce3d66bc2b32fc6943688425ec269d97d
2021-11-12 00:57:02 +08:00
jlsong01 ec9d0484e5 add a warning printer in cli-runtime to coordinate warning style
modified:   staging/src/k8s.io/kubectl/pkg/cmd/auth/auth.go

Kubernetes-commit: 272e245f06e425fc912b1e477e8b6763850b161e
2022-02-18 20:33:38 +08:00
Arda Güçlü 81a25f37b5 Set validate functions requiring no parameters for all commands
Validate function is used to validate command options and should not get
any additional parameter. To preserve compatibility across all
kubectl commands, this PR removes all parameters in validate functions.

Kubernetes-commit: 8fb423bfabe0d53934cc94c154c7da2dc3ce1332
2022-05-17 11:38:20 +03:00
Lee Verberne 3d7e4b3f7f Print kubectl debug messages received when starting a container (#108591)
* kubectl debug: print container messages

This provides feedback to the user, for example that the server is
unable to pull the debug container image.

* Label debug container updates as warnings

Co-authored-by: Eddie Zaneski <eddiezane@gmail.com>

Co-authored-by: Eddie Zaneski <eddiezane@gmail.com>

Kubernetes-commit: 90956e6d3e9df02d932f9954911b89a3fd1619fb
2022-03-10 02:41:45 +00:00
wawa0210 11174082b3 fix kubectl alpha debug node does not work on tainted nodes
Kubernetes-commit: 3ec63238c53ae3a7185db210e94494d850def3d4
2021-01-26 23:36:35 +08:00
Lee Verberne 7b8558da71 Add backwards compatibility for kubectl debug
The ephemeral containers API changed in 1.22. As a result, kubectl
debug (currently) cannot create ephemeral containers in clusters prior
to 1.22.

This change causes kubectl to retry the request using the old API when
it receives a specific error message from the server.

Kubernetes-commit: 06124c1d1c68ec4a30406bf585df2ec83231cb65
2021-06-28 18:19:50 +02:00
Lee Verberne 119802affe Warn user for runtime support of debug targeting
Add a warning message to `kubectl debug` when using the `--target`
option as many runtimes don't support it yet.

Kubernetes-commit: 968185e1f7c4aee739d5abe6133a690c70e87d5e
2021-04-13 15:50:26 +02:00
Lee Verberne 46887fb25e Address feedback for new /ephemeralcontainers API
* Use deep copies in `PrepareForUpdate()`
* Preserve select metadata from new pod
* Use patch to add ephemeral container `kubectl debug`
* Distinguish between pod vs /ephemeralcontainers NotFound

Kubernetes-commit: 97726a50c138557522def7f753ec8581d00f0b02
2021-04-14 18:40:42 +02:00
Lee Verberne 7fd8647b0d Switch ephemeralcontainers SR to Pod Kind
This changes the `/ephemeralcontainers` subresource of `/pods` to use
the `Pod` kind rather than `EphemeralContainers`.

When designing this API initially it seemed preferable to create a new
kind containing only the pod's ephemeral containers, similar to how
binding and scaling work.

It later became clear that this made admission control more difficult
because the controller wouldn't be presented with the entire Pod, so we
updated this to operate on the entire Pod, similar to how `/status`
works.

Kubernetes-commit: d22dc5cb72a627341f4004b5d58d275f3d8773b3
2021-04-09 13:53:13 +02:00
xiongzhongliang b0de341b90 Remove kubectl alpha debug command in 1.21
Kubernetes-commit: e650a8a38c30ff3707292c060613acdb0714b2ec
2021-01-16 20:17:22 +08:00
xiongzhongliang ceb5d08972 add -q as shorthand for --quiet
Kubernetes-commit: a7e15c7606d24f0ff11c5ddf05f3cbc6ab891e16
2020-12-31 19:18:17 +08:00
Lee Verberne 4dec993ea4 kubectl debug: allow set-image-only invocation
Kubernetes-commit: d6024ce18dd66de2ebe076afa5b33ae4fcfbee67
2020-11-05 13:40:11 +01:00
Lee Verberne 5ed93efa24 Remove alpha from kubectl debug
Kubernetes-commit: 30262e9b14e2369528fd27241adb16fae02f684d
2020-11-04 16:30:49 +01:00
Lee Verberne fdd6fda024 kubectl debug: Allow mutating image names
Kubernetes-commit: ee9f11b95f01b32dade5d8dc7329625c40ac0e63
2020-10-30 18:23:34 +01:00
Lee Verberne 6a3c6f9a42 kubectl debug: add tests for Complete,Validate
Kubernetes-commit: 3cfcf3a74fc24e6b4b3f58710fe454d1bc3644cc
2020-10-30 08:54:13 +01:00
wawa0210 c1aa9082c9 Keep the imagePullPolicy of kubectl alpha debug consistent with the default
Kubernetes-commit: 6709d4f93855d485f6a809237efbdc1951fbc30a
2020-09-19 11:46:41 +08:00
Lee Verberne 9e9322bdd6 Update the use message for kubectl debug
The command now supports type syntax similar to `kubectl get`.

Kubernetes-commit: 40904c7a7de4bcb050030eaf53dfb21c3f076ae9
2020-09-23 15:06:16 +02:00
Kiyoshi Muranaka 5457c2b27c Fix index out of range panic for kubectl alpha debug
Fix containerNameToRef func to get init containers and ephemeral containers properly.

Set EphemeralContainers in generatePodCopyWithDebugContainer func to nil which means
dropping ephemeral containers from a copy of pod so that it can be created successfully,
otherwise it is rejected by the API server.

Kubernetes-commit: bf3dfaf99942eab20fac1570ca0146d32cb93b57
2020-09-07 02:43:21 +09:00
Lee Verberne 63b6f85e5d kubectl debug: add support for debugging nodes
When called with a node target, `kubectl debug` will create a run-once
pod in the target node's namespaces.

Kubernetes-commit: 7e63cc8b9d592abbb8a659205555e67b57080837
2020-04-03 18:36:32 +02:00
Aylei c73a3aa1bf Add debug by copy support for kubectl alpha debug command
Signed-off-by: Aylei <rayingecho@gmail.com>

Update staging/src/k8s.io/kubectl/pkg/cmd/debug/debug.go

Co-Authored-By: Lee Verberne <lee@verb.is>

Apply suggestions from code review

Co-Authored-By: Lee Verberne <lee@verb.is>

Kubernetes-commit: cfece3edfe8a726fc5dc65ef89b89021316837c7
2020-04-13 01:58:36 +08:00
Davanum Srinivas 445ad1366b switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 442a69c3bdf6fe8e525b05887e57d89db1e2f3a5
2020-04-17 15:25:06 -04:00
wojtekt 5b27ac0ca2 Fix the flaky kubectl tests at scale
Kubernetes-commit: 98058a1b68da3726e1110dc8bba3838459d03b29
2020-04-23 22:05:55 +02:00
Kazuki Suda 736b43aee9 Fix missing a shorthand for container flag of kubectl alpha debug
Kubernetes-commit: fca1027dd6d69ca7c5b3dd54059c29b2c8d04762
2020-03-31 12:15:17 +09:00
Lee Verberne c401716d75 kubectl debug: support different kinds
This is a refactor ahead of adding support for supporting `kubectl debug` of nodes.

Kubernetes-commit: 8414d180feb9ddb0d4b9b80ea8e570dcacf98703
2020-04-03 14:31:18 +02:00
Lee Verberne c3d84a9e1c Add kubectl debug alpha command
This first version of `kubectl alpha debug` is an import of the existing
kubectl-debug plugin, which supports adding ephemeral containers to
running pods. This attempts to follow patterns used by other kubectl
commands such as run, exec and scale.

Kubernetes-commit: e5b655938e55e0404545ff73e9239593a27a3272
2020-01-31 15:29:31 +01:00