It wasn't documented that InitLogs already uses the log flush frequency, so some commands have called it before parsing (for example, kubectl in the original code for logs.go). The flag never had an effect in such commands. Fixing this turned into a major refactoring of how commands set up flags and run their Cobra command: - component-base/logs: implicitely registering flags during package init is an anti-pattern that makes it impossible to use the package in commands which want full control over their command line. Logging flags must be added explicitly now, something that the new cli.Run does automatically. - component-base/logs: AddFlags would have crashed in kubectl-convert if it had been called because it relied on the global pflag.CommandLine. This has been fixed and kubectl-convert now has the same --log-flush-frequency flag as other commands. - component-base/logs/testinit: an exception are tests where flag.CommandLine has to be used. This new package can be imported to add flags to that once per test program. - Normalization of the klog command line flags was inconsistent. Some commands unintentionally didn't normalize to the recommended format with hyphens. This gets fixed for sample programs, but not for production programs because it would be a breaking change. This refactoring has the following user-visible effects: - The validation error for `go run ./cmd/kube-apiserver --logging-format=json --add-dir-header` now references `add-dir-header` instead of `add_dir_header`. - `staging/src/k8s.io/cloud-provider/sample` uses flags with hyphen instead of underscore. - `--log-flush-frequency` is not listed anymore in the --logging-format flag's `non-default formats don't honor these flags` usage text because it will also work for non-default formats once it is needed. - `cmd/kubelet`: the description of `--logging-format` uses hyphens instead of underscores for the flags, which now matches what the command is using. - `staging/src/k8s.io/component-base/logs/example/cmd`: added logging flags. - `apiextensions-apiserver` no longer prints a useless stack trace for `main` when command line parsing raises an error. |
||
---|---|---|
.github | ||
api | ||
build | ||
CHANGELOG | ||
cluster | ||
cmd | ||
docs | ||
hack | ||
LICENSES | ||
logo | ||
pkg | ||
plugin | ||
staging | ||
test | ||
third_party | ||
vendor | ||
.generated_files | ||
.gitattributes | ||
.gitignore | ||
CHANGELOG.md | ||
code-of-conduct.md | ||
CONTRIBUTING.md | ||
go.mod | ||
go.sum | ||
LICENSE | ||
Makefile | ||
Makefile.generated_files | ||
OWNERS | ||
OWNERS_ALIASES | ||
README.md | ||
SECURITY_CONTACTS | ||
SUPPORT.md |
Kubernetes (K8s)

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.