Codebase

Navigate the Codebase using the tree view. Use the filters to highlight where various files are grouped to aid understanding.

Getting Started Commands

Project Structure

Below is a short description of the key directories of the project to aid you when understanding where key files are located.

api - This directory contains the Kubernetes API definition and implementation. It includes subdirectories like api-rules, discovery, and openapi-spec that define the API schema, discovery, and OpenAPI specification.
build - This directory contains the build scripts and configurations for Kubernetes components. It includes subdirectories like build-image, lib, pause, and server-image that build different parts of Kubernetes, such as images, libraries, and server components.
cluster - This directory contains the configuration and management scripts for Kubernetes clusters. It includes subdirectories like addons, gce, images, kubemark, log-dump, pre-existing, skeleton, and windows. The addons subdirectory contains Kubernetes add-ons, such as cloud controllers, network plugins, and storage plugins.
cmd - This directory contains the command-line interface (CLI) tools for Kubernetes, such as clicheck, cloud-controller-manager, dependencycheck, dependencyverifier, and kubectl.
hack - This directory contains development scripts and tools for the Kubernetes project. It includes subdirectories like boilerplate, conformance, e2e-internal, gen-swagger-doc, jenkins, lib, make-rules, testdata, and tools.
pkg - This directory contains the Go packages for Kubernetes components. It includes subdirectories like api, apis, auth, capabilities, client, cluster, controller, controlplane, credentialprovider, features, fieldpath, generated, kubeapiserver, kubectl, kubemark, printers, probe, proxy, quota, registry, routes, scheduler, security, serviceaccount, util, volume, and windows. These packages define and implement various Kubernetes features and components.
plugin - This directory contains the plugins for Kubernetes, such as admission plugins and auth plugins. It includes subdirectories like pkg and auth.
test - This directory contains the test scripts and configurations for Kubernetes components. It includes subdirectories like cmd, conformance, e2e, fixtures, fuzz, images, kubemark, e2e_kubeadm, e2e_node, and utils.

Entrypoints

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/clicheck/check_cli_conventions.go - Contains the main function for checking CLI conventions.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/cloud-controller-manager/main.go - Contains the main function for the cloud-controller-manager.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/dependencycheck/dependencycheck.go - Contains the main function for dependency checking.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/dependencyverifier/dependencyverifier.go - Contains functions for dependency verification and the main function.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/fieldnamedocscheck/field_name_docs_check.go - Contains the main function for checking field names and documentation.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/gendocs/gen_kube_docs.go - Contains the main function for generating Kubernetes documentation.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/genkubedocs/gen_kube_docs.go - Contains the main function for generating Kubernetes documentation.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/genman/gen_kube_man.go - Contains the main function for generating Kubernetes man pages.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/genswaggertypedocs/swagger_type_docs.go - Contains the main function for generating Swagger type documents.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/genyaml/gen_kubectl_yaml.go - Contains the main function for generating YAML files for kubectl.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/gotemplate/gotemplate.go - Contains the main function for generating Go templates.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/import-boss/main.go - Contains functions for import boss and the main function.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/importverifier/importverifier.go - Contains functions for import verification and the main function.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/kube-apiserver/apiserver.go - Contains the main function for the kube-apiserver.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/kube-controller-manager/controller-manager.go - Contains the main function for the kube-controller-manager.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/kube-proxy/proxy.go - Contains the main function for the kube-proxy.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/kube-scheduler/scheduler.go - Contains the main function for the kube-scheduler.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/kubeadm/kubeadm.go - Contains the main function for kubeadm.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/kubectl-convert/kubectl-convert.go - Contains the main function for converting kubectl output formats.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/kubectl/kubectl.go - Contains the main function for kubectl.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/kubelet/kubelet.go - Contains the main function for the kubelet.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/kubemark/hollow-node.go - Contains the main function for the kubemark hollow node.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/preferredimports/preferredimports.go - Contains functions for preferred imports and the main function.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/prune-junit-xml/prunexml.go - Contains functions for pruning JUnit XML files and the main function.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

