Skip to content

Commit

Permalink
add api_lb_availability_zone and api_server_floating_ip label
Browse files Browse the repository at this point in the history
This will help if user need put cluster and api load balancer same AZ. and user can specify floating ip for api load balancer.
  • Loading branch information
nguyenhuukhoi authored Dec 18, 2024
1 parent bfff953 commit 636372c
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions magnum_cluster_api/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,9 @@ def get_object(self) -> objects.ClusterClass:
"provider": {
"type": "string",
},
"availabilityZone": {
"type": "string",
},
},
},
},
Expand All @@ -997,6 +1000,15 @@ def get_object(self) -> objects.ClusterClass:
},
},
},
{
"name": "apiServerFloatingIP",
"required": True,
"schema": {
"openAPIV3Schema": {
"type": "string",
},
},
},
{
"name": "openidConnect",
"required": True,
Expand Down Expand Up @@ -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}}',
Expand Down Expand Up @@ -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", ""
),
},
},
{
Expand All @@ -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": {
Expand Down

0 comments on commit 636372c

Please sign in to comment.