Support for clusters without explicit AZs

This commit is contained in:
Matt Pryor 2022-08-01 17:50:23 +01:00
parent c00d7a0083
commit 6bd4cd8e46
7 changed files with 19 additions and 11 deletions

View File

@ -1,5 +1,5 @@
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6
kind: OpenStackCluster
metadata:
name: {{ include "openstack-cluster.clusterName" . }}
@ -50,6 +50,10 @@ spec:
{{- end }}
apiServerPort: {{ .port }}
{{- end }}
{{- with .Values.controlPlane.failureDomains }}
controlPlaneAvailabilityZones: {{ toYaml . | nindent 4 }}
{{- with .Values.controlPlane }}
{{- if .omitFailureDomain }}
controlPlaneOmitAvailabilityZone: true
{{- else if .failureDomains }}
controlPlaneAvailabilityZones: {{ toYaml .failureDomains | nindent 4 }}
{{- end }}
{{- end }}

View File

@ -11,6 +11,6 @@ spec:
kind: KubeadmControlPlane
name: {{ include "openstack-cluster.componentName" (list . "control-plane") }}
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6
kind: OpenStackCluster
name: {{ include "openstack-cluster.clusterName" . }}

View File

@ -83,7 +83,7 @@ spec:
labels: {{ include "openstack-cluster.controlPlaneSelectorLabels" . | nindent 8 }}
infrastructureRef:
kind: OpenStackMachineTemplate
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6
name: {{ include "openstack-cluster.controlplane.mt.name" . }}
{{- with .Values.controlPlane.nodeDrainTimeout }}
nodeDrainTimeout: {{ . }}

View File

@ -40,7 +40,7 @@ template:
{{- include "openstack-cluster.componentName" (list . "control-plane") }}-{{ trunc 8 $checksum }}
{{- end }}
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6
kind: OpenStackMachineTemplate
metadata:
name: {{ include "openstack-cluster.controlplane.mt.name" . }}

View File

@ -39,14 +39,16 @@ spec:
spec:
clusterName: {{ include "openstack-cluster.clusterName" $ }}
version: {{ $.Values.global.kubernetesVersion }}
failureDomain: {{ $nodeGroup.failureDomain }}
{{- with $nodeGroup.failureDomain }}
failureDomain: {{ . }}
{{- end }}
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
name: {{ include "openstack-cluster.nodegroup.kct.name" (list $ $nodeGroup) }}
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6
kind: OpenStackMachineTemplate
name: {{ include "openstack-cluster.nodegroup.mt.name" (list $ $nodeGroup) }}
nodeDrainTimeout: {{ $nodeGroup.nodeDrainTimeout }}

View File

@ -47,7 +47,7 @@ template:
{{- range $nodeGroupOverrides := .Values.nodeGroups }}
{{- $nodeGroup := deepCopy $.Values.nodeGroupDefaults | mustMerge $nodeGroupOverrides }}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6
kind: OpenStackMachineTemplate
metadata:
name: {{ include "openstack-cluster.nodegroup.mt.name" (list $ $nodeGroup) }}

View File

@ -105,8 +105,10 @@ apiServer:
controlPlane:
# The failure domains to use for control plane nodes
# If given, should be a list of availability zones
# If not given, all availability zones will be considered for control plane nodes
# Only used when omitFailureDomain = false
failureDomains:
# Indicates whether the failure domain should be omitted from control plane nodes
omitFailureDomain: true
# The number of control plane machines to deploy
# For high-availability, this should be greater than 1
# For etcd quorum, it should be odd - usually 3, or 5 for very large clusters
@ -198,7 +200,7 @@ nodeGroupDefaults:
# Indicates if the node group should be autoscaled
autoscale: false
# The failure domain for the node group
failureDomain: nova
failureDomain:
# The flavor to use for machines in the node group
machineFlavor:
# The default networks and ports for worker nodes