From c2cba382da152b133b86af11420890e7547745a5 Mon Sep 17 00:00:00 2001 From: Angelos Kolaitis Date: Tue, 10 Oct 2023 09:00:26 +0300 Subject: [PATCH 1/2] Use infrastructure.cluster.x-k8s.io/v1alpha7 API version for OpenStack --- templates/cluster-template-openstack.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/cluster-template-openstack.yaml b/templates/cluster-template-openstack.yaml index 96fa62a..c6795b3 100644 --- a/templates/cluster-template-openstack.yaml +++ b/templates/cluster-template-openstack.yaml @@ -6,7 +6,7 @@ metadata: name: ${CLUSTER_NAME} spec: infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7 kind: OpenStackCluster name: ${CLUSTER_NAME} controlPlaneRef: @@ -14,7 +14,7 @@ spec: apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: ${CLUSTER_NAME}-control-plane --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7 kind: OpenStackCluster metadata: name: ${CLUSTER_NAME} @@ -48,14 +48,14 @@ spec: portCompatibilityRemap: true machineTemplate: infrastructureTemplate: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7 kind: OpenStackMachineTemplate name: "${CLUSTER_NAME}-control-plane" replicas: ${CONTROL_PLANE_MACHINE_COUNT:=1} version: "v${KUBERNETES_VERSION}" upgradeStrategy: "${UPGRADE_STRATEGY}" --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-control-plane @@ -91,10 +91,10 @@ spec: kind: MicroK8sConfigTemplate infrastructureRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7 kind: OpenStackMachineTemplate --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-md-0 From db5a06bac52e315b090b60802b37c959c6ba00b1 Mon Sep 17 00:00:00 2001 From: Angelos Kolaitis Date: Tue, 10 Oct 2023 09:00:41 +0300 Subject: [PATCH 2/2] Add option to use Octavia for OpenStack clusters --- templates/cluster-template-openstack.rc | 5 +++++ templates/cluster-template-openstack.yaml | 2 ++ 2 files changed, 7 insertions(+) diff --git a/templates/cluster-template-openstack.rc b/templates/cluster-template-openstack.rc index ac56fad..25fe627 100644 --- a/templates/cluster-template-openstack.rc +++ b/templates/cluster-template-openstack.rc @@ -21,6 +21,11 @@ export OPENSTACK_SSH_KEY_NAME=my-ssh-key export OPENSTACK_NETWORK_CIDR=10.6.0.0/24 export OPENSTACK_DNS_NAMESERVERS= +# OpenStack control plane configuration. +# Set this to 'false' to use a simple Floating IP for the control plane (works everywhere) +# Set this to 'true' to use an Octavia LoadBalancer for the control plane (requires octavia support in the cloud) +export OPENSTACK_USE_OCTAVIA_LOADBALANCER=false + # (optional) Containerd HTTP proxy configuration. Leave empty if not required. export CONTAINERD_HTTP_PROXY="" export CONTAINERD_HTTPS_PROXY="" diff --git a/templates/cluster-template-openstack.yaml b/templates/cluster-template-openstack.yaml index c6795b3..e817adf 100644 --- a/templates/cluster-template-openstack.yaml +++ b/templates/cluster-template-openstack.yaml @@ -19,6 +19,8 @@ kind: OpenStackCluster metadata: name: ${CLUSTER_NAME} spec: + apiServerLoadBalancer: + enabled: ${OPENSTACK_USE_OCTAVIA_LOADBALANCER} cloudName: ${OPENSTACK_CLOUD} identityRef: name: ${OPENSTACK_CLOUD_CONFIG_SECRET_NAME}