Peer syntax
About 514 words
A peer is the other end of a flow. specht-labs.de/cilium-allow, specht-labs.de/cilium-dst and a rule entity's from and to all write peers the same way.
| Form | Example | Is |
|---|---|---|
entity:<name> | entity:kube-apiserver | a Cilium entity |
cidr:<range> | cidr:192.0.2.0/24, cidr:2001:db8::/32 | addresses, IPv4 or IPv6 |
fqdn:<name> | fqdn:api.github.com, fqdn:*.grafana.net | a DNS name, as a destination only |
<kind>:[<namespace>/]<name> | component:shop, api:payments-api | a catalog entity |
* | * | every endpoint of the policy |
Where each form is accepted:
| Form | cilium-allow | cilium-dst | rule from | rule to |
|---|---|---|---|---|
entity: | yes | yes | yes | yes |
cidr: | yes | yes | yes | yes |
fqdn: | no | yes | no | yes |
| catalog reference | yes | no | yes | yes |
* | yes | no | yes | yes |
Cilium entities
The plugin accepts these names after entity:. They're Cilium's reserved identities; Cilium identities you'll meet explains the ones that matter in practice.
| Entity | Is |
|---|---|
world | everything outside the cluster |
world-ipv4, world-ipv6 | the same, by address family |
cluster | every endpoint and node of the local cluster |
host | the local node, and pods on its host network |
remote-node | every other node, and pods on their host network |
kube-apiserver | the Kubernetes API server |
ingress | Cilium's Envoy for ingress and Gateway API traffic |
health | Cilium's health-check endpoints |
init | endpoints whose identity isn't resolved yet |
unmanaged | endpoints Cilium doesn't manage |
all | everything |
Renders to fromEntities or toEntities.
CIDRs
An IPv4 range (a.b.c.d/n, n from 0 to 32) or an IPv6 range (hex digits and colons, /n up to 128). A single address is a /32 or /128. Renders to fromCIDR or toCIDR.
DNS names
A name with at least two labels and a top-level domain of letters, optionally starting with *., which matches exactly one more label. * alone matches every name. Names are lowercased. A name renders to toFQDNs with matchName, a pattern with matchPattern. Cilium's **. prefix isn't accepted. FQDN rules need the DNS proxy.
Catalog references
<kind>:<name> or <kind>:<namespace>/<name>, with the kind always written. Without a namespace, the reference takes the namespace of the entity it's written on. It resolves to:
| Entity | As a source | As a destination |
|---|---|---|
| a Component or Resource with pods on the cluster | its pods | its pods |
| an API with providers on the cluster | the providers' pods | the providers' pods |
| anything else | nothing, with a warning | its cilium-dst, or nothing with a warning |
An entity the catalog doesn't have is an error.
Every endpoint
* stands for every endpoint of the policy, each a peer of its own. In cilium-allow it lets every endpoint reach the annotated entity; in a rule, it's every endpoint on that side.
In code
@spechtlabs/backstage-plugin-cilium-common exports parsePeer(text, { defaultNamespace }), which returns { peer } with kind entity, cidr, fqdn, catalog or every, or { error } with the message the plugin reports, and CILIUM_ENTITIES, the list above.
