The console and entity cards
About 923 words
The frontend plugin shows each policy in a console: at /cilium, and as the Network policy tab on every policy entity. Component, Resource and API pages get a card with the entity's flows, and rule entities a card with what they add. The data comes from GET /api/cilium/overview, which the backend renders from the catalog at most once a minute; the frontend keeps it for another minute, so a catalog change can take a couple of minutes to show.
The header
The header names the policy and links its cluster, its owner and the policy entity. If the policy has spec.publish, it says where the manifests go: Pull request in acme/k8s-deployment or Pushes to acme/k8s-deployment, linked to the last pull request or commit, or Not published and why. With more than one policy in the catalog, the page has a picker; the tab always shows its own entity's policy. Copy YAML and Download give you the rendered manifests.
Overview
Five numbers, each a link to the section behind it: Endpoints, Flows (without the ones within an endpoint), Peers outside (the distinct Cilium entities, address ranges, DNS names and tailnet destinations the flows reach or come from), Rule entities and Problems. Below them:
- Default deny. How many endpoints are under the default deny (Enforced) and how many sit in a namespace left out of it (Open namespace), with the open ones listed.
- Publishing. The repository, the file, the branch or pull request branch, and the outcome of the last run on this backend instance, with a link to the pull request or commit. Without
spec.publish: Not published: the policy has no spec.publish. - Where the flows come from. The flows counted by the fact that allows them:
consumesApi,dependsOn,cilium-allow,metrics,rule. Pick one to open its flows. - Problems. The first five errors and warnings, with a link to the rest.
Map
Who reaches whom. Endpoints are grouped by namespace; arcs on the left stay inside the cluster, lines on the right cross its boundary to the Cilium entities, address ranges, DNS names and tailnet destinations outside. Arrows point at the destination, and the colour says why the flow is allowed. Open namespaces are drawn with a dashed outline.
You can hide flows by reason, find an endpoint or peer by name, show one namespace, and fold DNS names by domain. Picking an endpoint or peer lists what it reaches and what reaches it.
Policy
- Endpoints. Every Component and Resource with pods on the cluster: the pods its policy selects, whether it's enforced or in an open namespace, its metrics ports, and its flows in and out. Filter by Enforced or Open, or by text such as a name or a label.
- Flows. Every flow the policy allows: its two ends, its ports and where they come from, and the catalog fact behind it. Filter by where it goes (Inside the cluster, To outside the cluster, From outside the cluster), by reason, or by text such as
loki,github.comortcp:443. Whatever isn't listed here is denied. - Rules. The rule entities, with their sources, destinations, ports and the flows each adds.
Check
- Problems. Every error, warning and note of the policy, and every rule entity whose
spec.targetisn't a policy. Diagnostics explains each message. - Rendered file. The manifests, with line numbers. On the right, the documents of the file are listed; pick an endpoint to highlight its policy's lines.
Link to a view
The console keeps its state in the URL, so you can link to any view. The query parameters:
| Parameter | Value |
|---|---|
policy | a policy's metadata.name (on /cilium only; the tab always shows its own entity) |
tab | map, endpoints, flows, rules, problems or file; the overview without it |
endpoint | an endpoint's entity reference: selected on the map, opened in Endpoints, highlighted in the file |
peer | on map: a peer outside the cluster to select, such as fqdn:api.github.com |
ns | on map: the namespace to show |
q | the filter text |
via | on flows: a reason, consumesApi, dependsOn, allow, metrics or rule |
scope | on flows: inside, egress or ingress |
deny | on endpoints: enforced or open |
lines | on file: a line or range to highlight, such as 27 or 27-34 |
For example, /cilium?policy=prod&tab=file&endpoint=component:default/shop opens the manifests with the shop's policy highlighted.
Entity cards
On the overview page of a Component, Resource or API, a Network policy card shows the entity's place in each policy that concerns it, with the policy and cluster in its subheader.
For an endpoint, it shows the pods its policy selects, whether its namespace is open, where the metrics scraper reaches it, and two lists: Reached by and Reaches, each flow with its peer, ports and reason. Five flows each; the link at the bottom opens the endpoint in the console.
For an entity without pods on the cluster, such as an API or something outside the cluster, the card lists the flows that exist because of it: the consumptions of an API, the dependencies on a database outside, a cilium-allow it carries.
An entity that no policy concerns gets no card.
A rule entity's page has a Network policy rule card: its sources, destinations and ports, its problems, and the flows it adds. If its target isn't a policy, the card says so.
