Diagnostics
About 1461 words
Every message the plugin reports, where it shows up, and what to do. There are two kinds:
- Validation errors come from the catalog module while the catalog processes a
kind: Ciliumentity. The catalog refuses the entity. - Policy diagnostics come from the backend while it renders a policy, attached to an entity, at one of three severities:
error,warningandinfo. They show in the console's Problems (the overview shows the first five errors and warnings), on a rule entity's card, inbackstage-cilium-render's output, and, apart frominfo, in the pull request's Problems section. None of them stops the console from rendering; anerrorstops publishing.
backstage-cilium-render on the docs/examples/problems catalog shows most of them:
lab: 17 entities, 5 endpoints (5 under the default deny), 6 flows, 6 policies, 216 lines
component:default/backend backend/app=backend in 2 / out 1
component:default/node-agent {node-agent,kube-system}/app=node-agent in 1 / out 1
component:default/web web/* in 1 / out 2
component:default/worker */app=worker in 1 / out 1
resource:default/cache web/app=cache in 1 / out 1
problems:
error: cilium:default/stray: spec.target: no Cilium policy cilium:staging
error: cilium:default/lab: spec.metrics.scraper: component:default/grafana-agent has no pods on resource:default/lab
error: cilium:default/probe-everything: spec.from: no component:default/prober in the catalog
error: cilium:default/world-to-office: entity:world to cidr:192.0.2.0/24: one end must be pods on resource:default/lab
error: component:default/backend: specht-labs.de/cilium-ports: not ports: tcp:http
error: component:default/batch: specht-labs.de/cilium-selector: not a label requirement: app in (batch
error: component:default/legacy: not namespaces: Legacy_Apps
error: resource:default/cache: specht-labs.de/cilium-allow: entity:internet: not a Cilium entity (all, world, world-ipv4, world-ipv6, cluster, host, remote-node, kube-apiserver, ingress, health, init, unmanaged)
warning: cilium:default/probe-everything: spec.to: api:default/legacy-api has no pods on resource:default/lab and no specht-labs.de/cilium-dst
warning: component:default/backend: reached on every port by 1 flow: give it (or the APIs it provides) specht-labs.de/cilium-ports
warning: component:default/node-agent: only some of its namespaces are left out of the default deny (kube-system)
warning: component:default/web: consumes api:default/ghost-api, which isn't in the catalog
warning: component:default/web: consumes api:default/legacy-api, which doesn't run on resource:default/lab and has no specht-labs.de/cilium-dst: not allowed
warning: component:default/web: consumes api:default/remote-api, which doesn't run on resource:default/lab and has no specht-labs.de/cilium-dst (it is on the tailnet, but the policy has no tailnetEgress): not allowed
warning: component:default/web: depends on component:default/billing, which has pods (backstage.io/kubernetes-namespace) but doesn't depend on resource:default/lab: no flow
warning: component:default/worker: no backstage.io/kubernetes-namespace or specht-labs.de/cilium-namespaces: its policy selects app=worker in every namespace
info: component:default/web: depends on resource:default/queue, outside resource:default/lab: if it is reached over the network, give it specht-labs.de/cilium-dstIn the tables below, <cluster> is the policy's cluster, written as an entity reference such as resource:default/prod.
Errors
| Message | On | Fix |
|---|---|---|
spec.cluster: no <ref> in the catalog | the policy | Add the cluster's Resource, or fix spec.cluster. Nothing else renders until then. |
spec.target: no Cilium policy <target> | a rule | The rule's spec.target doesn't name a policy. Fix it, or add the policy. The rule renders nowhere until then. |
spec.metrics.scraper: <ref> has no pods on <cluster> | the policy | The scraper must be an endpoint. No metrics flows until then. |
specht-labs.de/cilium-ports: not ports: <entries> | the entity | Fix the ports. The annotation is ignored until then. |
specht-labs.de/cilium-metrics-ports: not ports: <entries> | the entity | The same. |
not namespaces: <names> | the entity | A namespace annotation holds something that isn't a namespace name. The entity isn't an endpoint until it's fixed. |
backstage.io/kubernetes-label-selector: <problem> or specht-labs.de/cilium-selector: <problem> | the entity | The selector doesn't parse: not a label requirement: …, or <key> can't equal two values. The entity isn't an endpoint until it's fixed. |
specht-labs.de/cilium-allow: <peer problem> | the entity | An entry isn't a peer. See the peer problems below. |
specht-labs.de/cilium-dst: <peer problem> | the entity | The same. |
specht-labs.de/cilium-dst: <entry>: only entity:, cidr: and fqdn: say where something outside the cluster is | the entity | A catalog reference or * in cilium-dst. |
<field>: fqdn:<name> can only be a destination | the entity or rule | A DNS name in cilium-allow or a rule's from. |
<field>: no <ref> in the catalog | the entity or rule | A catalog reference in cilium-allow, spec.from or spec.to that doesn't exist. |
spec.from: <peer problem>, spec.to: <peer problem> | a rule | An entry isn't a peer. |
<peer> to <peer>: one end must be pods on <cluster> | a rule | A pair of the rule has no endpoint at either end. |
The peer problems:
| Problem | Cause |
|---|---|
<value>: not a Cilium entity (all, world, …) | an entity: name Cilium doesn't have |
<value>: not a CIDR | a malformed cidr: |
<value>: not a DNS name or *.pattern | a malformed fqdn: |
<value>: needs entity:, cidr:, fqdn: or a catalog ref (component:name) | no prefix at all |
<value>: not an entity ref | a catalog reference that doesn't parse |
Warnings
| Message | On | Fix |
|---|---|---|
consumes <api>, which isn't in the catalog | the consumer | Add the API, or fix consumesApis. |
consumes <api>, which doesn't run on <cluster> and has no specht-labs.de/cilium-dst: not allowed | the consumer | Give the API, or its provider, a cilium-dst, or make the provider an endpoint. |
the same, ending (it is on the tailnet, but the policy has no tailnetEgress): not allowed | the consumer | Add spec.tailnetEgress to the policy. |
depends on <ref>, which has pods (backstage.io/kubernetes-namespace) but doesn't depend on <cluster>: no flow | the dependent | Add dependsOn the cluster to the dependency, so that it's an endpoint. |
<field>: <ref> has no pods on <cluster> | the entity or rule | A source that isn't an endpoint (or an API without providers on the cluster). |
<field>: <ref> has no pods on <cluster> and no specht-labs.de/cilium-dst | a rule | A destination that is neither an endpoint nor has a cilium-dst. |
reached on every port by <n> flows: give it (or the APIs it provides) specht-labs.de/cilium-ports | the destination | Add cilium-ports. |
no backstage.io/kubernetes-namespace or specht-labs.de/cilium-namespaces: its policy selects <selector> in every namespace | the entity | Add the namespace. |
only some of its namespaces are left out of the default deny (<names>) | the entity | Exclude all of its namespaces, or none. |
Info
| Message | On | Fix |
|---|---|---|
depends on <ref>, outside <cluster>: if it is reached over the network, give it specht-labs.de/cilium-dst | the dependent | Add a cilium-dst to the dependency, or cilium-dst: none if it isn't reached over the network. |
Publishing
The console's header and Publishing card, and the backend's log on each run, say why a policy with spec.publish isn't published:
| Message | Fix |
|---|---|
<repo> is not in Backstage's cilium.allowedRepos | Add the repository to cilium.allowedRepos. |
the policy has errors | Fix the errors above. |
A failed run shows as the outcome failed, with GitHub's error, on the Publishing card.
Validation errors
The catalog module refuses a Cilium entity with Invalid Cilium <type>: followed by every problem, separated by ; .
| Message | Types |
|---|---|
spec is required | all |
spec.type must be one of policy, rule, not … | all |
spec.owner is required, spec.target is required | all; target on rules |
spec.<field> must be a string | owner, system, target, cluster |
spec.cluster is required | policy |
spec.catalogRules must be true or false, spec.allowWithin must be true or false | policy |
spec.defaultDeny must be an object | policy |
spec.defaultDeny.exclude must be a list of namespaces | policy |
spec.dns must be an object, spec.tailnetEgress must be an object | policy |
spec.dns.namespace must be a namespace, spec.tailnetEgress.namespace must be a namespace | policy |
spec.dns.selector: …, spec.tailnetEgress.selector: … | policy: a selector that doesn't parse |
spec.tailnetEgress.consumerNamespaceLabel must be a label | policy |
spec.metrics.scraper must be an entity ref | policy: metrics without a scraper string |
spec.metrics.scraper: … is not an entity ref | policy |
spec.publish must be an object | policy |
spec.publish.repo must be owner/name | policy |
spec.publish.path is required | policy |
spec.publish.flow must be pullRequest or push, not … | policy |
spec.publish branches must be strings | policy |
spec.from is required, spec.to is required | rule |
spec.<from, to or ports> must be a list of strings | rule |
spec.from needs at least one entry, spec.to needs at least one entry | rule |
spec.<from or to>: <peer problem> | rule |
spec.from: …: a DNS name can only be a destination | rule |
spec.ports: not ports: … | rule |
