Repository navigation
fix/node-exporter: Drop the leftover sourcegraph-resource-requires label from the node-exporter Service - #1040
Merged
marcleblanc2 merged 1 commit intoDec 1, 2026
Conversation
…r Service The label is left over from the old kubectl apply install, which split an install between cluster admins and other users with kubectl apply -l sourcegraph-resource-requires=..., and nothing selects on it. The chart removed it from every other object in #7, and node-exporter brought one copy back in #194. Hard-coded after the label helper, it rendered the key twice when sourcegraph.serviceLabels or nodeExporter.serviceLabels also set it, which Kustomize and kubeconform -strict reject. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a21663-f060-7148-8fdc-8eed219fa092
Base automatically changed from
marc/otel-collector-configmap-metrics
to
michael/opt-in-labels
November 30, 2026 20:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1039, which merges into #1038 (
michael/opt-in-labels)Context
The old deprecated Kustomize deployment method (sourcegraph/deploy-sourcegraph) labeled each resource with
sourcegraph-resource-requires: cluster-admin | no-cluster-adminThis chart started as a copy of those manifests
Miscellaneous fixes #7 removed the label from all 69 objects in the Helm chart
add node exporter daemonset #194 brought one copy back on the
node-exporterServiceNothing in the sourcegraph org selects on it: no selector, script, code, or docs page
Problem
With sourcegraph: render opt-in labels on every object, each key once #1038,
sourcegraph.serviceLabelsandnodeExporter.serviceLabelsreach thenode-exporterService, and the hard-codedsourcegraph-resource-requiresline comes after them, so setting that key in either value renders it twiceHelm and kubectl accept it; Kustomize and
kubeconform -strictreject the duplicate keysourcegraph: render opt-in labels on every object, each key once #1038's changelog says each key renders once
Customers who have previously deployed on the old Kustomize repo may be carrying this label forward with them, which would fail deployment via Kustomize
Solution
Remove the hard-coded label from the
node-exporterService, the last object in this chart that set itUsers who want it set it in
sourcegraph.labels,sourcegraph.serviceLabels, ornodeExporter.serviceLabels, and it renders oncenode-exportermetrics lose thesourcegraph_resource_requireslabel, which no bundled dashboard or alert queries, so their series are replaced once on upgradeTesting
Two new tests in
nodeExporter_test.yamlfail on fix/opentelemetry: Fix OpenTelemetry Collector's custom exporters config to expose metrics #1039's head (one withmapping key "sourcegraph-resource-requires" already defined) and pass here;helm unittest(313 tests, 120 snapshots) andhelm lintpassOn EKS with sourcegraph: render opt-in labels on every object, each key once #1038's head, the duplicate rendered as described above: client-side and server-side apply accepted it,
kubeconform -strictand Kustomize did notAmp threads
Changelog
Removed the deprecated
sourcegraph-resource-requires: no-cluster-adminlabel from thenode-exporterService; set it insourcegraph.serviceLabelsornodeExporter.serviceLabelsif needed to keep it