k8s-cluster-api-provider icon indicating copy to clipboard operation
k8s-cluster-api-provider copied to clipboard

Testcluster: CAPO Load Balancer Provider defaults to Amphora

Open sbrgr opened this issue 1 year ago • 2 comments

It seems that the creation of the load balancers using CAPO would default to the amphora provider when deploying the testcluster.

I tried to setup the testcluster with ovn as load balancer provider with use_ovn_lb_provider = "true" and got the following error message from the capo-controller-manager pod:

I0308 11:17:59.066472       1 recorder.go:104] "events: Failed to create load balancer k8s-clusterapi-cluster-testcluster-testcluster-kubeapi: Bad request with: [POST http://<my-ip>:9876/v2.0/lbaas/loadbalancers], error message: 
{
	"faultcode": "Client",
	"faultstring": "Provider 'amphora' is not enabled.",
	"debuginfo": null
}" 
type="Warning" 
object=
{
	"kind": "OpenStackCluster",
	"namespace": "testcluster",
	"name": "testcluster-n4bmp",
	"uid": "c406906f-48f8-4169-bf3e-66bd579d02f0",
	"apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha7",
	"resourceVersion": "1720"
}
reason="Failedcreateloadbalancer"

A look into the CAPO repo main.go indicates that the value of the provider: key in the OpenStackClusterTemplate apiServerLoadBalancer block has to be explicitly set to use ovn as LB-provider:

...
fs.StringVar(&lbProvider, "lb-provider", "amphora",
		"The name of the load balancer provider (amphora or ovn) to use (defaults to amphora).")
...

Adding provider: ovn to the cluster-template.yaml helped to create the load balancer for the testcluster via ovn:

---
# apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7
kind: OpenStackClusterTemplate
metadata:
  name: ${CLUSTER_NAME}-${OPENSTACK_CLUSTER_GEN}
spec:
template:
  spec:
  ...
  apiServerLoadBalancer:
    enabled: true
    provider: ovn
  ...
---

Environment: commit: 9c1f526f29c885ed88c04ae78f5765ddbd5ca1fa

clusterapi_version = "1.6.1" capi_openstack_version = "0.9.0" use_ovn_lb_provider = "true"

sbrgr avatar Mar 18 '24 09:03 sbrgr

It seems that the creation of the load balancers using CAPO would default to the amphora provider when deploying the testcluster.

Yes, that's true.

I tried to setup the testcluster with ovn as load balancer provider with use_ovn_lb_provider = "true" and got the following error message from the capo-controller-manager pod

use_ovn_lb_provider only affects loadbalancer in front of ingress-nginx, see docs.

Adding provider: ovn to the cluster-template.yaml helped to create the load balancer for the testcluster via ovn

Yes, this is also true. See also https://github.com/SovereignCloudStack/k8s-cluster-api-provider/issues/706#issuecomment-1996746037

chess-knight avatar Mar 18 '24 13:03 chess-knight

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment, or this will be closed in 60 days.

github-actions[bot] avatar Apr 18 '24 02:04 github-actions[bot]

This issue was closed because it has been stalled for 60 days with no activity.

github-actions[bot] avatar Jun 17 '24 02:06 github-actions[bot]