cmd/yamlfmt/yamlfmt.go - Contains the main function for formatting YAML files.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

hack/conformance/check_conformance_test_requirements.go - Checks conformance test requirements with functions like checkAllProviders, processFile, processDir, newCommand, and main.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

hack/tools/ncpu/main.go - Contains the main function for the ncpu tool.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

pkg/generated/openapi/cmd/models-schema/main.go - Contains the main function for generating OpenAPI schema files.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

staging/src/k8s.io/sample-cli-plugin/cmd/kubectl-ns.go - Contains the main function for the sample CLI plugin.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/conformance/image/go-runner/main.go - Contains the main function for running conformance tests in containers.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/conformance/walk.go - Contains functions for walking through test files and checking conformance with functions like main, isConformance, getTestInfo, getTestName, saveAllTestInfo, getConformanceData, scanFileForFrame, validateTestName, tryCommentGroupAndFrame, shouldProcessCommentGroup, and commentToConformanceData.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/e2e_node/environment/conformance.go - Contains functions for checking conformance in the test environment and the main function.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/e2e_node/plugins/gcp-credential-provider/main.go - Contains the main function for testing the GCP credential provider plugin.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/e2e_node/runner/local/run_local.go - Contains functions for running tests locally and the main function.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/e2e_node/runner/remote/run_remote.go - Contains functions for running tests remotely and the main function.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/e2e/dra/test-driver/dra-test-driver.go - Contains the main function for the DRA test driver.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/images/agnhost/agnhost.go - Contains the main function for testing the AGNHOST image.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/images/apparmor-loader/loader.go - Contains functions for loading profiles and the main function for testing the apparmor-loader image.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/images/busybox/hostname.go - Contains functions for getting the outbound IP and the main function for testing the hostname image.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/images/nonewprivs/nnp.go - Contains the main function for testing the nonewprivs image.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/images/pets/peer-finder/peer-finder.go - Contains functions for peer lookup and shelling out, and the main function for testing the peer-finder image.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/images/regression-issue-74839/main.go - Contains the main function for testing regression issue 74839.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/images/resource-consumer/consume-cpu/consume_cpu_windows.go - Contains functions for testing CPU consumption on Windows.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/images/resource-consumer/consume-cpu/consume_cpu.go - Contains functions for testing CPU consumption.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/images/resource-consumer/resource_consumer.go - Contains the main function for testing resource consumption.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/images/sample-device-plugin/sampledeviceplugin.go - Contains functions for stubbing functions and creating CDI files, and the main function for testing the sample device plugin.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/instrumentation/documentation/main.go - Contains functions for generating documentation with functions like main, byStabilityLevel, and parseMinor.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/instrumentation/main.go - Contains functions for instrumenting Go code with functions like findGOOS, main, searchPathForStableMetrics, searchFileForStableMetrics, getLocalNameOfImportedPackage, addFileInformationToErrors, globalVariableDeclarations, findPkgDir, and importedGlobalVariableDeclaration.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/instrumentation/sort/main.go - Contains the main function for sorting Go files.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/integration/benchmark/extractlog/main.go - Contains functions for extracting log files and the main function for benchmarking.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/integration/benchmark/jsonify/main.go - Contains functions for jsonifying data and the main function for benchmarking.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/list/main.go - Contains functions for listing files with functions like collect, funcName, isSprintf, makeWalker, and main.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/soak/serve_hostnames/serve_hostnames.go - Contains the main function for serving hostnames in the test/soak directory.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/typecheck/main.go - Handles type checking with functions like newConfig, verify, accumulate, dedup, serialFprintf, resolvePkgs, and main.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/typecheck/testdata/bad/bad.go - Contains the main function for testing bad code samples.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/typecheck/testdata/good/_ignore/bad.go - Contains the main function for testing bad code samples.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/typecheck/testdata/good/good.go - Contains the main function for testing good code samples.

Below are files we identified as entrypoints for to the codebase. This is where the application starts and a good place to start when learning.

test/typecheck/testdata/good/testdata/bad.go - Contains the main function for testing bad code samples within testdata/good directory.