hetznercloud / hcloud-cloud-controller-manager

Kubernetes cloud-controller-manager for Hetzner Cloud
Apache License 2.0
703 stars 112 forks source link

invalid_input when deleting loadbalancer manually. #651

Open DeprecatedLuke opened 3 months ago

DeprecatedLuke commented 3 months ago

TL;DR

When creating a load balancer with kubernetes Service and deleting it via the panel, attempting to re-create it will result in an error.

Expected behavior

The load balancer services and targets are not created.

Observed behavior

Only the load balancer is created with no additional steps taken.

Minimal working example

deploy nginx-ingress helm chart

  controller:
    kind: DaemonSet
    terminationGracePeriodSeconds: 5
    ingressClassResource:
      default: true
    service:
      annotations:
        load-balancer.hetzner.cloud/location: fsn1
        load-balancer.hetzner.cloud/name: public-ingress
        load-balancer.hetzner.cloud/use-private-ip: "true"
        load-balancer.hetzner.cloud/http-redirect-https: "false"

delete loadbalancer on the panel uninstall the helm chart reinstall the helm chart the error occurs

Log output

'Error syncing load balancer: failed to ensure load balancer: hcloud/loadBalancers.EnsureLoadBalancer:
  hcops/LoadBalancerOps.ReconcileHCLBServices: invalid input in field ''http'' (invalid_input)'

Additional information

I've managed to fix it by first creating a helm nginx-ingress with:

service:
      targetPorts:
        http: "http2"
        https: "https2"

and then editing targetPort back to http/https after.

Deleting uninstalling the helm chart and reinstalling works as expected.

apricote commented 3 weeks ago

Hey @DeprecatedLuke,

I am unable to reproduce the issue locally with your reproduction steps.

Could you run hcloud-cloud-controller-manager with the environment variable HCLOUD_DEBUG=true? This will log all requests made to the Hetzner Cloud API including the responses. You can then share the request here or open a support ticket to send the logs to us in private.

This will show the exact body of your request and indicate why the request was rejected.