What it is
About 897 words
Cilium for Backstage renders a Kubernetes cluster's Cilium network policies from the Backstage software catalog. You describe the cluster once, as a kind: Cilium policy entity, and Backstage works out who talks to whom from the relations your Components, APIs and Resources already have. It writes the result as CiliumClusterwideNetworkPolicy manifests, shows them, and sends them to the GitHub repository your GitOps tool applies them from.
Not affiliated with Isovalent or Cisco
This is a community plugin by SpechtLabs. It is not made, endorsed or supported by Isovalent or Cisco. "Cilium" is a trademark of its owners.
Where the policy comes from
| Catalog fact | Becomes |
|---|---|
A Component or Resource that dependsOn the cluster's Resource and has backstage.io/kubernetes-namespace or a label selector | an endpoint: a set of pods with a policy of its own, allow-<kind>-<name> |
Component consumesApi API | a flow from the consumer to the API's providers' pods, or to where the API is outside the cluster |
endpoint dependsOn Resource | a flow to the Resource's pods, or to where it is outside the cluster |
endpoint dependsOn a Resource of spec.type: gateway | a flow from the gateway to the endpoint |
specht-labs.de/cilium-ports | the ports a flow is allowed on |
specht-labs.de/cilium-dst | where something outside the cluster is: a DNS name, an address range, a Cilium entity |
specht-labs.de/cilium-allow | who else reaches an endpoint: the internet, the API server, another catalog entity |
specht-labs.de/cilium-metrics-ports and the policy's spec.metrics.scraper | a flow from the metrics scraper to each endpoint's metrics port |
kind: Cilium entities of spec.type: rule | the flows the relations can't express |
Each flow is allowed on both ends: as egress on the policy of the endpoint it leaves, and as ingress on the policy of the endpoint it reaches. A separate default-deny policy turns on default deny for every pod outside the namespaces you leave open. From catalog to policy walks through the whole path.
What you get
A policy console at /cilium, and the same console as a Network policy tab on each policy entity. It has:
- an overview: how many endpoints are under the default deny, where the flows come from, where the manifests are published, and the policy's problems;
- a map of who reaches whom, grouped by namespace, with the flows that cross the cluster boundary on one side;
- the endpoints with the pods each policy selects, every flow with its ports and reason, and the rule entities;
- the rendered manifests, with each endpoint's lines highlighted.
Cards on entity pages. A Component, Resource or API shows what reaches it and what it reaches. A rule entity shows the flows it adds.
Publishing. Every hour the manifests go to a GitHub repository, as a pull request kept up to date or as a direct push. Applying them to the cluster stays with that repository and whatever syncs it (Argo CD, Flux, a CI job).
A local check. backstage-cilium-render renders a policy from local checkouts of your catalog repositories, lists its endpoints, flows and problems, and writes the manifests, so you can check a change before you push it.
The packages
| Package | Install into | What it does |
|---|---|---|
@spechtlabs/backstage-plugin-cilium-backend | packages/backend | Renders the policies, serves /api/cilium, publishes to GitHub. Ships the backstage-cilium-render command. |
@spechtlabs/backstage-plugin-catalog-backend-module-cilium | packages/backend | Adds kind: Cilium to the catalog: validation and relations. |
@spechtlabs/backstage-plugin-cilium | packages/app | The page, the Network policy tab and the entity cards. |
@spechtlabs/backstage-plugin-cilium-common | (a dependency of the others) | The entity model and its validation, the annotations, the port, selector and peer syntax, the API types. |
The backend packages use Backstage's new backend system, and the frontend package uses the new frontend system. There is no export for the legacy frontend.
What it doesn't do
The plugin never talks to your cluster or to Cilium. It doesn't look at running pods, Services or Hubble flows, and it doesn't apply anything. It writes manifests to a GitHub repository, and whatever applies that repository stays in charge of what goes live. A label selector in the catalog that matches no pod renders just the same; the plugin can't tell.
It renders CiliumClusterwideNetworkPolicy only: no Kubernetes NetworkPolicy, no namespaced CiliumNetworkPolicy, and no layer 7 rules beyond the DNS rule that FQDN policies need.
Publishing only targets GitHub.com: the backend calls https://api.github.com, so GitHub Enterprise Server repositories aren't supported.
What it needs from Cilium
- A Cilium version that understands
enableDefaultDenyin a policy spec. The allow policies set it tofalseso that onlydefault-denydecides what is enforced; a Cilium that doesn't know the field would put every selected pod into default deny on its own. - The DNS proxy (Cilium's L7 proxy, on by default) for any
fqdn:destination. See FQDN rules and the DNS proxy. - For tailnet destinations, the Tailscale Kubernetes operator's egress proxies. See Tailnet egress.
