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

  1. Clone the repository:

    git clone https://github.com/cilium/cilium.git
    cd cilium
    
  2. Build the project:

    make build
    

    This will build the cilium binary, the Hubble Relay binary, and the Container Operator binary.

  3. Build the container images:

    make build-container
    

    This will build the container images for Cilium, Hubble Relay, and the Container Operator.

Starting Cilium

  1. 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.

  2. Install the Container Operator:

    make install-container-binary-operator
    

    This will install the Container Operator on your system.

  3. 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.

  1. Set the Go module path:

    export GO111MODULE=on
    
  2. 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.