Building and Starting Cilium
This document outlines the steps required to build and start the Cilium project.
Prerequisites
- Go: Ensure you have Go installed and configured correctly.
- Docker: Docker is required for building and running Cilium.
- Kubernetes: If you plan to use Cilium within a Kubernetes environment, you will need a Kubernetes cluster installed.
Building Cilium
Clone the repository:
git clone https://github.com/cilium/cilium.git cd cilium
Build the project:
make build
This will build the cilium binary, the Hubble Relay binary, and the Container Operator binary.
Build the container images:
make build-container
This will build the container images for Cilium, Hubble Relay, and the Container Operator.
Starting Cilium
Start the Cilium daemon:
sudo cilium --enable-ipv4 --enable-ipv6 --enable-policy --enable-k8s-api
This command will start the Cilium daemon in the foreground with several options enabled. You can customize the options to match your specific needs.
Install the Container Operator:
make install-container-binary-operator
This will install the Container Operator on your system.
Install the Hubble Relay:
make install-container-binary-hubble-relay
This will install the Hubble Relay on your system.
Example: Building Cilium with Go Modules
This section shows a specific example of building Cilium using Go modules.
Set the Go module path:
export GO111MODULE=on
Build the project:
go build -o cilium github.com/cilium/cilium/cmd/cilium
This command builds the Cilium binary using the “github.com/cilium/cilium” module.
Additional Build Targets
The Makefile
contains several other build targets for different purposes:
make build-container-operator
: Build the Container Operator image.make build-container-hubble-relay
: Build the Hubble Relay image.make release
: Build the release binaries and artifacts.make tests
: Run the unit and integration tests.make install-manpages
: Install the Cilium manpages.
For a complete list of available targets, run make help
.
Resources
Remember to consult the official documentation for the latest information and configuration options.