You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 141740f
Browse filesBrowse the repository at this point in the historyBrowse files
{{- fail "values.yaml: `advertisedSubnets` was left empty and talm could not derive a default from discovery. No default-gateway-bearing link was found on the node. This field is a cluster-wide subnet selector fed to kubelet and etcd; `talm template` is invoked once per node and cannot merge per-node values into one cluster value. Either set advertisedSubnets explicitly in values.yaml, or ensure the node has a default route before running `talm template`." }}
28
-
{{- end }}
29
-
{{- $subnets:= list }}
30
-
{{- range$addrs }}
31
-
{{- $subnets= append $subnets (.| cidrNetwork) }}
32
-
{{- end }}
33
-
{{- range uniq $subnets }}
34
-
- {{ . }}
35
-
{{- end }}
36
-
{{- end }}
17
+
{{- include "talm.advertised_subnets" (dict "root"."indent" 8) }}
{{ required "values.yaml: `endpoint` must be set to the cluster control-plane URL (e.g. https://<vip>:6443). This field is cluster-wide: every node's kubelet and kube-proxy dials it, so it cannot be auto-derived from the current node's IP -- `talm template` runs once per node and has no way to reconcile per-node IPs into a single shared endpoint. For multi-node setups use a VIP or an external load balancer; for single-node clusters the node's routable IP works.".Values.endpoint| quote }}
76
+
{{- end }}
77
+
78
+
{{- /* Cluster settings on contract v1.14+. Only etcd stays in v1alpha1;
79
+
the rest are typed documents the engine merges into the ones the
80
+
generator emits, so they carry only what this chart sets. */ -}}
81
+
{{- define"talos.config.cluster.kubedocs" }}
82
+
{{- ifeq.MachineType"controlplane" }}
83
+
84
+
cluster:
85
+
etcd:
86
+
advertisedSubnets:
87
+
{{- include "talm.advertised_subnets" (dict "root"."indent" 6) }}
88
+
{{- end }}
89
+
---
90
+
apiVersion: v1alpha1
91
+
kind: KubeClusterConfig
92
+
clusterName: {{ include "talos.config.cluster_name". }}
93
+
endpoint: {{ include "talos.config.endpoint". }}
94
+
---
95
+
apiVersion: v1alpha1
96
+
kind: KubeNodeConfig
97
+
nodeIP:
98
+
validSubnets:
99
+
{{- include "talm.advertised_subnets" (dict "root"."indent" 4) }}
100
+
{{- with.Values.extraKubeletExtraArgs }}
101
+
---
102
+
apiVersion: v1alpha1
103
+
kind: KubeletConfig
104
+
config:
105
+
{{- toYaml .| nindent 2 }}
106
+
{{- end }}
107
+
---
108
+
apiVersion: v1alpha1
109
+
kind: KubeNetworkConfig
110
+
podSubnets:
111
+
{{- toYaml .Values.podSubnets| nindent 2 }}
112
+
serviceSubnets:
113
+
{{- toYaml .Values.serviceSubnets| nindent 2 }}
114
+
{{- ifeq.MachineType"controlplane" }}
115
+
{{- with.Values.extraControllerManagerArgs }}
116
+
---
117
+
apiVersion: v1alpha1
118
+
kind: KubeControllerManagerConfig
119
+
extraArgs:
120
+
{{- include "talm.render.component_args" (dict "args"."field""extraControllerManagerArgs""indent" 2) }}
121
+
{{- end }}
122
+
{{- with.Values.extraSchedulerArgs }}
123
+
---
124
+
apiVersion: v1alpha1
125
+
kind: KubeSchedulerConfig
126
+
extraArgs:
127
+
{{- include "talm.render.component_args" (dict "args"."field""extraSchedulerArgs""indent" 2) }}
128
+
{{- end }}
129
+
{{- include "talm.guard.apiserver_args_kubedocs". }}
clusterName: {{ include "talos.config.cluster_name". }}
98
156
controlPlane:
99
-
endpoint: {{ required "values.yaml: `endpoint` must be set to the cluster control-plane URL (e.g. https://<vip>:6443). This field is cluster-wide: every node's kubelet and kube-proxy dials it, so it cannot be auto-derived from the current node's IP -- `talm template` runs once per node and has no way to reconcile per-node IPs into a single shared endpoint. For multi-node setups use a VIP or an external load balancer; for single-node clusters the node's routable IP works.".Values.endpoint| quote }}
Copy file name to clipboardExpand all lines: charts/talm/templates/_helpers.tpl
+49-2Lines changed: 49 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -360,9 +360,11 @@ busPath: {{ .spec.busPath }}
360
360
are the only thing standing between a values typo and a component
361
361
that either fails to start or starts with a nonsense flag, and six
362
362
copies of them would drift. Expects a dict with "args" and "field"
363
-
(the values.yaml key name, used in messages). */ -}}
363
+
(the values.yaml key name, used in messages), and optionally "indent"
364
+
(default 6, the v1alpha1 cluster.<component>.extraArgs depth). */ -}}
364
365
{{- define"talm.render.component_args" }}
365
366
{{- $field:=.field }}
367
+
{{- $indent:=.indent| default 6 | int }}
366
368
{{- range$k, $v:=.args }}
367
369
{{- if kindIs "invalid"$v }}
368
370
{{- fail (printf"values.yaml: %s.%s has no value. A bare `key:` renders as the literal string \"<nil>\" onto the component command line; give it a value or drop the key."$field$k) }}
@@ -372,7 +374,52 @@ busPath: {{ .spec.busPath }}
372
374
{{- ifor (kindIs "map"$v) (kindIs "slice"$v) }}
373
375
{{- fail (printf"values.yaml: %s.%s is a %s, but a component flag takes a single scalar value. Write it as the string the component expects."$field$k (kindOf $v)) }}
{{- /* Non-empty from contract v1.14, where Talos keeps the Kubernetes
382
+
settings in typed documents (KubeClusterConfig, KubeletConfig,
383
+
KubeNodeConfig, ...) and refuses the v1alpha1 fields next to them. */ -}}
384
+
{{- define"talm.contract.kubedocs" -}}
385
+
{{- ifand.TalosVersion (not (semverCompare "<1.14.0-0".TalosVersion)) }}true{{ end }}
386
+
{{- end }}
387
+
388
+
{{- /* From contract v1.14 Talos refuses these kube-apiserver flags in
389
+
KubeAPIServerConfig and takes them only as typed documents; fail at
390
+
render rather than at apply. */ -}}
391
+
{{- define"talm.guard.apiserver_args_kubedocs" }}
392
+
{{- range$k, $_:=.Values.extraApiServerArgs }}
393
+
{{- range list "oidc-""anonymous-auth""authentication-config""authorization-config""authorization-mode""authorization-webhook-" }}
394
+
{{- if hasPrefix .$k }}
395
+
{{- fail (printf"values.yaml: extraApiServerArgs.%s is not accepted on Talos v1.14 and later, which configures kube-apiserver authentication and authorization through the KubeAuthenticationConfig and KubeAuthorizerConfig documents. Drop it from extraApiServerArgs and add that document as a per-node patch, or pin templateOptions.talosVersion to v1.13 or lower."$k) }}
396
+
{{- end }}
397
+
{{- end }}
398
+
{{- end }}
399
+
{{- end }}
400
+
401
+
{{- /* advertisedSubnets as YAML list items at .indent, falling back to the
402
+
subnet of the node's default-gateway-bearing link. cidrNetwork masks
403
+
host bits so the list holds the canonical network form
404
+
(192.168.201.0/24, not 192.168.201.10/24); uniq drops the duplicate a
405
+
secondary address in the same subnet would add. Expects a dict with
{{- fail "values.yaml: `advertisedSubnets` was left empty and talm could not derive a default from discovery. No default-gateway-bearing link was found on the node. This field is a cluster-wide subnet selector fed to kubelet and etcd; `talm template` is invoked once per node and cannot merge per-node values into one cluster value. Either set advertisedSubnets explicitly in values.yaml, or ensure the node has a default route before running `talm template`." }}
Copy file name to clipboardExpand all lines: docs/configuration/node-files.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ A node file can carry Talos config below its modeline (for example, a custom `ho
73
73
74
74
## Idempotent applies
75
75
76
-
Repeated `talm apply` runs against an already-configured node do not duplicate entries. Before the strategic merge runs, the engine prunes from the body every primitive-list entry the rendered template already carries (e.g. certSANs, nameservers, validSubnets). For object arrays the upstream patcher merges by identity (machine.network.interfaces by `interface:` or `deviceSelector:`, vlans by `vlanId:`, apiServer admissionControl by `name:`), the prune descends into matched pairs and dedupes the inner primitive lists too — so re-applying after `talm template -I` does not double interface addresses, vlan addresses, or admission-control exemption namespaces. For object arrays without an upstream identity merge (extraVolumes, kernel.modules, wireguard.peers, ...), body items that deep-equal a rendered counterpart are dropped, covering the dominant full-restate case. Fields tagged `merge:"replace"` upstream are passed through verbatim — pruning them would let the upstream replace silently drop the rendered entries on a partial edit. This covers v1alpha1 root paths `cluster.network.podSubnets`, `cluster.network.serviceSubnets`, `cluster.apiServer.auditPolicy`, and the typed `NetworkRuleConfig` paths `ingress` and `portSelector.ports`.
76
+
Repeated `talm apply` runs against an already-configured node do not duplicate entries. Before the strategic merge runs, the engine prunes from the body every primitive-list entry the rendered template already carries (e.g. certSANs, nameservers, validSubnets). For object arrays the upstream patcher merges by identity (machine.network.interfaces by `interface:` or `deviceSelector:`, vlans by `vlanId:`, apiServer admissionControl by `name:`), the prune descends into matched pairs and dedupes the inner primitive lists too — so re-applying after `talm template -I` does not double interface addresses, vlan addresses, or admission-control exemption namespaces. For object arrays without an upstream identity merge (extraVolumes, kernel.modules, wireguard.peers, ...), body items that deep-equal a rendered counterpart are dropped, covering the dominant full-restate case. Fields tagged `merge:"replace"` upstream are passed through verbatim — pruning them would let the upstream replace silently drop the rendered entries on a partial edit. This covers v1alpha1 root paths `cluster.network.podSubnets`, `cluster.network.serviceSubnets`, `cluster.apiServer.auditPolicy`, the typed `NetworkRuleConfig` paths `ingress` and `portSelector.ports`, `advertise`, `importRoutes` and `neighbors` of `BGPInstanceConfig`, `overrides` of `CRIBaseRuntimeSpecConfig`, and from Talos v1.14 `podSubnets` and `serviceSubnets` of `KubeNetworkConfig`, `pod` of `KubeStaticPodConfig` and `configuration` of `KubeAuthenticationConfig`, `KubeAuditPolicyConfig` and `KubeCredentialProviderConfig`. The typed paths are matched per kind: `configuration` of `KubeAdmissionControlConfig` merges and is pruned as usual. Component `extraArgs` (kubelet, apiserver, controller-manager, scheduler, proxy, etcd, in v1alpha1 and in the typed documents) merge key by key and replace the whole value of each key the body sets, so the prune drops only keys the body restates exactly; a list-valued flag such as `feature-gates` edited in the node file keeps the rendered entries the body lists.
0 commit comments