Skip to content

Commit b0ae235

Browse files
committed
Windows support PoC. Provisioner field
Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com>
1 parent 049ba8c commit b0ae235

23 files changed

Lines changed: 999 additions & 48 deletions

api/bootstrap/v1beta1/k0s_types.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@ type K0sWorkerConfigList struct {
6363
}
6464

6565
type K0sWorkerConfigSpec struct {
66+
// Provisioner defines the provisioner configuration. Defaults to cloud-init.
67+
// +kubebuilder:validation:Optional
68+
Provisioner ProvisionerSpec `json:"provisioner,omitempty"`
6669
// Ignition defines the ignition configuration. If empty, k0smotron will use cloud-init.
6770
// +kubebuilder:validation:Optional
71+
// Deprecated: use provisioner.ignition instead
6872
Ignition *IgnitionSpec `json:"ignition,omitempty"`
6973
// K0sInstallDir specifies the directory where k0s binary will be installed.
7074
// If empty, k0smotron will use /usr/local/bin, which is the default install path used by k0s get script.
@@ -243,6 +247,9 @@ type ContentSourceRef struct {
243247
}
244248

245249
type K0sConfigSpec struct {
250+
// Provisioner defines the provisioner configuration. Defaults to cloud-init.
251+
// +kubebuilder:validation:Optional
252+
Provisioner ProvisionerSpec `json:"provisioner,omitempty"`
246253
// Ignition defines the ignition configuration. If empty, k0smotron will use cloud-init.
247254
// +kubebuilder:validation:Optional
248255
Ignition *IgnitionSpec `json:"ignition,omitempty"`
@@ -333,6 +340,12 @@ type TunnelingSpec struct {
333340
Mode string `json:"mode,omitempty"`
334341
}
335342

343+
// ProvisionerSpec defines the provisioner configuration.§
344+
type ProvisionerSpec struct {
345+
Type provisioner.ProvisioningFormat `json:"type,omitempty"`
346+
Ignition *IgnitionSpec `json:"ignition,omitempty"`
347+
}
348+
336349
// IgnitionSpec defines the configuration for the Ignition provisioner.
337350
type IgnitionSpec struct {
338351
// Variant declares which distribution variant the generated config is for.

api/bootstrap/v1beta1/zz_generated.deepcopy.go

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

config/clusterapi/bootstrap/bases/bootstrap.cluster.x-k8s.io_k0scontrollerconfigs.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,46 @@ spec:
203203
items:
204204
type: string
205205
type: array
206+
provisioner:
207+
description: Provisioner defines the provisioner configuration. Defaults
208+
to cloud-init.
209+
properties:
210+
ignition:
211+
description: IgnitionSpec defines the configuration for the Ignition
212+
provisioner.
213+
properties:
214+
additionalConfig:
215+
description: |-
216+
AdditionalConfig is an unstructured object that contains additional config to be merged
217+
with the generated one. The format follows Butane spec: https://coreos.github.io/butane/
218+
type: string
219+
variant:
220+
description: |-
221+
Variant declares which distribution variant the generated config is for.
222+
Check the supported variants and versions here:
223+
https://coreos.github.io/butane/specs/#butane-specifications-and-ignition-specifications
224+
enum:
225+
- fcos
226+
- flatcar
227+
- openshift
228+
- r4e
229+
- fiot
230+
type: string
231+
version:
232+
description: |-
233+
Version is the schema version of the Butane config to use
234+
Check the supported variants and versions here:
235+
https://coreos.github.io/butane/specs/#butane-specifications-and-ignition-specifications
236+
type: string
237+
required:
238+
- variant
239+
- version
240+
type: object
241+
type:
242+
description: ProvisioningFormat represents the format used for
243+
provisioning.
244+
type: string
245+
type: object
206246
tunneling:
207247
description: Tunneling defines the tunneling configuration for the
208248
cluster.

config/clusterapi/bootstrap/bases/bootstrap.cluster.x-k8s.io_k0sworkerconfigs.yaml

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ spec:
140140
type: object
141141
type: array
142142
ignition:
143-
description: Ignition defines the ignition configuration. If empty,
144-
k0smotron will use cloud-init.
143+
description: |-
144+
Ignition defines the ignition configuration. If empty, k0smotron will use cloud-init.
145+
Deprecated: use provisioner.ignition instead
145146
properties:
146147
additionalConfig:
147148
description: |-
@@ -195,6 +196,46 @@ spec:
195196
items:
196197
type: string
197198
type: array
199+
provisioner:
200+
description: Provisioner defines the provisioner configuration. Defaults
201+
to cloud-init.
202+
properties:
203+
ignition:
204+
description: IgnitionSpec defines the configuration for the Ignition
205+
provisioner.
206+
properties:
207+
additionalConfig:
208+
description: |-
209+
AdditionalConfig is an unstructured object that contains additional config to be merged
210+
with the generated one. The format follows Butane spec: https://coreos.github.io/butane/
211+
type: string
212+
variant:
213+
description: |-
214+
Variant declares which distribution variant the generated config is for.
215+
Check the supported variants and versions here:
216+
https://coreos.github.io/butane/specs/#butane-specifications-and-ignition-specifications
217+
enum:
218+
- fcos
219+
- flatcar
220+
- openshift
221+
- r4e
222+
- fiot
223+
type: string
224+
version:
225+
description: |-
226+
Version is the schema version of the Butane config to use
227+
Check the supported variants and versions here:
228+
https://coreos.github.io/butane/specs/#butane-specifications-and-ignition-specifications
229+
type: string
230+
required:
231+
- variant
232+
- version
233+
type: object
234+
type:
235+
description: ProvisioningFormat represents the format used for
236+
provisioning.
237+
type: string
238+
type: object
198239
secretMetadata:
199240
description: SecretMetadata specifies metadata (labels and annotations)
200241
to be propagated to the bootstrap Secret.

config/clusterapi/bootstrap/bases/bootstrap.cluster.x-k8s.io_k0sworkerconfigtemplates.yaml

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,9 @@ spec:
164164
type: object
165165
type: array
166166
ignition:
167-
description: Ignition defines the ignition configuration.
168-
If empty, k0smotron will use cloud-init.
167+
description: |-
168+
Ignition defines the ignition configuration. If empty, k0smotron will use cloud-init.
169+
Deprecated: use provisioner.ignition instead
169170
properties:
170171
additionalConfig:
171172
description: |-
@@ -220,6 +221,46 @@ spec:
220221
items:
221222
type: string
222223
type: array
224+
provisioner:
225+
description: Provisioner defines the provisioner configuration.
226+
Defaults to cloud-init.
227+
properties:
228+
ignition:
229+
description: IgnitionSpec defines the configuration for
230+
the Ignition provisioner.
231+
properties:
232+
additionalConfig:
233+
description: |-
234+
AdditionalConfig is an unstructured object that contains additional config to be merged
235+
with the generated one. The format follows Butane spec: https://coreos.github.io/butane/
236+
type: string
237+
variant:
238+
description: |-
239+
Variant declares which distribution variant the generated config is for.
240+
Check the supported variants and versions here:
241+
https://coreos.github.io/butane/specs/#butane-specifications-and-ignition-specifications
242+
enum:
243+
- fcos
244+
- flatcar
245+
- openshift
246+
- r4e
247+
- fiot
248+
type: string
249+
version:
250+
description: |-
251+
Version is the schema version of the Butane config to use
252+
Check the supported variants and versions here:
253+
https://coreos.github.io/butane/specs/#butane-specifications-and-ignition-specifications
254+
type: string
255+
required:
256+
- variant
257+
- version
258+
type: object
259+
type:
260+
description: ProvisioningFormat represents the format
261+
used for provisioning.
262+
type: string
263+
type: object
223264
secretMetadata:
224265
description: SecretMetadata specifies metadata (labels and
225266
annotations) to be propagated to the bootstrap Secret.

config/clusterapi/controlplane/bases/controlplane.cluster.x-k8s.io_k0scontrolplanes.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,46 @@ spec:
246246
items:
247247
type: string
248248
type: array
249+
provisioner:
250+
description: Provisioner defines the provisioner configuration.
251+
Defaults to cloud-init.
252+
properties:
253+
ignition:
254+
description: IgnitionSpec defines the configuration for the
255+
Ignition provisioner.
256+
properties:
257+
additionalConfig:
258+
description: |-
259+
AdditionalConfig is an unstructured object that contains additional config to be merged
260+
with the generated one. The format follows Butane spec: https://coreos.github.io/butane/
261+
type: string
262+
variant:
263+
description: |-
264+
Variant declares which distribution variant the generated config is for.
265+
Check the supported variants and versions here:
266+
https://coreos.github.io/butane/specs/#butane-specifications-and-ignition-specifications
267+
enum:
268+
- fcos
269+
- flatcar
270+
- openshift
271+
- r4e
272+
- fiot
273+
type: string
274+
version:
275+
description: |-
276+
Version is the schema version of the Butane config to use
277+
Check the supported variants and versions here:
278+
https://coreos.github.io/butane/specs/#butane-specifications-and-ignition-specifications
279+
type: string
280+
required:
281+
- variant
282+
- version
283+
type: object
284+
type:
285+
description: ProvisioningFormat represents the format used
286+
for provisioning.
287+
type: string
288+
type: object
249289
tunneling:
250290
description: Tunneling defines the tunneling configuration for
251291
the cluster.

config/clusterapi/controlplane/bases/controlplane.cluster.x-k8s.io_k0scontrolplanetemplates.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,46 @@ spec:
228228
items:
229229
type: string
230230
type: array
231+
provisioner:
232+
description: Provisioner defines the provisioner configuration.
233+
Defaults to cloud-init.
234+
properties:
235+
ignition:
236+
description: IgnitionSpec defines the configuration
237+
for the Ignition provisioner.
238+
properties:
239+
additionalConfig:
240+
description: |-
241+
AdditionalConfig is an unstructured object that contains additional config to be merged
242+
with the generated one. The format follows Butane spec: https://coreos.github.io/butane/
243+
type: string
244+
variant:
245+
description: |-
246+
Variant declares which distribution variant the generated config is for.
247+
Check the supported variants and versions here:
248+
https://coreos.github.io/butane/specs/#butane-specifications-and-ignition-specifications
249+
enum:
250+
- fcos
251+
- flatcar
252+
- openshift
253+
- r4e
254+
- fiot
255+
type: string
256+
version:
257+
description: |-
258+
Version is the schema version of the Butane config to use
259+
Check the supported variants and versions here:
260+
https://coreos.github.io/butane/specs/#butane-specifications-and-ignition-specifications
261+
type: string
262+
required:
263+
- variant
264+
- version
265+
type: object
266+
type:
267+
description: ProvisioningFormat represents the format
268+
used for provisioning.
269+
type: string
270+
type: object
231271
tunneling:
232272
description: Tunneling defines the tunneling configuration
233273
for the cluster.

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,46 @@ spec:
203203
items:
204204
type: string
205205
type: array
206+
provisioner:
207+
description: Provisioner defines the provisioner configuration. Defaults
208+
to cloud-init.
209+
properties:
210+
ignition:
211+
description: IgnitionSpec defines the configuration for the Ignition
212+
provisioner.
213+
properties:
214+
additionalConfig:
215+
description: |-
216+
AdditionalConfig is an unstructured object that contains additional config to be merged
217+
with the generated one. The format follows Butane spec: https://coreos.github.io/butane/
218+
type: string
219+
variant:
220+
description: |-
221+
Variant declares which distribution variant the generated config is for.
222+
Check the supported variants and versions here:
223+
https://coreos.github.io/butane/specs/#butane-specifications-and-ignition-specifications
224+
enum:
225+
- fcos
226+
- flatcar
227+
- openshift
228+
- r4e
229+
- fiot
230+
type: string
231+
version:
232+
description: |-
233+
Version is the schema version of the Butane config to use
234+
Check the supported variants and versions here:
235+
https://coreos.github.io/butane/specs/#butane-specifications-and-ignition-specifications
236+
type: string
237+
required:
238+
- variant
239+
- version
240+
type: object
241+
type:
242+
description: ProvisioningFormat represents the format used for
243+
provisioning.
244+
type: string
245+
type: object
206246
tunneling:
207247
description: Tunneling defines the tunneling configuration for the
208248
cluster.

0 commit comments

Comments
 (0)