Skip to content

Commit d1a5fd9

Browse files
rsmittyandrewrynhard
authored andcommitted
feat: allow for BYO-MachineConfigs
This PR will allow for users to do some far more complex Talos deployments with our CAPI components. You can now specify `none` for the generateType falue, then pre-generate configs with `osctl config generate` and pop them right into the `data` field of the TalosConfig resource. Signed-off-by: Spencer Smith <[email protected]>
1 parent adcb6da commit d1a5fd9

File tree

7 files changed

+178
-144
lines changed

7 files changed

+178
-144
lines changed

api/v1alpha2/talosconfig_types.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,8 @@ const (
2929

3030
// TalosConfigSpec defines the desired state of TalosConfig
3131
type TalosConfigSpec struct {
32-
MachineType string `json:"machineType,omitempty"`
33-
NetworkInterfaces []Device `json:"networkInterfaces,omitempty"`
34-
InstallImage string `json:"installImage,omitempty"`
35-
InstallDisk string `json:"installDisk,omitempty"`
36-
CNIUrls []string `json:"cniUrls,omitempty"`
32+
GenerateType string `json:"generateType"` //none,init,controlplane,worker mutually exclusive w/ data
33+
Data string `json:"data,omitempty"`
3734
// Important: Run "make" to regenerate code after modifying this file
3835
}
3936

api/v1alpha2/zz_generated.deepcopy.go

Lines changed: 4 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/bootstrap.cluster.x-k8s.io_talosconfigs.yaml

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,12 @@ spec:
3838
spec:
3939
description: TalosConfigSpec defines the desired state of TalosConfig
4040
properties:
41-
cniUrls:
42-
items:
43-
type: string
44-
type: array
45-
installDisk:
41+
data:
4642
type: string
47-
installImage:
43+
generateType:
4844
type: string
49-
machineType:
50-
type: string
51-
networkInterfaces:
52-
items:
53-
description: Device represents a network interface.
54-
properties:
55-
ignore:
56-
type: boolean
57-
interface:
58-
type: string
59-
required:
60-
- ignore
61-
- interface
62-
type: object
63-
type: array
45+
required:
46+
- generateType
6447
type: object
6548
status:
6649
description: TalosConfigStatus defines the observed state of TalosConfig

config/crd/bases/bootstrap.cluster.x-k8s.io_talosconfigtemplates.yaml

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,29 +43,12 @@ spec:
4343
spec:
4444
description: TalosConfigSpec defines the desired state of TalosConfig
4545
properties:
46-
cniUrls:
47-
items:
48-
type: string
49-
type: array
50-
installDisk:
46+
data:
5147
type: string
52-
installImage:
48+
generateType:
5349
type: string
54-
machineType:
55-
type: string
56-
networkInterfaces:
57-
items:
58-
description: Device represents a network interface.
59-
properties:
60-
ignore:
61-
type: boolean
62-
interface:
63-
type: string
64-
required:
65-
- ignore
66-
- interface
67-
type: object
68-
type: array
50+
required:
51+
- generateType
6952
type: object
7053
type: object
7154
required:

0 commit comments

Comments
 (0)