diff --git a/magnum_cluster_api/resources.py b/magnum_cluster_api/resources.py index 8fb65513..ca962724 100644 --- a/magnum_cluster_api/resources.py +++ b/magnum_cluster_api/resources.py @@ -984,6 +984,9 @@ def get_object(self) -> objects.ClusterClass: "provider": { "type": "string", }, + "availabilityZone": { + "type": "string", + }, }, }, }, @@ -997,6 +1000,15 @@ def get_object(self) -> objects.ClusterClass: }, }, }, + { + "name": "apiServerFloatingIP", + "required": True, + "schema": { + "openAPIV3Schema": { + "type": "string", + }, + }, + }, { "name": "openidConnect", "required": True, @@ -1927,6 +1939,30 @@ def get_object(self) -> objects.ClusterClass: }, ], }, + { + "name": "apiServerFloatingIP", + "enabledIf": '{{ if ne .apiServerFloatingIP "" }}true{{end}}', + "definitions": [ + { + "selector": { + "apiVersion": objects.OpenStackClusterTemplate.version, + "kind": objects.OpenStackClusterTemplate.kind, + "matchResources": { + "infrastructureCluster": True, + }, + }, + "jsonPatches": [ + { + "op": "add", + "path": "/spec/template/spec/apiServerFloatingIP", + "valueFrom": { + "variable": "apiServerFloatingIP" + }, + }, + ], + }, + ], + }, { "name": "newNetworkConfig", "enabledIf": '{{ if eq .fixedNetworkName "" }}true{{end}}', @@ -2643,6 +2679,9 @@ def get_object(self) -> objects.Cluster: "provider": self.cluster.labels.get( "octavia_provider", "amphora" ), + "availabilityZone": self.cluster.labels.get( + "api_lb_availability_zone", "" + ), }, }, { @@ -2652,6 +2691,12 @@ def get_object(self) -> objects.Cluster: "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", # noqa: E501 ), }, + { + "name": "apiServerFloatingIP", + "value": self.cluster.labels.get( + "api_server_floating_ip", "" + ), + }, { "name": "openidConnect", "value": {