talos

Форк
0
/
default.go 
397 строк · 9.0 Кб
1
// This Source Code Form is subject to the terms of the Mozilla Public
2
// License, v. 2.0. If a copy of the MPL was not distributed with this
3
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4

5
package profile
6

7
import (
8
	"github.com/siderolabs/go-pointer"
9

10
	"github.com/siderolabs/talos/pkg/machinery/constants"
11
)
12

13
const (
14
	mib = 1024 * 1024
15

16
	// MinRAWDiskSize is the minimum size disk we can create. Used for metal images.
17
	MinRAWDiskSize = 1246 * mib
18

19
	// DefaultRAWDiskSize is the value we use for any non-metal images by default.
20
	DefaultRAWDiskSize = 8192 * mib
21
)
22

23
// Default describes built-in profiles.
24
var Default = map[string]Profile{
25
	// ISO
26
	"iso": {
27
		Platform:   constants.PlatformMetal,
28
		SecureBoot: pointer.To(false),
29
		Output: Output{
30
			Kind:      OutKindISO,
31
			OutFormat: OutFormatRaw,
32
		},
33
	},
34
	"secureboot-iso": {
35
		Platform:   constants.PlatformMetal,
36
		SecureBoot: pointer.To(true),
37
		Output: Output{
38
			Kind:      OutKindISO,
39
			OutFormat: OutFormatRaw,
40
			ISOOptions: &ISOOptions{
41
				SDBootEnrollKeys: SDBootEnrollKeysIfSafe,
42
			},
43
		},
44
	},
45
	// Metal images
46
	"metal": {
47
		Platform:   constants.PlatformMetal,
48
		SecureBoot: pointer.To(false),
49
		Output: Output{
50
			Kind:      OutKindImage,
51
			OutFormat: OutFormatZSTD,
52
			ImageOptions: &ImageOptions{
53
				DiskSize:   MinRAWDiskSize,
54
				DiskFormat: DiskFormatRaw,
55
			},
56
		},
57
	},
58
	"secureboot-metal": {
59
		Platform:   constants.PlatformMetal,
60
		SecureBoot: pointer.To(true),
61
		Output: Output{
62
			Kind:      OutKindImage,
63
			OutFormat: OutFormatZSTD,
64
			ImageOptions: &ImageOptions{
65
				DiskSize:   MinRAWDiskSize,
66
				DiskFormat: DiskFormatRaw,
67
			},
68
		},
69
	},
70
	"installer": {
71
		Platform:   "metal",
72
		SecureBoot: pointer.To(false),
73
		Output: Output{
74
			Kind:      OutKindInstaller,
75
			OutFormat: OutFormatRaw,
76
		},
77
	},
78
	"secureboot-installer": {
79
		Platform:   "metal",
80
		SecureBoot: pointer.To(true),
81
		Output: Output{
82
			Kind:      OutKindInstaller,
83
			OutFormat: OutFormatRaw,
84
		},
85
	},
86
	// Clouds
87
	"akamai": {
88
		Platform:   "akamai",
89
		SecureBoot: pointer.To(false),
90
		Output: Output{
91
			Kind:      OutKindImage,
92
			OutFormat: OutFormatGZ,
93
			ImageOptions: &ImageOptions{
94
				DiskSize:   MinRAWDiskSize,
95
				DiskFormat: DiskFormatRaw,
96
			},
97
		},
98
	},
99
	"aws": {
100
		Platform:   "aws",
101
		SecureBoot: pointer.To(false),
102
		Output: Output{
103
			Kind:      OutKindImage,
104
			OutFormat: OutFormatZSTD,
105
			ImageOptions: &ImageOptions{
106
				DiskSize:   DefaultRAWDiskSize,
107
				DiskFormat: DiskFormatRaw,
108
			},
109
		},
110
	},
111
	"azure": {
112
		Platform:   "azure",
113
		SecureBoot: pointer.To(false),
114
		Output: Output{
115
			Kind:      OutKindImage,
116
			OutFormat: OutFormatZSTD,
117
			ImageOptions: &ImageOptions{
118
				DiskSize:          DefaultRAWDiskSize,
119
				DiskFormat:        DiskFormatVPC,
120
				DiskFormatOptions: "subformat=fixed,force_size",
121
			},
122
		},
123
	},
124
	"digital-ocean": {
125
		Platform:   "digital-ocean",
126
		SecureBoot: pointer.To(false),
127
		Output: Output{
128
			Kind:      OutKindImage,
129
			OutFormat: OutFormatGZ,
130
			ImageOptions: &ImageOptions{
131
				DiskSize:   DefaultRAWDiskSize,
132
				DiskFormat: DiskFormatRaw,
133
			},
134
		},
135
	},
136
	"exoscale": {
137
		Platform:   "exoscale",
138
		SecureBoot: pointer.To(false),
139
		Output: Output{
140
			Kind:      OutKindImage,
141
			OutFormat: OutFormatZSTD,
142
			ImageOptions: &ImageOptions{
143
				DiskSize:          10 * 1024 * mib,
144
				DiskFormat:        DiskFormatQCOW2,
145
				DiskFormatOptions: "cluster_size=8k",
146
			},
147
		},
148
	},
149
	"gcp": {
150
		Platform:   "gcp",
151
		SecureBoot: pointer.To(false),
152
		Output: Output{
153
			Kind:      OutKindImage,
154
			OutFormat: OutFormatTar,
155
			ImageOptions: &ImageOptions{
156
				DiskSize:   DefaultRAWDiskSize,
157
				DiskFormat: DiskFormatRaw,
158
			},
159
		},
160
	},
161
	"hcloud": {
162
		Platform:   "hcloud",
163
		SecureBoot: pointer.To(false),
164
		Output: Output{
165
			Kind:      OutKindImage,
166
			OutFormat: OutFormatZSTD,
167
			ImageOptions: &ImageOptions{
168
				DiskSize:   MinRAWDiskSize,
169
				DiskFormat: DiskFormatRaw,
170
			},
171
		},
172
	},
173
	"nocloud": {
174
		Platform:   "nocloud",
175
		SecureBoot: pointer.To(false),
176
		Output: Output{
177
			Kind:      OutKindImage,
178
			OutFormat: OutFormatZSTD,
179
			ImageOptions: &ImageOptions{
180
				DiskSize:   MinRAWDiskSize,
181
				DiskFormat: DiskFormatRaw,
182
			},
183
		},
184
	},
185
	"opennebula": {
186
		Platform:   "opennebula",
187
		SecureBoot: pointer.To(false),
188
		Output: Output{
189
			Kind:      OutKindImage,
190
			OutFormat: OutFormatZSTD,
191
			ImageOptions: &ImageOptions{
192
				DiskSize:   MinRAWDiskSize,
193
				DiskFormat: DiskFormatRaw,
194
			},
195
		},
196
	},
197
	"openstack": {
198
		Platform:   "openstack",
199
		SecureBoot: pointer.To(false),
200
		Output: Output{
201
			Kind:      OutKindImage,
202
			OutFormat: OutFormatZSTD,
203
			ImageOptions: &ImageOptions{
204
				DiskSize:   MinRAWDiskSize,
205
				DiskFormat: DiskFormatRaw,
206
			},
207
		},
208
	},
209
	"oracle": {
210
		Platform:   "oracle",
211
		SecureBoot: pointer.To(false),
212
		Output: Output{
213
			Kind:      OutKindImage,
214
			OutFormat: OutFormatZSTD,
215
			ImageOptions: &ImageOptions{
216
				DiskSize:          DefaultRAWDiskSize,
217
				DiskFormat:        DiskFormatQCOW2,
218
				DiskFormatOptions: "cluster_size=8k",
219
			},
220
		},
221
	},
222
	"scaleway": {
223
		Platform:   "scaleway",
224
		SecureBoot: pointer.To(false),
225
		Output: Output{
226
			Kind:      OutKindImage,
227
			OutFormat: OutFormatZSTD,
228
			ImageOptions: &ImageOptions{
229
				DiskSize:   MinRAWDiskSize,
230
				DiskFormat: DiskFormatRaw,
231
			},
232
		},
233
	},
234
	"upcloud": {
235
		Platform:   "upcloud",
236
		SecureBoot: pointer.To(false),
237
		Output: Output{
238
			Kind:      OutKindImage,
239
			OutFormat: OutFormatZSTD,
240
			ImageOptions: &ImageOptions{
241
				DiskSize:   DefaultRAWDiskSize,
242
				DiskFormat: DiskFormatRaw,
243
			},
244
		},
245
	},
246
	"vmware": {
247
		Platform:   "vmware",
248
		SecureBoot: pointer.To(false),
249
		Output: Output{
250
			Kind:      OutKindImage,
251
			OutFormat: OutFormatRaw,
252
			ImageOptions: &ImageOptions{
253
				DiskSize:   DefaultRAWDiskSize,
254
				DiskFormat: DiskFormatOVA,
255
			},
256
		},
257
	},
258
	"vultr": {
259
		Platform:   "vultr",
260
		SecureBoot: pointer.To(false),
261
		Output: Output{
262
			Kind:      OutKindImage,
263
			OutFormat: OutFormatZSTD,
264
			ImageOptions: &ImageOptions{
265
				DiskSize:   DefaultRAWDiskSize,
266
				DiskFormat: DiskFormatRaw,
267
			},
268
		},
269
	},
270
	// SBCs
271
	constants.BoardRPiGeneric: {
272
		Arch:       "arm64",
273
		Platform:   constants.PlatformMetal,
274
		Board:      constants.BoardRPiGeneric,
275
		SecureBoot: pointer.To(false),
276
		Output: Output{
277
			Kind:      OutKindImage,
278
			OutFormat: OutFormatZSTD,
279
			ImageOptions: &ImageOptions{
280
				DiskSize:   MinRAWDiskSize,
281
				DiskFormat: DiskFormatRaw,
282
			},
283
		},
284
	},
285
	constants.BoardRock64: {
286
		Arch:       "arm64",
287
		Platform:   constants.PlatformMetal,
288
		Board:      constants.BoardRock64,
289
		SecureBoot: pointer.To(false),
290
		Output: Output{
291
			Kind:      OutKindImage,
292
			OutFormat: OutFormatZSTD,
293
			ImageOptions: &ImageOptions{
294
				DiskSize:   MinRAWDiskSize,
295
				DiskFormat: DiskFormatRaw,
296
			},
297
		},
298
	},
299
	constants.BoardBananaPiM64: {
300
		Arch:       "arm64",
301
		Platform:   constants.PlatformMetal,
302
		Board:      constants.BoardBananaPiM64,
303
		SecureBoot: pointer.To(false),
304
		Output: Output{
305
			Kind:      OutKindImage,
306
			OutFormat: OutFormatZSTD,
307
			ImageOptions: &ImageOptions{
308
				DiskSize:   MinRAWDiskSize,
309
				DiskFormat: DiskFormatRaw,
310
			},
311
		},
312
	},
313
	constants.BoardLibretechAllH3CCH5: {
314
		Arch:       "arm64",
315
		Platform:   constants.PlatformMetal,
316
		Board:      constants.BoardLibretechAllH3CCH5,
317
		SecureBoot: pointer.To(false),
318
		Output: Output{
319
			Kind:      OutKindImage,
320
			OutFormat: OutFormatZSTD,
321
			ImageOptions: &ImageOptions{
322
				DiskSize:   MinRAWDiskSize,
323
				DiskFormat: DiskFormatRaw,
324
			},
325
		},
326
	},
327
	constants.BoardRockpi4: {
328
		Arch:       "arm64",
329
		Platform:   constants.PlatformMetal,
330
		Board:      constants.BoardRockpi4,
331
		SecureBoot: pointer.To(false),
332
		Output: Output{
333
			Kind:      OutKindImage,
334
			OutFormat: OutFormatZSTD,
335
			ImageOptions: &ImageOptions{
336
				DiskSize:   MinRAWDiskSize,
337
				DiskFormat: DiskFormatRaw,
338
			},
339
		},
340
	},
341
	constants.BoardRockpi4c: {
342
		Arch:       "arm64",
343
		Platform:   constants.PlatformMetal,
344
		Board:      constants.BoardRockpi4c,
345
		SecureBoot: pointer.To(false),
346
		Output: Output{
347
			Kind:      OutKindImage,
348
			OutFormat: OutFormatZSTD,
349
			ImageOptions: &ImageOptions{
350
				DiskSize:   MinRAWDiskSize,
351
				DiskFormat: DiskFormatRaw,
352
			},
353
		},
354
	},
355
	constants.BoardPine64: {
356
		Arch:       "arm64",
357
		Platform:   constants.PlatformMetal,
358
		Board:      constants.BoardPine64,
359
		SecureBoot: pointer.To(false),
360
		Output: Output{
361
			Kind:      OutKindImage,
362
			OutFormat: OutFormatZSTD,
363
			ImageOptions: &ImageOptions{
364
				DiskSize:   MinRAWDiskSize,
365
				DiskFormat: DiskFormatRaw,
366
			},
367
		},
368
	},
369
	constants.BoardJetsonNano: {
370
		Arch:       "arm64",
371
		Platform:   constants.PlatformMetal,
372
		Board:      constants.BoardJetsonNano,
373
		SecureBoot: pointer.To(false),
374
		Output: Output{
375
			Kind:      OutKindImage,
376
			OutFormat: OutFormatZSTD,
377
			ImageOptions: &ImageOptions{
378
				DiskSize:   MinRAWDiskSize,
379
				DiskFormat: DiskFormatRaw,
380
			},
381
		},
382
	},
383
	constants.BoardNanoPiR4S: {
384
		Arch:       "arm64",
385
		Platform:   constants.PlatformMetal,
386
		Board:      constants.BoardNanoPiR4S,
387
		SecureBoot: pointer.To(false),
388
		Output: Output{
389
			Kind:      OutKindImage,
390
			OutFormat: OutFormatZSTD,
391
			ImageOptions: &ImageOptions{
392
				DiskSize:   MinRAWDiskSize,
393
				DiskFormat: DiskFormatRaw,
394
			},
395
		},
396
	},
397
}
398

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.