Skip to content

Commit 7bd0701

Browse files
committed
feat: add support for embedding machine configuration
allow embedding machine configuration into Talos images. Signed-off-by: Orzelius <33936483+Orzelius@users.noreply.github.com>
1 parent 9f6aee8 commit 7bd0701

18 files changed

Lines changed: 302 additions & 44 deletions

File tree

docs/api.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,16 @@ customization:
6565
# optional, include well-known UEFI certificates into auto-enrollment database (SecureBoot ISO only)
6666
includeWellKnownCertificates: true
6767
bootloader: sd-boot # optional, defaults to auto (bootloader chosen by imager), other options: dual-boot, grub
68+
embeddedMachineConfiguration: | # optional, embedded machine configuration (YAML-encoded)
69+
apiVersion: v1alpha1
70+
kind: HostnameConfig
71+
hostname: my-custom-hostname
72+
auto: off
73+
---
74+
apiVersion: v1alpha1
75+
kind: KmsgLogConfig
76+
name: remote-log
77+
url: tcp://10.0.0.50:5044/
6878
overlay: # optional
6979
image: ghcr.io/siderolabs/sbc-raspberry-pi # overlay image
7080
name: rpi_generic # overlay name

hack/release.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ pre_release = false
1010

1111
[notes]
1212

13+
[notes.scanner]
14+
title = "Machine configuration embedding"
15+
description = """\
16+
Image Factory now supports embedding machine configuration into generated images starting with Talos version 1.2.0 onwards.
17+
"""
18+
1319
[make_deps]
1420

1521
[make_deps.pkgs]

internal/frontend/http/css/output.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/frontend/http/locales/active.en.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,18 @@
184184
- id: customization.overlay.skip
185185
translation: "If unsure, you can skip this step."
186186

187+
- id: customization.embedded_config
188+
translation: "Embedded machine configuration:"
189+
190+
- id: customization.embedded_config.description
191+
translation: "This configuration will be embedded into the image. For more details see the "
192+
193+
- id: customization.embedded_config.reference
194+
translation: "documentation"
195+
196+
- id: customization.embedded_config.skip
197+
translation: "Skip this step if unsure."
198+
187199
- id: customization.bootloader.title
188200
translation: "Bootloader"
189201

internal/frontend/http/locales/active.fr.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,18 @@
184184
- id: customization.overlay.skip
185185
translation: "En cas de doute, vous pouvez ignorer cette étape."
186186

187+
- id: customization.embedded_config
188+
translation: "Configuration machine intégrée :"
189+
190+
- id: customization.embedded_config.description
191+
translation: "Cette configuration sera intégrée à l'image. Pour plus de détails, consultez la "
192+
193+
- id: customization.embedded_config.reference
194+
translation: "documentation"
195+
196+
- id: customization.embedded_config.skip
197+
translation: "Ignorez cette étape en cas de doute."
198+
187199
- id: customization.bootloader.title
188200
translation: "Chargeur d'amorçage"
189201

internal/frontend/http/locales/active.pl.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,18 @@
184184
- id: customization.overlay.skip
185185
translation: "Jeśli nie masz pewności - możesz pominąć ten krok."
186186

187+
- id: customization.embedded_config
188+
translation: "Wbudowana konfiguracja maszyny:"
189+
190+
- id: customization.embedded_config.description
191+
translation: "Ta konfiguracja zostanie wbudowana w obraz. Aby uzyskać więcej informacji, zobacz "
192+
193+
- id: customization.embedded_config.reference
194+
translation: "dokumentację"
195+
196+
- id: customization.embedded_config.skip
197+
translation: "Pomiń ten krok, jeśli nie masz pewności."
198+
187199
- id: customization.bootloader.title
188200
translation: "Program rozruchowy"
189201

internal/frontend/http/locales/active.ru.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,18 @@
184184
- id: customization.overlay.skip
185185
translation: "Если не уверены — можно пропустить."
186186

