Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

small fix for gateways being deleted after placement deleted #579

Merged
merged 4 commits into from
Sep 20, 2023

Conversation

maleck13
Copy link
Contributor

@maleck13 maleck13 commented Sep 19, 2023

fixes #420

Note

This is a fix but not a full fix.

The following also need to be addressed in separate issues

  • When a placement is deleted so is a placement decision the gateway should be removed from the placed clusters in this case
  • When the placement label is changed on the gateway, the old gateways on previous clusters should be removed

I am working on the above as a larger change set.

@maleck13 maleck13 temporarily deployed to e2e-internal September 19, 2023 15:08 — with GitHub Actions Inactive
@sergioifg94
Copy link
Contributor

I'm trying to reproduce the error but instead of the Gateway being deleted it's status is changing to Unknown, is that the expected behavour or am I missing something?

@maleck13
Copy link
Contributor Author

Yes the gateway is not deleted and the status updates to unknown (different issue around the error stuff)

@maleck13 maleck13 temporarily deployed to e2e-internal September 20, 2023 08:06 — with GitHub Actions Inactive
@maleck13
Copy link
Contributor Author

@sergioifg94 to verify

  • use quick start
  • create a gateway and place it
  • delete the placement
  • check the status (it should have a clear error now)
  • delete the gateway (it should not get stuck but should be removed)

@maleck13
Copy link
Contributor Author

taking a look at the integration test failure

@maleck13 maleck13 temporarily deployed to e2e-internal September 20, 2023 09:30 — with GitHub Actions Inactive
@maleck13 maleck13 temporarily deployed to e2e-internal September 20, 2023 09:55 — with GitHub Actions Inactive
@sergioifg94
Copy link
Contributor

I'm still not able to verify it. The status changes to Unknown but I don't see an error message. This is how the status looks like

status:                                                                                                                                               
  addresses:                                                                                                                                          
  - type: IPAddress                                                                                                                                   
    value: 172.31.200.0                                                                                                                               
  conditions:                                                                                                                                         
  - lastTransitionTime: "2023-09-20T09:56:08Z"                                                                                                        
    message: Deployed gateway to the cluster                                                                                                          
    observedGeneration: 1                                                                                                                             
    reason: Accepted                                                                                                                                  
    status: "True"                                                                                                                                    
    type: Accepted                                                                                                                                    
  - lastTransitionTime: "2023-09-20T09:56:08Z"                                                                                                        
    message: Deployed gateway to the cluster                                                                                                          
    observedGeneration: 1                                                                                                                             
    reason: ResourcesAvailable                                                                                                                        
    status: "True"                                                                                                                                    
    type: Scheduled                                                                                                                                   
  - lastTransitionTime: "2023-09-20T09:54:15Z"                                                                                                        
    message: Gateway valid, assigned to service(s) prod-web-istio.kuadrant-multi-cluster-gateways.svc.cluster.local:443                               
    observedGeneration: 1                                                                     
    reason: ListenersValid                                                                    
    status: "True"                                                                            
    type: Ready                                                                               
  listeners:                                                                                  
  - attachedRoutes: 0                                                                         
    conditions:                                                                                                                                                                              
    - lastTransitionTime: "2023-09-20T09:54:11Z"                                              
      message: No errors found                                                                
      observedGeneration: 1                                                                   
      reason: Accepted                                                                        
      status: "True"                                                                          
      type: Accepted                                                                          
    - lastTransitionTime: "2023-09-20T09:54:11Z"                                              
      message: No errors found                                                                
      observedGeneration: 1                                                                   
      reason: NoConflicts                                                                     
      status: "False"                                                                         
      type: Conflicted                                                                        
    - lastTransitionTime: "2023-09-20T09:54:11Z"                                              
      message: No errors found                                                                
      observedGeneration: 1                                                                   
      reason: Attached                                                                        
      status: "False"                                                                         
      type: Detached                                                                          
    - lastTransitionTime: "2023-09-20T09:54:11Z"                                              
      message: No errors found                                                                
      observedGeneration: 1                                                                   
      reason: Programmed                                                                      
      status: "True"                                                                          
      type: Programmed                                                                        
    - lastTransitionTime: "2023-09-20T09:54:11Z"                                              
      message: No errors found                                                                
      observedGeneration: 1                                                                   
      reason: Ready                                                                           
      status: "True"                                                                          
      type: Ready                                                                             
    - lastTransitionTime: "2023-09-20T09:54:11Z"                                              
      message: No errors found                                                                
      observedGeneration: 1                                                                   
      reason: ResolvedRefs                                                                    
      status: "True"                                                                          
      type: ResolvedRefs                                                                      
    name: specific                                                                            
    supportedKinds:                                                                           
    - group: gateway.networking.k8s.io                                                        
      kind: HTTPRoute  

I'm deleting the placement by running

kubectl delete placement -n multi-cluster-gateways http-gateway 

@maleck13
Copy link
Contributor Author

looks like you are looking at the istio instance rather than the control plane definiton?

@sergioifg94
Copy link
Contributor

Tricked by the autocomplete in the terminal

 - lastTransitionTime: "2023-09-20T09:56:00Z"
    message: 'current state of the gateway is unknown error: failed to place gateway
      : no PlacementDecisions found for placement http-gateway via label selector:
      map[cluster.open-cluster-management.io/placement:http-gateway] error: PlacementDecision
      "http-gateway" not found'

@sergioifg94
Copy link
Contributor

Verified that the status gets an error message and the gateway can be deleted without getting stuck
/lgtm

@maleck13
Copy link
Contributor Author

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 20, 2023

@maleck13: you cannot LGTM your own PR.

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@mikenairn
Copy link
Member

/lgtm
/approve

@maleck13 maleck13 added this pull request to the merge queue Sep 20, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 20, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maleck13, mikenairn

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Merged via the queue into main with commit 483b62b Sep 20, 2023
9 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deleting placement prevents deletion of gateway
3 participants