Back to Architecture Explorer

kubernetes / kubernetes

Production-Grade Container Scheduling and Management.

111.0k
Go
Architecture: platform
main
kubernetes
cmd
kube-apiserver
kubelet
kube-scheduler
pkg
api
controller
kubelet
scheduler
staging
src
api
test
e2e
integration
hack
go.mod
Structural Architecture

Kubernetes follows the standard Go project layout at very large scale. Each binary gets a thin entry point under cmd, the real implementation lives under pkg, and the staging directory holds libraries that are published as separate public modules while still being developed inside this repository.

  • cmd holds thin entry points only; logic lives in pkg.
  • staging solves the problem of shipping public libraries from a monorepo.
  • Unit tests colocated with source, while integration and e2e live in a dedicated tree.

Notable Directories

/cmd

Entry points for each binary, such as kube-apiserver, kubelet, and kube-scheduler.

/pkg

The bulk of the implementation, organised by component and responsibility.

/staging/src/k8s.io

Libraries published as independent modules but developed in-tree, then mirrored out.

/test

Integration and end-to-end suites, separate from the unit tests that sit beside the code.

Build Your Own Ecosystem

Learn from kubernetes's structure and craft your own software scaffolding.