Uploaded image for project: 'Service Binding'
  1. Service Binding
  2. APPSVC-1316

On ServiceClaim deletion, remove ServiceBinding and Secret

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Normal Normal
    • Primaza 0.1
    • None
    • Service Binding
    • None
    • 3
    • False
    • None
    • False
    • Hide
      Feature: On claim deletion, remove Bindings

          Scenario: Delete an active claim
              Given Primaza Cluster "main" is running
              And Worker Cluster "worker" for "main" is running
              And Clusters "main" and "worker" can communicate
              And On Primaza Cluster "main", Worker "worker"'s ClusterContext secret "primaza-kw" is published
              And On Worker Cluster "worker", application namespace "applications" exists
              And On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: ClusterEnvironment
              metadata:
                  name: worker
                  namespace: primaza-system
              spec:
                  environmentName: stage
                  clusterContextSecret: primaza-kw
                  applicationNamespaces:
                  - applications
              """
              And On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: RegisteredService
              metadata:
                name: primaza-rsdb
                namespace: primaza-system
              spec:
                constraints:
                  environments:
                  - stage
                serviceClassIdentity:
                  - name: type
                    value: psqlserver
                  - name: provider
                    value: aws
                serviceEndpointDefinition:
                  - name: host
                    value: mydavphost.io
                  - name: port
                    value: "5432"
                  - name: user
                    value: davp
                  - name: password
                    value: quedicelagente
                  - name: database
                    value: davpdata
                sla: L3
                """
              And On Primaza Cluster "main", RegisteredService "primaza-rsdb" state will eventually move to "Available"
              And On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: ServiceClaim
              metadata:
                name: sc-test
                namespace: primaza-system
              spec:
                serviceClassIdentity:
                - name: type
                  value: psqlserver
                - name: provider
                  value: aws
                serviceEndpointDefinitionKeys:
                - host
                - port
                - user
                - password
                - database
                environmentTag: stage
                application:
                  kind: Deployment
                  apiVersion: apps/v1
                  selector:
                    matchLabels:
                      a: b
                      c: d
              """
              And On Primaza Cluster "main", the status of ServiceClaim "sc-test" is "Resolved"
              And On Primaza Cluster "main", RegisteredService "primaza-rsdb" state will eventually move to "Claimed"
              And On Worker Cluster "worker", Service Binding "sc-test" exists in "applications"
              When On Primaza Cluster "main", Resource is deleted
              """
              apiVersion: primaza.io/v1alpha1
              kind: ServiceClaim
              metadata:
                name: sc-test
                namespace: primaza-system
              spec:
                serviceClassIdentity:
                - name: type
                  value: psqlserver
                - name: provider
                  value: aws
                serviceEndpointDefinitionKeys:
                - host
                - port
                - user
                - password
                - database
                environmentTag: stage
                application:
                  kind: Deployment
                  apiVersion: apps/v1
                  selector:
                    matchLabels:
                      a: b
                      c: d
              """
              Then On Worker Cluster "worker", Service Binding "sc-test" does not exist in "applications"
              And On Primaza Cluster "main", RegisteredService "primaza-rsdb" state will eventually move to "Available"
      Show
      Feature: On claim deletion, remove Bindings     Scenario: Delete an active claim         Given Primaza Cluster "main" is running         And Worker Cluster "worker" for "main" is running         And Clusters "main" and "worker" can communicate         And On Primaza Cluster "main", Worker "worker"'s ClusterContext secret "primaza-kw" is published         And On Worker Cluster "worker", application namespace "applications" exists         And On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: ClusterEnvironment         metadata:             name: worker             namespace: primaza-system         spec:             environmentName: stage             clusterContextSecret: primaza-kw             applicationNamespaces:             - applications         """         And On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: RegisteredService         metadata:           name: primaza-rsdb           namespace: primaza-system         spec:           constraints:             environments:             - stage           serviceClassIdentity:             - name: type               value: psqlserver             - name: provider               value: aws           serviceEndpointDefinition:             - name: host               value: mydavphost.io             - name: port               value: "5432"             - name: user               value: davp             - name: password               value: quedicelagente             - name: database               value: davpdata           sla: L3           """         And On Primaza Cluster "main", RegisteredService "primaza-rsdb" state will eventually move to "Available"         And On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: ServiceClaim         metadata:           name: sc-test           namespace: primaza-system         spec:           serviceClassIdentity:           - name: type             value: psqlserver           - name: provider             value: aws           serviceEndpointDefinitionKeys:           - host           - port           - user           - password           - database           environmentTag: stage           application:             kind: Deployment             apiVersion: apps/v1             selector:               matchLabels:                 a: b                 c: d         """         And On Primaza Cluster "main", the status of ServiceClaim "sc-test" is "Resolved"         And On Primaza Cluster "main", RegisteredService "primaza-rsdb" state will eventually move to "Claimed"         And On Worker Cluster "worker", Service Binding "sc-test" exists in "applications"         When On Primaza Cluster "main", Resource is deleted         """         apiVersion: primaza.io/v1alpha1         kind: ServiceClaim         metadata:           name: sc-test           namespace: primaza-system         spec:           serviceClassIdentity:           - name: type             value: psqlserver           - name: provider             value: aws           serviceEndpointDefinitionKeys:           - host           - port           - user           - password           - database           environmentTag: stage           application:             kind: Deployment             apiVersion: apps/v1             selector:               matchLabels:                 a: b                 c: d         """         Then On Worker Cluster "worker", Service Binding "sc-test" does not exist in "applications"         And On Primaza Cluster "main", RegisteredService "primaza-rsdb" state will eventually move to "Available"
    • AppSvc Sprint 234

      Owner: Architect:

      Francesco Ilario

      Story (Required)

      As a Primaza Administrator,
      I would like Primaza to remove Service Bindings and secrets from Application Namespaces when the Service Claim is deleted
      so that the workload could be unbound from the service

      Background (Required)

      As defined in the Primaza architecture document, when a Service Claim is deleted we need to remove the Service Bindings and Secret from every Application Namespaces.
      Workloads will then be unbound by the Application Agent.

      See epic for arch document link.

      Glossary

      See glossary in architecture document

      Out of scope

      NA

      In Scope

      • delete Service Bindings and Secret

      Approach(Required)

      Update the ServiceClaim controller such that when a Service Claim is deleted, the Service Binding and Secret from each matching Application Namespace are deleted too.
      Ignore Not Found errors.

      Demo requirements(Required)

      NA

      Dependencies

      NA

      Edge Case

      NA

      BDD Tests

      You can find BDD Test specification for this story in the "Testing Instruction" Field Tab or in the GitHub Issue linked to this story.
      Click here for all BDD Tests Issues.

      Acceptance Criteria

      • Development
        ServiceClaim controller deletes ServiceBinding and secret on ServiceClaim deletion
      • QE
        There are test cases for ServiceClaim deletion
      • Docs
        There is a Section in ServiceClaim's docs dedicated to explaining the consequences of it deletion
        Update architecture document with any changes while implementing

      INVEST Checklist

      Dependencies identified
      Blockers noted and expected delivery timelines set
      Design is implementable
      Acceptance criteria agreed upon
      Story estimated

      Legend

      Unknown
      Verified
      Unsatisfied

              kmamgain@redhat.com Kartikey Mamgain (Inactive)
              rh-ee-filario Francesco Ilario
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: