Repository navigation
Commit b1d93cc
committed
feat(infra): Kubernetes objects declared in Terraform are Resources
A `kubernetes_*` resource in a .tf file -- eks-blueprints' network
policies and storage classes, k8s.io's metrics-server stack -- declares
a cluster object, but the graph only had the Terraform block, named by
its Terraform address: no node carried the object's kind and name.
A kubernetes_<type> resource (also _vN) whose metadata name is a literal
is now a Resource of the same identity scheme as a manifest's object:
kind from the resource type, or a kubernetes_manifest's own apiVersion
and kind; name and namespace from the object's own metadata, never from
spec; `ecosystem: terraform` on its properties. The .tf file DEFINES it
and the block DEPLOYS it {via: terraform, line}. The objects are minted
before the Kubernetes joins, so a manifest of the same bundle references
them as it does a manifest's object (an Ingress maps to the Service). A
computed name, and a type that acts on an object declared elsewhere
(kubernetes_annotations, kubernetes_labels, ...), make none. Labels are
not read, so a Service selector does not reach a Terraform workload.
Measured on 17 infrastructure repositories: 21 of 21 literal-named
objects against an independent reading, with group, kind, name and
namespace; nothing else changed (21 nodes, 42 edges added, no property
of an existing node); deterministic over three runs; the incremental
re-index equals a full index when an object is renamed, gains a
namespace, or its file is added or deleted.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>1 parent cdfdb8f commit b1d93cc
5 files changed
Lines changed: 425 additions & 14 deletions
File tree
- src/pipeline
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
557 | | - | |
558 | | - | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
559 | 561 | | |
560 | | - | |
| 562 | + | |
561 | 563 | | |
562 | 564 | | |
563 | 565 | | |
| |||
597 | 599 | | |
598 | 600 | | |
599 | 601 | | |
600 | | - | |
601 | | - | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
602 | 607 | | |
603 | 608 | | |
604 | 609 | | |
| |||
613 | 618 | | |
614 | 619 | | |
615 | 620 | | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
616 | 626 | | |
617 | 627 | | |
618 | 628 | | |
| |||
1171 | 1181 | | |
1172 | 1182 | | |
1173 | 1183 | | |
| 1184 | + | |
1174 | 1185 | | |
| 1186 | + | |
1175 | 1187 | | |
1176 | | - | |
| 1188 | + | |
| 1189 | + | |
1177 | 1190 | | |
1178 | 1191 | | |
1179 | 1192 | | |
| |||
2427 | 2440 | | |
2428 | 2441 | | |
2429 | 2442 | | |
2430 | | - | |
| 2443 | + | |
2431 | 2444 | | |
2432 | 2445 | | |
2433 | 2446 | | |
| |||
4131 | 4144 | | |
4132 | 4145 | | |
4133 | 4146 | | |
| 4147 | + | |
| 4148 | + | |
| 4149 | + | |
| 4150 | + | |
4134 | 4151 | | |
4135 | 4152 | | |
4136 | 4153 | | |
| |||
0 commit comments