diff --git a/keps/prod-readiness/sig-cli/1440.yaml b/keps/prod-readiness/sig-cli/1440.yaml index fe5dbac8a34..9d0c4f844e1 100644 --- a/keps/prod-readiness/sig-cli/1440.yaml +++ b/keps/prod-readiness/sig-cli/1440.yaml @@ -1,3 +1,5 @@ kep-number: 1440 alpha: approver: "@wojtek-t" +beta: + approver: "@wojtek-t" diff --git a/keps/sig-cli/1440-kubectl-events/README.md b/keps/sig-cli/1440-kubectl-events/README.md index 38e92788544..ecd89ad1737 100644 --- a/keps/sig-cli/1440-kubectl-events/README.md +++ b/keps/sig-cli/1440-kubectl-events/README.md @@ -12,6 +12,10 @@ - [Risks and Mitigations](#risks-and-mitigations) - [Design Details](#design-details) - [Test Plan](#test-plan) + - [Prerequisite testing updates](#prerequisite-testing-updates) + - [Unit tests](#unit-tests) + - [Integration tests](#integration-tests) + - [e2e tests](#e2e-tests) - [Graduation Criteria](#graduation-criteria) - [Beta](#beta) - [GA](#ga) @@ -35,17 +39,17 @@ Items marked with (R) are required *prior to targeting to a milestone / release* - [x] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR) - [x] (R) KEP approvers have approved the KEP status as `implementable` - [x] (R) Design details are appropriately documented -- [ ] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors) - - [ ] e2e Tests for all Beta API Operations (endpoints) - - [ ] (R) Ensure GA e2e tests for meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md) - - [ ] (R) Minimum Two Week Window for GA e2e tests to prove flake free +- [x] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors) + - [x] e2e Tests for all Beta API Operations (endpoints) + - [x] (R) Ensure GA e2e tests for meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md) + - [x] (R) Minimum Two Week Window for GA e2e tests to prove flake free - [x] (R) Graduation criteria is in place - [x] (R) [all GA Endpoints](https://github.com/kubernetes/community/pull/1806) must be hit by [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md) - [x] (R) Production readiness review completed - [x] (R) Production readiness review approved - [x] "Implementation History" section is up-to-date for milestone -- [ ] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io] -- [ ] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes +- [x] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io] +- [x] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes [kubernetes.io]: https://kubernetes.io/ [kubernetes/enhancements]: https://git.k8s.io/enhancements @@ -102,7 +106,7 @@ Following is a list of long standing issues for `events` ### Goals -- Add an experimental `events` sub-command under the kubectl +- Add an new `events` sub-command under the kubectl - Address existing issues mentioned above ### Non-goals @@ -122,7 +126,8 @@ and most importantly will extend the `kubectl get events` functionality to addre ### Risks and Mitigations -None. +Accessing events to which users don't have access to. This should be mitigated by a proper RBAC rules +allowing access based on a need to know principle. ## Design Details @@ -138,17 +143,41 @@ Additionally, the new command should support all the printing flags available in ### Test Plan -In addition to standard unit tests for kubectl, the events command will be released as a kubectl alpha subcommand, signaling users to expect instability. During the alpha phase we will gather feedback from users that we expect will improve the design of debug and identify the Critical User Journeys we should test prior to Alpha -> Beta graduation. +[x] I/we understand the owners of the involved components may require updates to +existing tests to make this code solid enough prior to committing the changes necessary +to implement this enhancement. + +##### Prerequisite testing updates + +Before any additional functional updates we need to ensure the current functionality +is properly cover with unit and integration (`test/cmd`) tests. +Before promoting to beta at least a single e2e test should also be added in +`k8s.io/kubernetes/test/e2e/kubectl/kubectl.go`. + +##### Unit tests + +- `k8s.io/kubectl/pkg/cmd/events`: `2022-09-21` - `36.6%` + +##### Integration tests + +- `k8s.io/kubernetes/test/cmd/events.sh`: [test-cmd.run_kubectl_events_tests](https://testgrid.k8s.io/sig-release-master-blocking#integration-master) + +##### e2e tests + +- missing ### Graduation Criteria Once the experimental kubectl events command is implemented, this can be rolled out in multiple phases. ##### Beta -- [ ] Gather the feedback, which will help improve the command -- [ ] Extend with the new features based on feedback + +- [x] Add e2e tests, increase unit coverage. +- [x] Gather the feedback, which will help improve the command +- [x] Extend with the new features based on feedback ##### GA + - [ ] Address all major issues and bugs raised by community members ### Upgrade / Downgrade Strategy @@ -172,7 +201,7 @@ so there should be no problems with Version Skew. - Components depending on the feature gate: - [X] Other - Describe the mechanism: - A new command in `kubectl alpha` + A new sub-command in `kubectl` - Will enabling / disabling the feature require downtime of the control plane? No @@ -198,249 +227,115 @@ There will be explicit command for retrieving events. ###### Are there any tests for feature enablement/disablement? -No, because it cannot be disabled or enabled in a single release +No, because it cannot be disabled or enabled in a single release. ### Rollout, Upgrade and Rollback Planning - +None, kubectl rollout requires just shipping a new binary. ###### How can a rollout or rollback fail? Can it impact already running workloads? - +A wrong binary might be delivered. ###### What specific metrics should inform a rollback? - +There are no metrics to follow. ###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested? - +E2E which will be added with beta promotion will allow us to verify if the command +behaves correctly during upgrade and downgrade. ###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.? - +The `kubectl alpha events` is being moved under `kubectl events`. Invoking the old +location will print a warning that this command moved. ### Monitoring Requirements - +None. ###### How can an operator determine if the feature is in use by workloads? - +There is no way cluster operator to differentiate between `kubectl get events` and `kubectl events` +invocations since both invoke a GET operation on Events endpoint. ###### How can someone using this feature know that it is working for their instance? - - -- [ ] Events - - Event Reason: -- [ ] API .status - - Condition name: - - Other field: -- [ ] Other (treat as last resort) - - Details: +`kubectl events` should be returning events similar to `kubectl get events`. ###### What are the reasonable SLOs (Service Level Objectives) for the enhancement? - +None. ###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service? - - -- [ ] Metrics - - Metric name: - - [Optional] Aggregation method: - - Components exposing the metric: -- [ ] Other (treat as last resort) - - Details: +- [x] Other (treat as last resort) + - Details: invoking `kubectl events` returns data in a timely manner ###### Are there any missing metrics that would be useful to have to improve observability of this feature? - +None. ### Dependencies - +None. ###### Does this feature depend on any specific services running in the cluster? - +None. ### Scalability - - ###### Will enabling / using this feature result in any new API calls? - +No new API calls are expected if compared with `kubectl get events`. ###### Will enabling / using this feature result in introducing new API types? - +No. ###### Will enabling / using this feature result in any new calls to the cloud provider? - +No. ###### Will enabling / using this feature result in increasing size or count of the existing API objects? - +No. ###### Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs? - +No. ###### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components? - +No. ### Troubleshooting - - ###### How does this feature react if the API server and/or etcd is unavailable? +Running `kubectl events` with unavailable API server and/or etcd will result +in an error reported to user stating that the cluster is not available. + ###### What are other known failure modes? - +- [No events] + - Detection: Invoking `kubectl events` does not return any events. + - Mitigations: Use `kubectl get events` instead. + - Diagnostics: Compare with the output of `kubectl get events`. It's possible that + there are no events in given namespace. Alternatively, use different namespace + with `--namespace` flag. ###### What steps should be taken if SLOs are not being met to determine the problem? +None. + ## Implementation History - *2020-01-16* - Initial KEP draft - *2021-09-06* - Updated KEP with the new template and mark implementable for alpha implementation. +- *2022-09-21* - Updated KEP for beta promotion. ## Alternatives diff --git a/keps/sig-cli/1440-kubectl-events/kep.yaml b/keps/sig-cli/1440-kubectl-events/kep.yaml index ea418741406..64805eba861 100644 --- a/keps/sig-cli/1440-kubectl-events/kep.yaml +++ b/keps/sig-cli/1440-kubectl-events/kep.yaml @@ -2,6 +2,7 @@ title: Kubectl events kep-number: 1440 authors: - "@hpandeycodeit" + - "soltysh" owning-sig: sig-cli participating-sigs: - sig-cli @@ -10,6 +11,7 @@ creation-date: 2019-10-08 reviewers: - "@soltysh" - "@pwittrock" + - "@ardaguclu" approvers: - "@soltysh" - "@pwittrock" @@ -18,14 +20,14 @@ see-also: - https://docs.google.com/document/d/1w-HRLtMncDAL_yQQJdHDasyCZRdJTOV1N6y22fGsKkY/edit# replaces: [] -stage: "alpha" +stage: "beta" -latest-milestone: "1.23" +latest-milestone: "1.26" milestone: alpha: "v1.23" - beta: "v1.25" - stable: "v1.26" + beta: "v1.26" + stable: "v1.27" feature-gates: [] disable-supported: false