187+
- id: customization.embedded_config
188+
translation: "Встроенная конфигурация машины:"
189+
190+
- id: customization.embedded_config.description
191+
translation: "Эта конфигурация будет встроена в образ. Подробнее см. в "
192+
193+
- id: customization.embedded_config.reference
194+
translation: "документации"
195+
196+
- id: customization.embedded_config.skip
197+
translation: "Пропустите этот шаг, если не уверены."
198+
187199
- id: customization.bootloader.auto.name
188200
translation: "Авто"
189201

internal/frontend/http/templates/common.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ <h1 class="mb-4 mt-2 text-2xl font-bold">{{ . }}</h1>
9898
<input type="hidden" name="selected-bootloader" value="{{ .Bootloader }}">
9999
<input type="hidden" name="overlay-options" value="{{ .OverlayOptions }}">
100100
<input type="hidden" name="selected-overlay-options" value="{{ .OverlayOptions }}">
101+
<input type="hidden" name="embedded-config" value="{{ .EmbeddedConfig }}">
102+
<input type="hidden" name="selected-embedded-config" value="{{ .EmbeddedConfig }}">
101103
{{- end -}}
102104
{{ end }}
103105

@@ -107,7 +109,7 @@ <h1 class="mb-4 mt-2 text-2xl font-bold">{{ . }}</h1>
107109
href="https://docs.siderolabs.com/talos/{{ short_version .Version }}{{ .Platform.Documentation}}">{{ t .Localizer
108110
"common.documentation" }}</a>).
109111
{{ end }}
110-
112+
111113
{{ define "board-description" }}
112114
{{ t .Localizer "common.runs_on" }} {{ .Board.Label }}{{ if .Board.Documentation }} (<a target="_blank"
113115
class="text-blue-600 dark:text-blue-500 underline"

internal/frontend/http/templates/wizard-cmdline.html

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<input name="cmdline-set" type="hidden" value="1">
1313
</div>
1414

15-
<div class="ms-2 prose dark:prose-invert prose-sm">
15+
<div class="ms-2 prose dark:prose-invert prose-sm mb-6">
1616
<p>
1717
{{ t .Localizer "customization.cmdline.description" }}<a target="_blank"
1818
href="https://docs.siderolabs.com/talos/{{ short_version .Version }}/reference/kernel/">{{ t .Localizer
@@ -37,6 +37,30 @@
3737
</p>
3838
</div>
3939

40+
{{ if .EmbeddedConfigEnabled }}
41+
<div class="mb-6">
42+
<label for="embedded-config" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">
43+
{{ t .Localizer "customization.embedded_config" }}
44+
</label>
45+
<textarea id="embedded-config" name="embedded-config"
46+
class="bg-gray-50 border min-h-24 border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full h-16 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
47+
placeholder="apiVersion: v1alpha1
48+
kind: HostnameConfig
49+
hostname: my-custom-hostname
50+
auto: off">{{ .SelectedEmbeddedConfig }}</textarea>
51+
</div>
52+
53+
<div class="ms-2 prose dark:prose-invert prose-sm mb-6">
54+
<p>
55+
{{ t .Localizer "customization.embedded_config.description" }}<a target="_blank"
56+
href="https://docs.siderolabs.com/talos/{{ short_version .Version }}/configure-your-talos-cluster/system-configuration/acquire#embedded-configuration"> {{ t .Localizer "customization.embedded_config.reference" }}</a>.
57+
</p>
58+
<p>
59+
{{ t .Localizer "customization.embedded_config.skip" }}
60+
</p>
61+
</div>
62+
{{ end }}
63+
4064
{{ if .OverlayOptionsEnabled }}
4165
<div class="mb-6 mt-6">
4266
<label for="extra-overlay-options" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">

internal/frontend/http/templates/wizard-final.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ <h2>{{ t .Localizer "final.extra.vex" }}</h2>
382382

383383
<div class="flex gap-4">
384384
{{ template "back-button" (dict "Params"
385-
"target,version,platform,board,arch,secureboot,extensions,selected-bootloader,selected-cmdline,selected-overlay-options"
385+
"target,version,platform,board,arch,secureboot,extensions,selected-bootloader,selected-cmdline,selected-overlay-options,selected-embedded-config"
386386
"Localizer" .Localizer) }}
387387
</div>
388388
{{ end }}

0 commit comments

Comments
 (0)