canonical / nginx-ingress-integrator-operator

nginx-ingress-integrator-operator - charm repository.
Apache License 2.0
1 stars 8 forks source link

Refreshing ingress causes error if multiple relations existed #128

Closed omar-selo closed 3 weeks ago

omar-selo commented 5 months ago

Bug Description

When we started using nginx-ingress-integrator we connected it to two applications. After refreshing ingress on stable channel, we get an error that the ingress can only connect to one application. This seems to be a behavior change possibly made sometime this year. Note that while the linked PR is dated Feb 26 and the latest stable revision 84 was released in Feb 22. The latest stable does have this issue.

To Reproduce

  1. deploy nginx-ingress-integrator with some old revision like 59
  2. deploy two applications that can relate relate through nginx-route or ingress interfaces
  3. relate the two applications (observe that everything is fine)
  4. refresh nginx-ingress-integrator charm to latest stable revision and observe the error

Environment

PS5

Relevant log output

Got this error when trying out a new deployment through terraform. So the error wasn't through a refresh (but I imagine that a refresh would cause it too). Terraform log:

╷                                                                                                                  
│ Error: cannot add relation "api:nginx-route ingress:nginx-route": establishing a new relation for ingress:nginx-route would exceed its maximum relation limit of 1 (quota limit exceeded)                                            
│                                                                                                                                                                                                                                      
│   with module.test-observer.juju_integration.test-observer-api-ingress,                                                                                                                                                              
│   on .terraform/modules/test-observer/terraform/test-observer.tf line 158, in resource "juju_integration" "test-observer-api-ingress":                                                                                               
│  158: resource "juju_integration" "test-observer-api-ingress" {                                                                                                                                                                      
│ 
weiiwang01 commented 4 months ago

Hi @omar-selo, unfortunately, the latest version of the nginx-ingress-integrator charm will only support one relation per nginx-ingress-integrator application. This change is meant to reduce the ambiguity caused by having multiple relations in the nginx-ingress-integrator charm.

I recommend the following steps to upgrade to the latest version of the nginx-ingress-integrator charm:

  1. Save the current configuration of the nginx-ingress-integrator charm.
  2. Deploy two instances of the latest nginx-ingress-integrator charm in the model for later use.
  3. Remove all nginx ingress relations and the old nginx-ingress-integrator charm.
  4. Remove any remaining Kubernetes ingress resources in the model (kubectl get ingress), if any.
  5. Relate the new nginx-ingress-integrator charms to each of the units and apply the same charm configurations.

Unfortunately, this upgrade method will cause some downtime. Please let us know if there is anything we can help you with.

omar-selo commented 3 weeks ago

Thanks for the detailed steps to handle this change.