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 API definition files for Cilium. It includes the OpenAPI definition files and other related files.
AUTHORS - This file contains a list of authors of the Cilium project.
bpf/ - This directory contains the BPF (Berkeley Packet Filter) code for Cilium. It includes the source code for various BPF programs, tests, and licensing files.
bugtool/ - This directory contains the tools used for debugging and analyzing issues in Cilium. It includes the source code for the tools and Makefiles.
clustermesh-apiserver/ - This directory contains the source code for the Clustermesh API server. It includes various subdirectories for different components of the API server.
CODE_OF_CONDUCT.md - This file contains the code of conduct for the Cilium project.
CODEOWNERS - This file contains a list of people responsible for reviewing and approving changes to the Cilium project.
contrib/ - This directory contains various contributions to the Cilium project. It includes subdirectories for different types of contributions, such as backporting, scripts, and testing.
CONTRIBUTING.md - This file contains instructions for contributing to the Cilium project.
daemon/ - This directory contains the source code for the Cilium daemon. It includes various subdirectories for different components of the daemon, such as cmd, k8s, and restapi.
Documentation/ - This directory contains all the documentation for the Cilium project. It includes API documentation, user guides, installation instructions, and other related files.
examples/ - This directory contains various examples of how to use Cilium. It includes subdirectories for different types of examples, such as crds, hubble, and kubernetes.
FURTHER_READINGS.rst - This file contains links to further reading materials related to the Cilium project.
go.mod - This file contains the Go module dependencies for Cilium.
go.sum - This file contains the checksums for the Go module dependencies for Cilium.
hack/ - This directory contains various hacking or development-related files. It includes files for SPDX copyright headers and custom boilerplate code.
hubble-relay/ - This directory contains the source code for the Hubble relay. It includes various subdirectories for different components of the relay, such as cmd and main.go.
images/ - This directory contains various Docker images used by Cilium. It includes subdirectories for different types of images, such as builder, cache, and operator.
install/ - This directory contains various installation-related files for Cilium. It includes subdirectories for different types of installations, such as kubernetes and operator.
LICENSE - This file contains the license for the Cilium project.
MAINTAINERS.md - This file contains a list of maintainers for the Cilium project.
Makefile - This file contains the Makefile for building and installing Cilium.
netlify.toml - This file contains the configuration for deploying Cilium to Netlify.
operator/ - This directory contains the source code for the Cilium operator. It includes various subdirectories for different components of the operator, such as api, auth, and k8s.
pkg/ - This directory contains various packages used by Cilium. It includes subdirectories for different types of packages, such as alignchecker, annotation, and auth.
plugins/ - This directory contains various plugins for Cilium. It includes subdirectories for different types of plugins, such as cilium-cni and cilium-docker.
README.rst - This file contains the main documentation for the Cilium project.
SECURITY-INSIGHTS.yml - This file contains information about security vulnerabilities in Cilium.
SECURITY.md - This file contains general security information for the Cilium project.
stable.txt - This file contains a list of stable releases of Cilium.
test/ - This directory contains various test files for Cilium. It includes subdirectories for different types of tests, such as bigtcp, bpf, and k8s.
tools/ - This directory contains various tools used by Cilium. It includes subdirectories for different types of tools, such as alignchecker and protobuf.
USERS.md - This file contains information for users of the Cilium project.
vagrant_box_defaults.rb - This file contains the default configuration for Vagrant boxes used by Cilium.
Vagrantfile - This file contains the configuration for using Vagrant to run Cilium.
vendor/ - This directory contains various third-party packages used by Cilium. It includes subdirectories for different vendors, such as github.com and go.etcd.io.
VERSION - This file contains the version number of Cilium.

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.

bugtool/main.go - The entrypoint for the bug tool with the `main` function.
cilium-dbg/main.go - The entrypoint for the Cilium debugger with the `main` function.
cilium-health/main.go - The entrypoint for the Cilium health checker with the `main` function.
cilium-health/responder/main.go - The entrypoint for the Cilium health responder with the `main` function.
clustermesh-apiserver/main.go - The entrypoint for the ClusterMesh API server with the `main` function.
daemon/main.go - The main entrypoint for the Cilium daemon with the `main` function.
hubble-relay/main.go - The entrypoint for the Hubble relay with the `main` function.
images/builder/debug-wrapper.go - This file has the entrypoint for the debug wrapper with the `main` function.
operator/main.go - The entrypoint for the Cilium operator with the `main` function.
pkg/hive/example/main.go - The entrypoint for the Hive example with the `main` function.
pkg/hive/example/mini/main.go - The entrypoint for the Hive mini example with functions `NewA`, `NewB`, `showB`, and `main`.
pkg/k8s/resource/example/main.go - This file has the entrypoint for the Kubernetes resource example with the `main` function and `newPrintServices`.
pkg/statedb/example/main.go - The entrypoint for the StateDB example with functions `main` and `reportHealth`.
pkg/statedb/reconciler/benchmark/main.go - The entrypoint for the StateDB reconciler benchmark with the `main` function.
pkg/statedb/reconciler/example/main.go - This file has the entrypoint for the StateDB reconciler example with functions like `main`, `NewReconcilerConfig`, and `registerHTTPServer`.
plugins/cilium-cni/main.go - The entrypoint for the Cilium CNI plugin with functions `init` and `main`.
plugins/cilium-docker/main.go - This file contains the entrypoint for the Cilium Docker plugin with functions such as `main`, `init`, `initConfig`, and `createPluginSock`.
tools/alignchecker/main.go - The entrypoint for the align checker with the `main` function.
tools/api-flaggen/main.go - The entrypoint for the API flag generator with functions like `wrap`, `writeTable`, `writeFlagPreamble`, `writeTitle`, `printAPIFlagTables`, and `main`.
tools/crdcheck/main.go - The entrypoint for the CRD checker with functions `main`, `checkForCategory`, and `sliceContains`.
tools/crdlistgen/main.go - The entrypoint for the CRD list generator with functions `printCRDList`, `grepFile`, `cleanupCRDName`, and `main`.
tools/dev-doctor/main.go - The entrypoint for the development doctor with the `main` function.
tools/licensecheck/main.go - The entrypoint for the license checker with functions `main`, `check`, and `isAllowedLicense`.
tools/licensegen/licensegen.go - The entrypoint for the license generator with the `main` function.
tools/mount/main.go - The entrypoint for the mount tool with the `main` function.
tools/spdxconv/main.go - The entrypoint for the SPDX converter with the `main` function.
tools/sysctlfix/main.go - The entrypoint for the sysctl fix tool with the `main` function.