Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenstackServer controller is not watching IPAdressClaim resources #2389

Open
MisterKind opened this issue Jan 23, 2025 · 2 comments · May be fixed by #2390
Open

OpenstackServer controller is not watching IPAdressClaim resources #2389

MisterKind opened this issue Jan 23, 2025 · 2 comments · May be fixed by #2390
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@MisterKind
Copy link

MisterKind commented Jan 23, 2025

/kind bug

What steps did you take and what happened:
When using an OpenstackFloatingIPPools in an OpenstackMachine, an IPAddressClaim is created which will create a floating ip in Openstack.
However currently the OpenstackServer controller do not watch the IPAddressClaims it create, which stuck the provision of the server.

Here an extract of logs showing that the OpenstackServer is not reconciled until I manually add an annotation on it at 10:01

I0123 09:45:06.510424       1 openstackserver_controller.go:100] "Reconciling OpenStackServer" controller="openstackserver" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="OpenStackServer" OpenStackServer="test/test-42kj7-wv56c" namespace="test" name="test-42kj7-wv56c" reconcileID="781a17c3-0a12-462a-bf69-49d9090db489"
I0123 09:45:06.510522       1 openstackserver_controller.go:292] "Reconciling Server create" controller="openstackserver" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="OpenStackServer" OpenStackServer="test/test-42kj7-wv56c" namespace="test" name="test-42kj7-wv56c" reconcileID="781a17c3-0a12-462a-bf69-49d9090db489"
I0123 09:45:06.590125       1 openstackserver_controller.go:623] "Created IPAddressClaim" controller="openstackserver" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="OpenStackServer" OpenStackServer="test/test-42kj7-wv56c" namespace="test" reconcileID="781a17c3-0a12-462a-bf69-49d9090db489" name="test-42kj7-wv56c-floating-ip-address"
I0123 09:45:06.590223       1 recorder.go:104] "Creating IPAddressClaim test/test-42kj7-wv56c-floating-ip-address" logger="events" type="Normal" object={"kind":"OpenStackServer","namespace":"test","name":"test-42kj7-wv56c","uid":"f83584ad-9a76-479e-9751-3025f64b4c52","apiVersion":"infrastructure.cluster.x-k8s.io/v1alpha1","resourceVersion":"193478720"} reason="CreatingIPAddressClaim"
I0123 09:45:06.590237       1 recorder.go:104] "Waiting for IPAddressClaim test/test-42kj7-wv56c-floating-ip-address to be allocated" logger="events" type="Normal" object={"kind":"OpenStackServer","namespace":"test","name":"test-42kj7-wv56c","uid":"f83584ad-9a76-479e-9751-3025f64b4c52","apiVersion":"infrastructure.cluster.x-k8s.io/v1alpha1","resourceVersion":"193478720"} reason="WaitingForIPAddressClaim"
I0123 09:45:06.941529       1 openstackserver_controller.go:100] "Reconciling OpenStackServer" controller="openstackserver" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="OpenStackServer" OpenStackServer="test/test-42kj7-wv56c" namespace="test" name="test-42kj7-wv56c" reconcileID="2e06b861-a13e-44b9-b0d6-a1197eda26c4"
I0123 09:45:06.941640       1 openstackserver_controller.go:292] "Reconciling Server create" controller="openstackserver" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="OpenStackServer" OpenStackServer="test/test-42kj7-wv56c" namespace="test" name="test-42kj7-wv56c" reconcileID="2e06b861-a13e-44b9-b0d6-a1197eda26c4"
I0123 09:45:07.010089       1 recorder.go:104] "Waiting for IPAddressClaim test/test-42kj7-wv56c-floating-ip-address to be allocated" logger="events" type="Normal" object={"kind":"OpenStackServer","namespace":"test","name":"test-42kj7-wv56c","uid":"f83584ad-9a76-479e-9751-3025f64b4c52","apiVersion":"infrastructure.cluster.x-k8s.io/v1alpha1","resourceVersion":"193478824"} reason="WaitingForIPAddressClaim"
I0123 10:01:04.256450       1 openstackserver_controller.go:100] "Reconciling OpenStackServer" controller="openstackserver" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="OpenStackServer" OpenStackServer="test/test-42kj7-wv56c" namespace="test" name="test-42kj7-wv56c" reconcileID="ff7c8fd1-2bd7-4cf2-b8f6-ec7bd48b1c63"
I0123 10:01:04.256541       1 openstackserver_controller.go:292] "Reconciling Server create" controller="openstackserver" controllerGroup="infrastructure.cluster.x-k8s.io" controllerKind="OpenStackServer" OpenStackServer="test/test-42kj7-wv56c" namespace="test" name="test-42kj7-wv56c" reconcileID="ff7c8fd1-2bd7-4cf2-b8f6-ec7bd48b1c63"

What did you expect to happen:
Reconcile the OpenstackServer when the IPAddressClaim is ready.

Anything else you would like to add:
I'm new to the OpenSource world, so do not hesitate to correct me.
I already tested a fix: MisterKind@5519450

Environment:

  • Cluster API Provider OpenStack version (Or git rev-parse HEAD if manually built): 0.11.4
  • Cluster-API version: 1.8.5
  • OpenStack version:
  • Minikube/KIND version:
  • Kubernetes version (use kubectl version):
  • OS (e.g. from /etc/os-release):
@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 23, 2025
@EmilienM
Copy link
Contributor

Could you please submit a PR to CAPO and let us know if you need help.
Your commit looks like a good start, I think we'll also need to add RBAC rules?

// +kubebuilder:rbac:groups=ipam.cluster.x-k8s.io,resources=ipaddressclaims;ipaddressclaims/status,verbs=get;watch;create;update;patch;delete

@MisterKind
Copy link
Author

MisterKind commented Jan 23, 2025

Thanks for the comment,
I added the RBAC comments and linked the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
Status: Inbox
3 participants