This plugin integrates Cilium, a cloud-native networking, observability, and security solution, into the Headlamp UI. It provides visibility into your Cilium resources directly within Headlamp.
Cilium provides eBPF-based networking, security, and observability. Managing and monitoring its components (Network Policies, Endpoints, Identities, Nodes, etc.) often involves kubectl
or the Cilium CLI. This Headlamp plugin aims to bring essential Cilium resource details and status directly into your primary Kubernetes dashboard, streamlining workflows.
This plugin aims to support viewing the following Cilium resources:
- CiliumNetworkPolicies (CNP): List view and detailed view.
- CiliumClusterwideNetworkPolicies (CCNP): List view and detailed view.
- CiliumEndpoints (CEP): List view and detailed view showing status, identity, networking details, and policy enforcement status.
- CiliumIdentities: List view and detailed view showing security labels.
- CiliumNodes: List view and detailed view showing node addressing, IPAM status, and health.
- (Potentially others like CiliumExternalWorkloads, CiliumCIDRGroups, etc. in the future)
Note: Detail views are currently basic placeholders showing raw YAML.
- Headlamp: You need a running instance of Headlamp (either the desktop app or deployed in-cluster).
- Cilium: Cilium must be installed and running in the Kubernetes cluster that Headlamp is connected to. Cilium CRDs must be present in the cluster.
- Navigate to the "Plugins" section in Headlamp.
- Find the "Cilium" plugin in the catalog. (Note: This assumes the plugin is published to a catalog Headlamp uses).
- Click "Install".
- Reload Headlamp when prompted.
- Build the plugin (
npm run build
) to get themain.js
file (and potentially other assets in thedist
directory). - Create the plugin directory structure:
- Linux:
~/.config/Headlamp/plugins/headlamp-cilium/
- macOS:
~/Library/Application Support/Headlamp/plugins/headlamp-cilium/
- Windows:
%APPDATA%\Headlamp\config\plugins\headlamp-cilium\
- Linux:
- Copy the contents of the plugin's
dist
folder (includingmain.js
) and thepackage.json
file into theheadlamp-cilium
directory created above. - Restart Headlamp.
To use this plugin in an in-cluster Headlamp deployment, you need an initContainer to copy the plugin files into a shared volume mounted by the main Headlamp container.
Modify your Headlamp Helm values.yaml
or Deployment manifest:
# Example using Helm values.yaml
# Add this under the main 'headlamp' deployment configuration
initContainers:
- name: init-cilium-plugin
image: ghcr.io/giantswarm/headlamp-cilium:latest
imagePullPolicy: Always
command:
- /bin/sh
- -c
- |
echo "Copying Cilium plugin..."
# Target directory MUST match the plugin name in package.json
PLUGIN_TARGET_DIR="/headlamp/plugins/headlamp-cilium"
mkdir -p "$PLUGIN_TARGET_DIR"
# Source path inside the plugin image (based on Dockerfile below)
cp -r /plugins/headlamp-cilium/* "$PLUGIN_TARGET_DIR/"
echo "Cilium plugin copied."
volumeMounts:
- name: plugins # Must match the volume name used by the main Headlamp container
mountPath: /headlamp/plugins
# Ensure the corresponding volumeMount is also present in the main Headlamp container
# spec:
# template:
# spec:
# containers:
# - name: headlamp
# image: ghcr.io/headlamp-k8s/headlamp:latest # Official Headlamp image
# volumeMounts:
# - name: plugins
# mountPath: /headlamp/plugins
# # ... other headlamp container config ...
# volumes:
# - name: plugins
# emptyDir: {}
(See Advanced section below for building the plugin-files image)
Once installed and Headlamp is connected to a cluster with Cilium running:
- Look for the Cilium entry in the main sidebar menu on the left.
- Click on it to expand the sub-menu containing Network Policies, Clusterwide Policies, Endpoints, Identities, and Nodes.
- Navigate through the different list and detail views.
You can build a container image containing just the built plugin files (dist/
and package.json
). Use the Dockerfile
provided in this repository.
-
Build the image: Run from the repository root:
docker build -t ghcr.io/your-org/headlamp-cilium:my-tag .
(Replace
your-org
andmy-tag
). -
Push the image: (If needed for your cluster)
docker push ghcr.io/your-org/headlamp-cilium:my-tag
This image can now be referenced in an initContainer as shown above. A CI workflow (.github/workflows/ci.yml
) is included as an example for automating this.
- Clone the repository.
cd headlamp-cilium
npm install
npm run start
- Run Headlamp desktop and point it to load plugins from the appropriate directory, or manually copy build artifacts.
Please file issues or pull requests on the GitHub repository.