No way to remove or override nameservers, they can only come from discovery

Aperta
#234 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
helm, kubernetes, yaml
Ambito
devops

Direzione di ricerca

Read charts/talm/templates/_helpers.tpl:273 and compare how advertisedSubnets is configured in charts/generic/values.yaml and charts/cozystack/values.yaml. Trace where the discovered resolver value is used for both ResolverConfig and the legacy machine.network.nameservers schema. Done means a configured nameservers value replaces discovery in both presets, while an empty value continues to use discovery.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What is wrong?

Both presets take nameservers only from discovery, charts/talm/templates/_helpers.tpl:273:

{{- define "talm.discovered.default_resolvers" }}
{{- with (lookup "resolvers" "" "resolvers") }}
{{- toJson .spec.dnsServers }}

It goes into ResolverConfig on 1.12+ and into machine.network.nameservers on legacy schema. There is no nameservers key in charts/generic/values.yaml or charts/cozystack/values.yaml, so operator cant change it from values at all.

lookup "resolvers" returns effective dns of the node, and effective dns is exactly what previous talm apply wrote there, so every render puts the same nameservers back. Removing them from templates changes nothing.

Override in node body doesn't work too. Talos merges slices by concatenation unless the field has merge:"replace" tag (config/merge/merge.go:24), and nameservers doesn't have it, neither in ResolverConfig nor in v1alpha1. So entries can only be added, never removed. Same mechanics as #77.

In result whatever dns the node had on first apply is pinned in config forever. On dhcp node it bakes dhcp provided servers, or 1.1.1.1 and 8.8.8.8 that talos falls back to when nothing else is set.

Only workaround I found is $patch: delete in node body:

apiVersion: v1alpha1
kind: ResolverConfig
nameservers:
  - address: 8.8.8.8
    $patch: delete

and it has to stay in node file forever, because discovery will pick up whatever is effective on the next render.

Seen on talos 1.12.6.

How it should work?

nameservers value in both presets, same shape as advertisedSubnets already has: when set it replaces discovery, when empty discovery is used.

Lingua principale
Go
Stelle
493
Fork
23
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cozystack/talm

Tutte le issue di cozystack/talm

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.