From eb42ecf8bd43e6ba09fd3a168b7a8f198f0e9491 Mon Sep 17 00:00:00 2001 From: Matt Pryor Date: Fri, 29 Apr 2022 15:26:37 +0100 Subject: [PATCH] Migrate to v1alpha5 resources --- .../templates/cluster-openstack.yaml | 5 +++-- charts/openstack-cluster/templates/cluster.yaml | 2 +- .../control-plane/kubeadm-control-plane.yaml | 2 +- .../control-plane/openstack-machine-template.yaml | 11 +++++++---- .../templates/node-group/machine-deployment.yaml | 2 +- .../node-group/openstack-machine-template.yaml | 11 +++++++---- 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/charts/openstack-cluster/templates/cluster-openstack.yaml b/charts/openstack-cluster/templates/cluster-openstack.yaml index 602fdde..4cdc99e 100644 --- a/charts/openstack-cluster/templates/cluster-openstack.yaml +++ b/charts/openstack-cluster/templates/cluster-openstack.yaml @@ -1,5 +1,5 @@ --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 kind: OpenStackCluster metadata: name: {{ include "openstack-cluster.clusterName" . }} @@ -33,7 +33,8 @@ spec: {{- end }} {{- end }} {{- with .Values.apiServer }} - managedAPIServerLoadBalancer: {{ .enableLoadBalancer }} + apiServerLoadBalancer: + enabled: {{ .enableLoadBalancer }} disableAPIServerFloatingIP: {{ not .associateFloatingIP }} {{- with .floatingIP }} apiServerFloatingIP: {{ . }} diff --git a/charts/openstack-cluster/templates/cluster.yaml b/charts/openstack-cluster/templates/cluster.yaml index 81a1ea8..b851b96 100644 --- a/charts/openstack-cluster/templates/cluster.yaml +++ b/charts/openstack-cluster/templates/cluster.yaml @@ -11,6 +11,6 @@ spec: kind: KubeadmControlPlane name: {{ include "openstack-cluster.componentName" (list . "control-plane") }} infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 kind: OpenStackCluster name: {{ include "openstack-cluster.clusterName" . }} diff --git a/charts/openstack-cluster/templates/control-plane/kubeadm-control-plane.yaml b/charts/openstack-cluster/templates/control-plane/kubeadm-control-plane.yaml index d502b28..70b9d78 100644 --- a/charts/openstack-cluster/templates/control-plane/kubeadm-control-plane.yaml +++ b/charts/openstack-cluster/templates/control-plane/kubeadm-control-plane.yaml @@ -79,7 +79,7 @@ spec: labels: {{ include "openstack-cluster.controlPlaneSelectorLabels" . | nindent 8 }} infrastructureRef: kind: OpenStackMachineTemplate - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 name: {{ include "openstack-cluster.controlplane.mt.name" . }} {{- with .Values.controlPlane.nodeDrainTimeout }} nodeDrainTimeout: {{ . }} diff --git a/charts/openstack-cluster/templates/control-plane/openstack-machine-template.yaml b/charts/openstack-cluster/templates/control-plane/openstack-machine-template.yaml index e859590..8f43740 100644 --- a/charts/openstack-cluster/templates/control-plane/openstack-machine-template.yaml +++ b/charts/openstack-cluster/templates/control-plane/openstack-machine-template.yaml @@ -15,11 +15,14 @@ template: {{- end }} {{- if gt (float64 .Values.controlPlane.machineRootVolumeSize) 0.0 }} rootVolume: - sourceType: image - sourceUUID: {{ .Values.machineImageId | required ".Values.machineImageId is required when using a root volume" }} diskSize: {{ .Values.controlPlane.machineRootVolumeSize }} + {{- end }} + {{- if .Values.machineImageId }} + imageUUID: {{ .Values.machineImageId }} + {{- else if .Values.machineImage }} + image: {{ tpl .Values.machineImage . }} {{- else }} - image: {{ tpl (required ".Values.machineImage is required when not using a root volume" .Values.machineImage) . }} + {{- fail "Either machineImage or machineImageId is required" }} {{- end }} {{- with .Values.controlPlane.machineNetworking.networks }} networks: {{ toYaml . | nindent 6 }} @@ -38,7 +41,7 @@ template: {{- include "openstack-cluster.componentName" (list . "control-plane") }}-{{ trunc 8 $checksum }} {{- end }} -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 kind: OpenStackMachineTemplate metadata: name: {{ include "openstack-cluster.controlplane.mt.name" . }} diff --git a/charts/openstack-cluster/templates/node-group/machine-deployment.yaml b/charts/openstack-cluster/templates/node-group/machine-deployment.yaml index 085bf82..395766c 100644 --- a/charts/openstack-cluster/templates/node-group/machine-deployment.yaml +++ b/charts/openstack-cluster/templates/node-group/machine-deployment.yaml @@ -46,7 +46,7 @@ spec: kind: KubeadmConfigTemplate name: {{ include "openstack-cluster.nodegroup.kct.name" (list $ $nodeGroup) }} infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 kind: OpenStackMachineTemplate name: {{ include "openstack-cluster.nodegroup.mt.name" (list $ $nodeGroup) }} nodeDrainTimeout: {{ $nodeGroup.nodeDrainTimeout }} diff --git a/charts/openstack-cluster/templates/node-group/openstack-machine-template.yaml b/charts/openstack-cluster/templates/node-group/openstack-machine-template.yaml index 0943a3b..961ca9f 100644 --- a/charts/openstack-cluster/templates/node-group/openstack-machine-template.yaml +++ b/charts/openstack-cluster/templates/node-group/openstack-machine-template.yaml @@ -17,11 +17,14 @@ template: {{- end }} {{- if gt (float64 $nodeGroup.machineRootVolumeSize) 0.0 }} rootVolume: - sourceType: image - sourceUUID: {{ $ctx.Values.machineImageId | required ".Values.machineImageId is required when using a root volume" }} diskSize: {{ $nodeGroup.machineRootVolumeSize }} + {{- end }} + {{- if $ctx.Values.machineImageId }} + imageUUID: {{ $ctx.Values.machineImageId }} + {{- else if $ctx.Values.machineImage }} + image: {{ tpl $ctx.Values.machineImage $ctx }} {{- else }} - image: {{ tpl (required ".Values.machineImage is required when not using a root volume" $ctx.Values.machineImage) $ctx }} + {{- fail "Either machineImage or machineImageId is required" }} {{- end }} {{- with $nodeGroup.machineNetworking.networks }} networks: {{ toYaml . | nindent 6 }} @@ -45,7 +48,7 @@ template: {{- range $nodeGroupOverrides := .Values.nodeGroups }} {{- $nodeGroup := deepCopy $.Values.nodeGroupDefaults | mustMerge $nodeGroupOverrides }} --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 kind: OpenStackMachineTemplate metadata: name: {{ include "openstack-cluster.nodegroup.mt.name" (list $ $nodeGroup) }}