Skip to content

Commit 9554837

Browse files
authored
Update Bare Metal documentation with new IPAM templating logic (#10339)
Updated the TinkerbellTemplateConfig examples in the Advanced Bare Metal cluster configuration section to reflect the current static IPAM logic: Changes for Ubuntu template: - Removed deprecated STATIC_NETPLAN environment variable - Added CONTENTS field with Go template expressions to directly configure netplan using Hardware object metadata - Supports both VLAN and non-VLAN configurations with conditional logic - Uses netmaskToCIDR template function for proper CIDR notation Changes for Red Hat Enterprise Linux template: - Removed deprecated STATIC_NETPLAN environment variable - Added CONTENTS field with NetworkManager configuration - Updated DEST_PATH to /etc/NetworkManager/system-connections/static-connection.nmconnection - Updated MODE to 0600 for NetworkManager connection files - Supports both VLAN and non-VLAN configurations with conditional logic - Uses netmaskToCIDR template function for proper CIDR notation Additional improvements: - Added important note about template regeneration during EKS-A upgrades - Emphasized that default templates may change between versions - Recommended best practice to regenerate templates before customization - Minor formatting improvements to metadata URLs and datasource content These changes align the documentation with the current implementation introduced in PR #10163 and help users avoid common mistakes when customizing templates across EKS-A version upgrades.
1 parent 6daae1e commit 9554837

File tree

1 file changed

+88
-8
lines changed

1 file changed

+88
-8
lines changed

docs/content/en/docs/getting-started/baremetal/bare-spec.md

Lines changed: 88 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ eksctl anywhere generate tinkerbelltemplateconfig -f eksa-mgmt-cluster.yaml
390390

391391
Now you can add your own Actions for configuring nodes. We highly recommend that you do not modify the first and the last Actions in the default `TinkerbellTemplateConfig`. The first Action streams the OS image to the disk, and the last Action reboots the node. See the upstream Tinkerbell documentation for more information on [Templates](https://tinkerbell.org/docs/concepts/templates/) and [Actions](https://tinkerbell.org/docs/concepts/templates/#actions).
392392

393+
>**_IMPORTANT:_** When upgrading to a new EKS Anywhere version, the default template structure may change to incorporate improvements or support new features. Before customizing a template for use with a new EKS Anywhere version, always regenerate the default template using the command above to ensure you have the latest template structure. Failure to use an updated template during upgrades may result in provisioning failures or unexpected behavior. It is recommended to regenerate and review the default template with each EKS Anywhere version upgrade, then reapply your customizations to the updated template.
394+
393395
The following shows the default `TinkerbellTemplateConfig` generated by `eksctl anywhere generate tinkerbelltemplateconfig`.
394396

395397
### Ubuntu
@@ -415,13 +417,50 @@ spec:
415417
name: stream image to disk
416418
timeout: 600
417419
- environment:
420+
CONTENTS: |
421+
{{ if (index .Hardware.Interfaces 0).DHCP.VLANID }}network:
422+
version: 2
423+
renderer: networkd
424+
ethernets:
425+
mainif:
426+
match:
427+
macaddress: {{ (index .Hardware.Interfaces 0).DHCP.MAC }}
428+
set-name: mainif
429+
430+
vlans:
431+
vlan{{ (index .Hardware.Interfaces 0).DHCP.VLANID }}:
432+
id: {{ (index .Hardware.Interfaces 0).DHCP.VLANID }}
433+
link: mainif
434+
addresses:
435+
- {{ (index .Hardware.Interfaces 0).DHCP.IP.Address }}/{{ netmaskToCIDR (index .Hardware.Interfaces 0).DHCP.IP.Netmask }}
436+
nameservers:
437+
addresses: [{{ range $i, $ns := (index .Hardware.Interfaces 0).DHCP.NameServers }}{{if $i}}, {{end}}{{$ns}}{{end}}]
438+
{{- if (index .Hardware.Interfaces 0).DHCP.IP.Gateway }}
439+
routes:
440+
- to: default
441+
via: {{ (index .Hardware.Interfaces 0).DHCP.IP.Gateway }}
442+
{{- end }}
443+
{{ else }}network:
444+
version: 2
445+
renderer: networkd
446+
ethernets:
447+
id0:
448+
match:
449+
macaddress: {{ (index .Hardware.Interfaces 0).DHCP.MAC }}
450+
addresses:
451+
- {{ (index .Hardware.Interfaces 0).DHCP.IP.Address }}/{{ netmaskToCIDR (index .Hardware.Interfaces 0).DHCP.IP.Netmask }}
452+
nameservers:
453+
addresses: [{{ range $i, $ns := (index .Hardware.Interfaces 0).DHCP.NameServers }}{{if $i}}, {{end}}{{$ns}}{{end}}]
454+
routes:
455+
- to: default
456+
via: {{ (index .Hardware.Interfaces 0).DHCP.IP.Gateway }}
457+
{{ end }}
418458
DEST_DISK: '{{ formatPartition ( index .Hardware.Disks 0 ) 2 }}'
419459
DEST_PATH: /etc/netplan/config.yaml
420460
DIRMODE: "0755"
421461
FS_TYPE: ext4
422462
GID: "0"
423463
MODE: "0644"
424-
STATIC_NETPLAN: "true"
425464
UID: "0"
426465
image: 127.0.0.1/embedded/writefile
427466
name: write netplan config
@@ -443,7 +482,7 @@ spec:
443482
CONTENTS: |
444483
datasource:
445484
Ec2:
446-
metadata_urls: [http://<admin-machine-ip>:50061,http://<tinkerbellIP-from-cluster-config>:50061]
485+
metadata_urls: [http://<admin-machine-ip>:50061, http://<tinkerbellIP-from-cluster-config>:50061]
447486
strict_id: false
448487
manage_etc_hosts: localhost
449488
warnings:
@@ -459,8 +498,7 @@ spec:
459498
name: add cloud-init config
460499
timeout: 90
461500
- environment:
462-
CONTENTS: |
463-
datasource: Ec2
501+
CONTENTS: "datasource: Ec2\n"
464502
DEST_DISK: '{{ formatPartition ( index .Hardware.Disks 0 ) 2 }}'
465503
DEST_PATH: /etc/cloud/ds-identify.cfg
466504
DIRMODE: "0700"
@@ -509,16 +547,58 @@ spec:
509547
name: stream image to disk
510548
timeout: 600
511549
- environment:
550+
CONTENTS: |
551+
{{ if (index .Hardware.Interfaces 0).DHCP.VLANID }}[connection]
552+
id=vlan-connection
553+
type=vlan
554+
autoconnect=yes
555+
autoconnect-priority=10
556+
557+
[ethernet]
558+
mac-address={{ (index .Hardware.Interfaces 0).DHCP.MAC }}
559+
560+
[vlan]
561+
flags=1
562+
id={{ (index .Hardware.Interfaces 0).DHCP.VLANID }}
563+
mac-address={{ (index .Hardware.Interfaces 0).DHCP.MAC }}
564+
565+
[ipv4]
566+
address1={{ (index .Hardware.Interfaces 0).DHCP.IP.Address }}/{{ netmaskToCIDR (index .Hardware.Interfaces 0).DHCP.IP.Netmask }}
567+
dns={{ range $i, $ns := (index .Hardware.Interfaces 0).DHCP.NameServers }}{{if $i}};{{end}}{{$ns}}{{end}};
568+
gateway={{ (index .Hardware.Interfaces 0).DHCP.IP.Gateway }}
569+
method=manual
570+
571+
[ipv6]
572+
addr-gen-mode=default
573+
method=ignore
574+
{{ else }}[connection]
575+
id=static-connection
576+
type=ethernet
577+
autoconnect=yes
578+
autoconnect-priority=10
579+
580+
[ethernet]
581+
mac-address={{ (index .Hardware.Interfaces 0).DHCP.MAC }}
582+
583+
[ipv4]
584+
address1={{ (index .Hardware.Interfaces 0).DHCP.IP.Address }}/{{ netmaskToCIDR (index .Hardware.Interfaces 0).DHCP.IP.Netmask }}
585+
dns={{ range $i, $ns := (index .Hardware.Interfaces 0).DHCP.NameServers }}{{if $i}};{{end}}{{$ns}}{{end}};
586+
gateway={{ (index .Hardware.Interfaces 0).DHCP.IP.Gateway }}
587+
method=manual
588+
589+
[ipv6]
590+
addr-gen-mode=default
591+
method=ignore
592+
{{ end }}
512593
DEST_DISK: '{{ formatPartition ( index .Hardware.Disks 0 ) 1 }}'
513-
DEST_PATH: /etc/netplan/config.yaml
594+
DEST_PATH: /etc/NetworkManager/system-connections/static-connection.nmconnection
514595
DIRMODE: "0755"
515596
FS_TYPE: ext4
516597
GID: "0"
517-
MODE: "0644"
518-
STATIC_NETPLAN: "true"
598+
MODE: "0600"
519599
UID: "0"
520600
image: 127.0.0.1/embedded/writefile
521-
name: write netplan config
601+
name: write network manager config
522602
pid: host
523603
timeout: 90
524604
- environment:

0 commit comments

Comments
 (0)