actions / actions/actions-runner-controller

Support official Kubernetes namespace selector label `kubernetes.io/metadata.name`

Open
#2,107 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs triage
Dominant language
Go
Stars
6.5k
Forks
1.5k
Avg merge
2d 2h
Merged PRs (30d)
27

Description

What would you like added?

as of kubernetes 1.21, all namespaces are automatically labeled by the control plane with kubernetes.io/metadata.name.

this label is intended to be used as a selector.

i therefore propose, that you update the helm chart to use kubernetes.io/metadata.name instead of name as the namespace selector label in the validating- / mutating webhook config:

e.g.
https://github.com/actions/actions-runner-controller/blob/actions-runner-controller-0.21.1/charts/actions-runner-controller/templates/webhook_configs.yaml#L22

Why is this needed?

the name label is very helm specific and may not be appropriate for all kubernetes clusters.

it is quite common not to use helm to actually deploy workloads in kubernetes but to use it as a templating engine in combination with a tool such as fluxcd or argocd.

consequently, namespace creation (especially in multi-tenanted clusters) may be done elsewhere (and by different teams) since namespaces may require custom labels and annotations to implement various admission restrictions and the like.

using the default kubernetes.io/metadata.name label doesn't make any assumptions about how namespaces are deployed and what (helm-specific) labels they posses. so this seems like a cleaner, more broadly applicable solution to me.

Additional context

n/a

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open charts/actions-runner-controller/templates/webhook_configs.yaml at the referenced selector near line 22, and inspect both the validating and mutating webhook configurations. Update the namespace selector to use the official Kubernetes metadata label, then verify that both rendered configurations use the proposed label instead of the Helm-specific one.

Written by the indexing model from the issue text.

Assessment

Tech stack
helm, kubernetes
Domain
infrastructure
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.