Production-Grade Container Scheduling and Management
Go to file
Bryan Boreham a988182f59
'kubectl events' command (#99557)
* Basic scaffolding for kubectl events command

* Simple implementation of 'kubectl events'

* Print event fields

Borrowing code from 'kubectl describe'

* Sort events before printing

* Make output more like 'kubectl get events'

Print namespace if fetching from all

* Refactor: extract print functions

To make it easier to add watch function next.

* Implement watch for new events

Run the list function same as before, so those events come out in order,
then watch from the ResourceVersion after the last event.

* Clear up some lint warnings

* Update description and example text

* refactor: introduce a listOptions variable

* Implement --for option

splitResourceTypeName() function borrowed from cli-runtime because we
need similar behaviour to Builder.ResourceNames(), but applying to
Event.InvolvedObject.

* Add kubectl/pkg/cmd/events to vendor/modules.txt

* Add back cmdutil.Factory

Needed in NewCmdAlpha to construct the 'events' command

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Fix lint

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Make package alias go-cromulent

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Use genericclioptions.RESTClientGetter instead of cmdutil.Factory

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Decode object parameter to GroupVersionKind and name

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Merge two files into one

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Include example for --for option

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Fix inconsistent option name in error message

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Remove unnecessary Validate call

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Use fields from event series

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Support chunking of list of events

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Use watchtools utility to receive watch events

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Split struct into flags and options

Flags represents the inputs from the CLI; options are what the running
command needs. This structure parallels the 'wait' command, and should
be easier to write tests for.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Add some parameters to usage string

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Do only one of list or watch

We tried to print the list first then start a watch after the last
event, but sometimes the server will return "watch is too old" on that
ResourceVersion.
Instead, if we need to watch just start it from the beginning.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Print message if no events found

Also, if watching, don't print the headings until the first event
arrives.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2021-10-29 09:12:50 -07:00
.github Use github forms for issue templates 2021-10-05 09:55:38 -07:00
api Merge pull request #104693 from ravisantoshgudimetla/add-podOS-field 2021-10-28 21:38:50 -07:00
build Merge pull request #105637 from Namanl2001/ssh 2021-10-26 16:33:45 -07:00
CHANGELOG Merge remote-tracking branch 'origin/master' 2021-10-28 01:30:16 +00:00
cluster Use 10250 as targetPort for metrics-server 2021-10-28 03:10:15 +00:00
cmd Merge pull request #105609 from pohly/generic-ephemeral-volume-ga 2021-10-28 17:36:50 -07:00
docs hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
hack Merge pull request #105947 from thockin/worktree-head 2021-10-28 09:21:02 -07:00
LICENSES vendor sigs.k8s.io/json 2021-10-20 13:12:08 -04:00
logo Create colors.md 2021-01-15 22:15:43 -08:00
pkg Merge pull request #104693 from ravisantoshgudimetla/add-podOS-field 2021-10-28 21:38:50 -07:00
plugin Merge pull request #105609 from pohly/generic-ephemeral-volume-ga 2021-10-28 17:36:50 -07:00
staging 'kubectl events' command (#99557) 2021-10-29 09:12:50 -07:00
test Merge pull request #105609 from pohly/generic-ephemeral-volume-ga 2021-10-28 17:36:50 -07:00
third_party Copy golang license to staging copies 2021-08-10 17:37:28 -04:00
vendor 'kubectl events' command (#99557) 2021-10-29 09:12:50 -07:00
.generated_files Purge almost all memories of godep 2020-05-07 21:49:00 -07:00
.gitattributes
.gitignore Rename _examples to examples 2021-01-25 10:20:46 -08:00
CHANGELOG.md
code-of-conduct.md
CONTRIBUTING.md Remove stale analytics links from docs 2020-11-18 07:04:48 -06:00
go.mod upgrade github.com/evanphx/json-patch to v4.12.0 2021-10-26 11:20:45 +08:00
go.sum upgrade github.com/evanphx/json-patch to v4.12.0 2021-10-26 11:20:45 +08:00
LICENSE
Makefile
Makefile.generated_files
OWNERS Move brendandburns to to emeritus status. 2020-08-27 10:20:56 -04:00
OWNERS_ALIASES Merge pull request #104186 from pacoxu/patch-2 2021-10-05 15:24:57 -07:00
README.md Update godoc reference widget to pkg.go.dev 2021-01-26 09:34:07 -05:00
SECURITY_CONTACTS
SUPPORT.md

Kubernetes (K8s)

GoPkg Widget CII Best Practices


Kubernetes, also known as K8s, is an open source system for managing containerized applications across multiple hosts. It provides basic mechanisms for deployment, maintenance, and scaling of applications.

Kubernetes builds upon a decade and a half of experience at Google running production workloads at scale using a system called Borg, combined with best-of-breed ideas and practices from the community.

Kubernetes is hosted by the Cloud Native Computing Foundation (CNCF). If your company wants to help shape the evolution of technologies that are container-packaged, dynamically scheduled, and microservices-oriented, consider joining the CNCF. For details about who's involved and how Kubernetes plays a role, read the CNCF announcement.


To start using K8s

See our documentation on kubernetes.io.

Try our interactive tutorial.

Take a free course on Scalable Microservices with Kubernetes.

To use Kubernetes code as a library in other applications, see the list of published components. Use of the k8s.io/kubernetes module or k8s.io/kubernetes/... packages as libraries is not supported.

To start developing K8s

The community repository hosts all information about building Kubernetes from source, how to contribute code and documentation, who to contact about what, etc.

If you want to build Kubernetes right away there are two options:

You have a working Go environment.
mkdir -p $GOPATH/src/k8s.io
cd $GOPATH/src/k8s.io
git clone https://github.com/kubernetes/kubernetes
cd kubernetes
make
You have a working Docker environment.
git clone https://github.com/kubernetes/kubernetes
cd kubernetes
make quick-release

For the full story, head over to the developer's documentation.

Support

If you need support, start with the troubleshooting guide, and work your way through the process that we've outlined.

That said, if you have questions, reach out to us one way or another.