Skip to content

fix(examples): set pod template labels on lgtm workloads - #65

Open
JeroenSoeters wants to merge 1 commit into
mainfrom
fix-lgtm-pod-template-labels
Open

fix(examples): set pod template labels on lgtm workloads#65
JeroenSoeters wants to merge 1 commit into
mainfrom
fix-lgtm-pod-template-labels

Conversation

@JeroenSoeters

Copy link
Copy Markdown
Contributor

What

The lgtm-observability example's Grafana Deployment, OTel gateway Deployment + agent DaemonSet, and MinIO StatefulSet each declare a selector but leave their pod template metadata.labels unset. The Kubernetes API rejects such workloads:

Deployment.apps "grafana" is invalid: spec.template.metadata.labels:
Invalid value: nil: `selector` does not match template `labels`

So applying the lgtm example fails to create Grafana, MinIO, and the OTel collectors (and everything that depends on them — the in-cluster Grafana never comes up, MinIO storage is missing so Tempo/Mimir/Loki degrade).

Fix

Set each workload's template.metadata.labels to match its selector, via k8s.PodTemplateMetadata { labels = ... } — mirroring the loki/tempo/mimir workloads in the same example that already do this.

Testing

pkl eval of examples/lgtm-observability/local.pkl is clean; applying the example against a local cluster now creates the previously-rejected workloads.

The grafana Deployment, otel gateway Deployment + agent DaemonSet, and minio
StatefulSet declared a selector but left their pod template metadata.labels
unset, so the Kubernetes API rejected them with "selector does not match
template labels". Set the template labels to match each selector, mirroring
the loki/tempo/mimir workloads that already do.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant