From d7bd6117d5fd62236fdcef6472a9230565367a9e Mon Sep 17 00:00:00 2001 From: Maciej Szulik Date: Mon, 6 Sep 2021 14:12:13 +0200 Subject: [PATCH] Update KEP with new template and PRR --- keps/prod-readiness/sig-cli/1440.yaml | 3 + keps/sig-cli/1440-kubectl-events/README.md | 365 ++++++++++++++++++++- keps/sig-cli/1440-kubectl-events/kep.yaml | 26 +- 3 files changed, 373 insertions(+), 21 deletions(-) create mode 100644 keps/prod-readiness/sig-cli/1440.yaml diff --git a/keps/prod-readiness/sig-cli/1440.yaml b/keps/prod-readiness/sig-cli/1440.yaml new file mode 100644 index 00000000000..fe5dbac8a34 --- /dev/null +++ b/keps/prod-readiness/sig-cli/1440.yaml @@ -0,0 +1,3 @@ +kep-number: 1440 +alpha: + approver: "@wojtek-t" diff --git a/keps/sig-cli/1440-kubectl-events/README.md b/keps/sig-cli/1440-kubectl-events/README.md index 893d632b770..38e92788544 100644 --- a/keps/sig-cli/1440-kubectl-events/README.md +++ b/keps/sig-cli/1440-kubectl-events/README.md @@ -1,29 +1,65 @@ -# kubectl events - -## Table of Contents +# KEP-1440: kubectl events +- [Release Signoff Checklist](#release-signoff-checklist) - [Summary](#summary) - [Motivation](#motivation) - [Limitations of the Existing Design](#limitations-of-the-existing-design) - [Goals](#goals) - [Non-goals](#non-goals) - [Proposal](#proposal) - - [Implementation Details/Notes/Constraints](#implementation-detailsnotesconstraints) + - [User Stories](#user-stories) + - [Risks and Mitigations](#risks-and-mitigations) - [Design Details](#design-details) - [Test Plan](#test-plan) - [Graduation Criteria](#graduation-criteria) - - [Alpha -> Beta Graduation](#alpha---beta-graduation) - - [Beta -> GA Graduation](#beta---ga-graduation) + - [Beta](#beta) + - [GA](#ga) + - [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy) + - [Version Skew Strategy](#version-skew-strategy) +- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire) + - [Feature Enablement and Rollback](#feature-enablement-and-rollback) + - [Rollout, Upgrade and Rollback Planning](#rollout-upgrade-and-rollback-planning) + - [Monitoring Requirements](#monitoring-requirements) + - [Dependencies](#dependencies) + - [Scalability](#scalability) + - [Troubleshooting](#troubleshooting) +- [Implementation History](#implementation-history) +- [Alternatives](#alternatives) +## Release Signoff Checklist + +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) 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 + +[kubernetes.io]: https://kubernetes.io/ +[kubernetes/enhancements]: https://git.k8s.io/enhancements +[kubernetes/kubernetes]: https://git.k8s.io/kubernetes +[kubernetes/website]: https://git.k8s.io/website + ## Summary Presently, `kubectl get events` has some limitations. It cannot be extended to meet the increasing user needs to support more functionality without impacting the `kubectl get`. This KEP proposes a new command `kubectl events` which will help address the existing issues and enhance the `events` functionality to accommodate more features. -For eg: Any modification to `--watch` functionality for `events` will also change the `--watch` for `kubectl get` since the `events` is dependent of `kubectl get` +For example: Any modification to `--watch` functionality for `events` will also change +the `--watch` for `kubectl get` since the `events` is dependent of `kubectl get` Some of the requested features for events include: @@ -78,10 +114,21 @@ Following is a list of long standing issues for `events` Have an independent *events* sub-command which can perform all the existing tasks that the current `kubectl get events`, and most importantly will extend the `kubectl get events` functionality to address the existing issues. -### Implementation Details/Notes/Constraints +### User Stories + +* As an application developer I want to view all the events related to a particular resource. +* As an application developer I want to watch for a particular event taking place. +* As an application developer I want to filter all warning events happening in a particular namespace. + +### Risks and Mitigations + +None. + +## Design Details The above use-cases call for the addition of several flags, that would act as filtering mechanisms for events, and would work in tandem with the existing --watch flag: + - Add a new `--watch-event=[]` flag that allows users to subscribe to particular events, filtering out any other event kind - Add a new `--watch-until=EventType` flag that would cause the `--watch` flag to behave as normal, but would exit the command as soon as the specified event type is received. - Add a new `--watch-for=pod/bar flag` that would filter events to only display those pertaining to the specified resource. A non-existent resource would cause an error. This flag could further be used with the `--watch-until=EventType` flag to watch events for the resource specified, and then exit as soon as the specified `EventType` is seen for that particular resource. @@ -89,8 +136,6 @@ and would work in tandem with the existing --watch flag: Additionally, the new command should support all the printing flags available in `kubectl get`, such as specifying output format, sorting as well as re-use server-side printing mechanism. -## Design Details - ### 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. @@ -99,9 +144,305 @@ In addition to standard unit tests for kubectl, the events command will be relea Once the experimental kubectl events command is implemented, this can be rolled out in multiple phases. -##### Alpha -> Beta Graduation +##### Beta - [ ] Gather the feedback, which will help improve the command - [ ] Extend with the new features based on feedback -##### Beta -> GA Graduation +##### GA - [ ] Address all major issues and bugs raised by community members + +### Upgrade / Downgrade Strategy + +This functionality is contained entirely within `kubectl` and shares its +strategy. No configuration changes are required. + +### Version Skew Strategy + +`kubectl events` will be using only GA features of the `Events` API from kube-apiserver, +so there should be no problems with Version Skew. + +## Production Readiness Review Questionnaire + +### Feature Enablement and Rollback + +###### How can this feature be enabled / disabled in a live cluster? + +- [ ] Feature gate (also fill in values in `kep.yaml`) + - Feature gate name: + - Components depending on the feature gate: +- [X] Other + - Describe the mechanism: + A new command in `kubectl alpha` + - Will enabling / disabling the feature require downtime of the control + plane? + No + - Will enabling / disabling the feature require downtime or reprovisioning + of a node? (Do not assume `Dynamic Kubelet Config` feature is enabled). + No + +###### Does enabling the feature change any default behavior? + +It's a new command so there's no default behavior in kubectl. If a user +has installed a plugin named "events", that plugin will be masked by the +new `kubectl events` command. This is a known issue with kubectl plugins, +and it's being addressed separately by sig-cli, likely by detecting this +condition and printing a warning. + +###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)? + +Yes, you could roll back to a previous release of `kubectl`. + +###### What happens if we reenable the feature if it was previously rolled back? + +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 + +### Rollout, Upgrade and Rollback Planning + + + +###### How can a rollout or rollback fail? Can it impact already running workloads? + + + +###### What specific metrics should inform a rollback? + + + +###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested? + + + +###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.? + + + +### Monitoring Requirements + + + +###### How can an operator determine if the feature is in use by workloads? + + + +###### 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: + +###### What are the reasonable SLOs (Service Level Objectives) for the enhancement? + + + +###### 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: + +###### Are there any missing metrics that would be useful to have to improve observability of this feature? + + + +### Dependencies + + + +###### Does this feature depend on any specific services running in the cluster? + + + +### Scalability + + + +###### Will enabling / using this feature result in any new API calls? + + + +###### Will enabling / using this feature result in introducing new API types? + + + +###### Will enabling / using this feature result in any new calls to the cloud provider? + + + +###### Will enabling / using this feature result in increasing size or count of the existing API objects? + + + +###### Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs? + + + +###### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components? + + + +### Troubleshooting + + + +###### How does this feature react if the API server and/or etcd is unavailable? + +###### What are other known failure modes? + + + +###### What steps should be taken if SLOs are not being met to determine the problem? + +## Implementation History + +- *2020-01-16* - Initial KEP draft +- *2021-09-06* - Updated KEP with the new template and mark implementable for alpha implementation. + +## Alternatives + +Currently available alternative exist in `kubectl describe` command and has been +described in [Limitations of the Existing Design](#limitations-of-the-existing-design). diff --git a/keps/sig-cli/1440-kubectl-events/kep.yaml b/keps/sig-cli/1440-kubectl-events/kep.yaml index 92994767f19..ea418741406 100644 --- a/keps/sig-cli/1440-kubectl-events/kep.yaml +++ b/keps/sig-cli/1440-kubectl-events/kep.yaml @@ -5,22 +5,30 @@ authors: owning-sig: sig-cli participating-sigs: - sig-cli +status: implementable +creation-date: 2019-10-08 reviewers: - "@soltysh" - "@pwittrock" approvers: - "@soltysh" - "@pwittrock" -editor: TBD -creation-date: 2019-10-08 -last-updated: 2020-01-27 -status: implementable + see-also: - https://docs.google.com/document/d/1w-HRLtMncDAL_yQQJdHDasyCZRdJTOV1N6y22fGsKkY/edit# -replaces: - - -superseded-by: - - +replaces: [] -latest-milestone: "0.0" stage: "alpha" + +latest-milestone: "1.23" + +milestone: + alpha: "v1.23" + beta: "v1.25" + stable: "v1.26" + +feature-gates: [] +disable-supported: false + +# The following PRR answers are required at beta release +metrics: []