Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the CCM/CSI migration #1472

Merged
merged 6 commits into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/csi-openstack-cinder/driver.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: storage.k8s.io/v1beta1
apiVersion: storage.k8s.io/v1
kind: CSIDriver
metadata:
name: cinder.csi.openstack.org
Expand Down
3 changes: 3 additions & 0 deletions addons/machinecontroller/machine-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,9 @@ spec:
{{ if .Config.CloudProvider.External }}
- -node-external-cloud-provider
{{ end }}
{{ if .CSIMigrationFeatureGates }}
- -node-kubelet-feature-gates={{ .CSIMigrationFeatureGates }}
{{ end }}
env:
- name: HTTPS_PROXY
value: "{{ .Config.Proxy.HTTPS }}"
Expand Down
10 changes: 10 additions & 0 deletions pkg/addons/applier.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type templateData struct {
Config *kubeoneapi.KubeOneCluster
Certificates map[string]string
Credentials map[string]string
CSIMigrationFeatureGates string
MachineControllerCredentialsEnvVars string
InternalImages *internalImages
Resources map[string]string
Expand Down Expand Up @@ -94,6 +95,14 @@ func newAddonsApplier(s *state.State) (*applier, error) {
return nil, errors.Wrap(err, "failed to load CA keypair")
}

// We're intentionally ignoring the error here. If the provider is not supported
// the function will return an empty string (""), which we can easily detect in
// the templates
csiMigrationFeatureGates := ""
if s.ShouldEnableCSIMigration() {
_, csiMigrationFeatureGates, _ = s.Cluster.CSIMigrationFeatureGates(s.ShouldUnregisterInTreeCloudProvider())
}

certsMap, err := certificate.NewSignedWebhookCert(
resources.MachineControllerWebhookName,
resources.MachineControllerNameSpace,
Expand All @@ -113,6 +122,7 @@ func newAddonsApplier(s *state.State) (*applier, error) {
"KubernetesCA": certsMap[resources.KubernetesCACertName],
},
Credentials: creds,
CSIMigrationFeatureGates: csiMigrationFeatureGates,
MachineControllerCredentialsEnvVars: string(credsEnvVars),
InternalImages: &internalImages{
pauseImage: s.PauseImage,
Expand Down
88 changes: 0 additions & 88 deletions pkg/apis/kubeadm/v1beta1/bootstraptokenstring.go

This file was deleted.

Loading