Conversation
38b25a2 to
839df8c
Compare
0bde38c to
c48a0f1
Compare
b0ae235 to
3d710c2
Compare
apedriza
left a comment
There was a problem hiding this comment.
wdyt about adding some flavor in the e2e for windows provisioning and use our current AWS nightly workflow?
api/bootstrap/v1beta1/k0s_types.go
Outdated
|
|
||
| // ProvisionerSpec defines the provisioner configuration.§ | ||
| type ProvisionerSpec struct { | ||
| Type provisioner.ProvisioningFormat `json:"type,omitempty"` |
There was a problem hiding this comment.
we could add +kubebuilder:validation:Enum for static validation about supported types
| } | ||
|
|
||
| func getProvisioner(ignitionSpec *bootstrapv1.IgnitionSpec) provisioner.Provisioner { | ||
| func getProvisioner(provisionerSpec bootstrapv1.ProvisionerSpec, ignitionSpec *bootstrapv1.IgnitionSpec) provisioner.Provisioner { |
There was a problem hiding this comment.
what about add some condition here or even some api/admission webhook validation to avoid set/instantiate a widnows provisioner for controller nodes? that way we fail earlier
internal/provisioner/powershell.go
Outdated
| return []byte(content), nil | ||
| } | ||
|
|
||
| // GetFormat returns the format 'cloud-config' of the provisioner. |
There was a problem hiding this comment.
| // GetFormat returns the format 'cloud-config' of the provisioner. | |
| // GetFormat returns the format 'powershell' of the provisioner. |
| return &provisioner.IgnitionProvisioner{ | ||
| Variant: provisionerSpec.Ignition.Variant, | ||
| Version: provisionerSpec.Ignition.Version, | ||
| AdditionalConfig: provisionerSpec.Ignition.AdditionalConfig, |
There was a problem hiding this comment.
Possible invalid memory address here?
|
Should we add some checks in code about from which k0s version windows provisioning is supported? |
|
another doubt that I have is poweshell vs powershell-xml from my limited knowledge about windows. It is because some windows nodes cannot be provisioned using |
It's because different cloud providers support different formats. I wasn't able to test all of them, but cloudbase-init docs claim that they support plain powershell, EC2 format (powershell-xml) and cloud-init format:
Yeah, I tried to avoid adding validation webhook for K0sWorkerConfig, but considering number of checks we need - it's unavoidable :) |
Ive wrote one in this PR #1312 in case you want to reuse it or merge it first |
6ef709e to
18435c0
Compare
api/bootstrap/v1beta1/k0s_types.go
Outdated
| // +kubebuilder:validation:Optional | ||
| // +kubebuilder:default="linux" | ||
| // +kubebuilder:validation:Enum=linux;windows | ||
| Platform string `json:"platform,omitempty"` |
There was a problem hiding this comment.
Could we infer the platform from the provisioner type and remove this field? if not, add a new admission rule to avoid an unsupported provider for the choosen platform I think can help.
Or maybe create a top-level field platform and specify there the platform provisioner, defaulting to platform.linux.cloud-init. Just thinking aloud
There was a problem hiding this comment.
Cloud-init could be used both for windows and linux with RemoteMachines, so we can't reliably guess. I moved it to the provisioning section, is it better?
af06cb4 to
801192e
Compare
f85130f to
a9c606b
Compare
* v1beta2. wip Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com> # Conflicts: # internal/controller/bootstrap/controlplane_bootstrap_controller_test.go # internal/controller/bootstrap/worker_bootstrap_controller_test.go # internal/controller/controlplane/k0s_controlplane_controller_test.go # Conflicts: # config/crd/bases/bootstrap/bootstrap.cluster.x-k8s.io_k0scontrollerconfigs.yaml # config/crd/bases/bootstrap/bootstrap.cluster.x-k8s.io_k0sworkerconfigs.yaml # config/crd/bases/bootstrap/bootstrap.cluster.x-k8s.io_k0sworkerconfigtemplates.yaml # Conflicts: # internal/controller/bootstrap/controlplane_bootstrap_controller_test.go * v1beta2. controlplane api. wip Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com> # Conflicts: # internal/controller/bootstrap/controlplane_bootstrap_controller_test.go # internal/controller/bootstrap/worker_bootstrap_controller_test.go # internal/controller/controlplane/k0s_controlplane_controller_test.go * v1beta2. controlplane api. wip Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com> # Conflicts: # internal/controller/bootstrap/controlplane_bootstrap_controller_test.go # internal/controller/bootstrap/worker_bootstrap_controller_test.go # internal/controller/controlplane/k0s_controlplane_controller_test.go * v1beta2. linter fixes Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com> # Conflicts: # internal/controller/bootstrap/controlplane_bootstrap_controller_test.go # internal/controller/bootstrap/worker_bootstrap_controller_test.go # internal/controller/controlplane/k0s_controlplane_controller_test.go * v1beta2 contracts Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com> # Conflicts: # internal/controller/bootstrap/controlplane_bootstrap_controller_test.go # internal/controller/bootstrap/worker_bootstrap_controller_test.go # internal/controller/controlplane/k0s_controlplane_controller_test.go * v1beta2 contracts. printcolumns Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com> * v1beta2 contracts. review fixes Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com> * v1beta2 contracts. pointers everywhere Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com> --------- Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com> # Conflicts: # api/bootstrap/v1beta1/k0s_types.go # api/controlplane/v1beta1/k0s_types.go # config/clusterapi/controlplane/crd/bases/controlplane.cluster.x-k8s.io_k0scontrolplanes.yaml # config/crd/controlplane.cluster.x-k8s.io_k0scontrolplanes.yaml # docs/resource-reference/controlplane.cluster.x-k8s.io-v1beta1.md # internal/controller/controlplane/k0s_controlplane_controller.go # inttest/util/util.go
1db9739 to
96078d0
Compare
Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com> # Conflicts: # config/clusterapi/bootstrap/bases/bootstrap.cluster.x-k8s.io_k0sworkerconfigs.yaml # config/clusterapi/bootstrap/bases/bootstrap.cluster.x-k8s.io_k0sworkerconfigtemplates.yaml # config/crd/bases/bootstrap/bootstrap.cluster.x-k8s.io_k0sworkerconfigs.yaml # config/crd/bases/bootstrap/bootstrap.cluster.x-k8s.io_k0sworkerconfigtemplates.yaml # internal/controller/bootstrap/common.go # internal/controller/bootstrap/controlplane_bootstrap_controller.go # internal/controller/bootstrap/worker_bootstrap_controller.go # internal/controller/bootstrap/worker_bootstrap_controller_test.go # internal/provisioner/provisioner.go
Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com>
Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com> # Conflicts: # api/bootstrap/v1beta1/k0s_types.go
Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com>
Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com>
Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com>
Signed-off-by: Alexey Makhov <amakhov@mirantis.com> Signed-off-by: makhov <amakhov@mirantis.com>
a9c606b to
2184969
Compare
96078d0 to
8c75d2d
Compare
7b8da8a to
2725e5a
Compare
Windows workers support for bootstrap controller. It generates user-data as powershell script or AWS compatible "powershell-xml" format (which just wraps the powershell script in xml tags)
Note: this change introduce new
spec.provisionerstruct to let end-user decide which user-data format to use, which effectively deprecatesspec.ignitionand moves it tospec.provisioner.ignition