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

Push ServiceCatalog to Application Namespaces

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Major Major
    • Primaza 0.1
    • None
    • Service Binding
    • None
    • 5
    • False
    • None
    • False
    • Hide
      Feature: Push ServiceCatalog
          Background:
              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

          Scenario: Service Catalog initialization
              When On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: ClusterEnvironment
              metadata:
                  name: worker
                  namespace: primaza-system
              spec:
                  environmentName: dev
                  clusterContextSecret: primaza-kw
                  applicationNamespace:
                  - applications
              """
              And On Primaza Cluster "main", ServiceCatalog "dev" exists
              And On Worker Cluster "worker", ServiceCatalog "dev" exists

          Scenario: Add Registered Service to Service Catalog
              Given On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: ClusterEnvironment
              metadata:
                  name: worker
                  namespace: primaza-system
              spec:
                  environmentName: dev
                  clusterContextSecret: primaza-kw
                  applicationNamespace:
                  - applications
              """
              And On Primaza Cluster "main", ServiceCatalog "dev" exists
              And On Worker Cluster "worker", ServiceCatalog "dev" exists
              When On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: RegisteredService
              metadata:
                name: primaza-rsdb
                namespace: primaza-system
              spec:
                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
              """
              Then On Primaza Cluster "main", ServiceCatalog "dev" will contain RegisteredService "primaza-rsdb"
              And On Worker Cluster "worker", ServiceCatalog "dev" will contain RegisteredService "primaza-rsdb"

          Scenario: Update Registered Service in Service Catalog
              Given On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: ClusterEnvironment
              metadata:
                  name: worker
                  namespace: primaza-system
              spec:
                  environmentName: dev
                  clusterContextSecret: primaza-kw
              """
              And On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: RegisteredService
              metadata:
                name: primaza-rsdb
                namespace: primaza-system
              spec:
                serviceClassIdentity:
                  - name: type
                    value: psqlserver
                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", ServiceCatalog "dev" will contain RegisteredService "primaza-rsdb"
              And On Worker Cluster "worker", ServiceCatalog "dev" will contain RegisteredService "primaza-rsdb"
              When On Primaza Cluster "main", Resource is updated
              """
              apiVersion: primaza.io/v1alpha1
              kind: RegisteredService
              metadata:
                name: primaza-rsdb
                namespace: primaza-system
              spec:
                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
              """
              Then On Primaza Cluster "main", ServiceCatalog "dev" has RegisteredService "primaza-rsdb" with Service Class Identity "provider=aws"
              And On Worker Cluster "worker", ServiceCatalog "dev" has RegisteredService "primaza-rsdb" with Service Class Identity "provider=aws"

          Scenario: Remove Registered Service from Service Catalog
              Given On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: ClusterEnvironment
              metadata:
                  name: worker
                  namespace: primaza-system
              spec:
                  environmentName: dev
                  clusterContextSecret: primaza-kw
              """
              And On Primaza Cluster "main", Resource is created
              """
              apiVersion: primaza.io/v1alpha1
              kind: RegisteredService
              metadata:
                name: primaza-rsdb
                namespace: primaza-system
              spec:
                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", ServiceCatalog "dev" will contain RegisteredService "primaza-rsdb"
              When On Primaza Cluster "main", RegisteredService "primaza-rsdb" is deleted
              Then On Primaza Cluster "main", ServiceCatalog "dev" does not contain RegisteredService "primaza-rsdb"
              And On Worker Cluster "worker", ServiceCatalog "dev" does not contain RegisteredService "primaza-rsdb"
      Show
      Feature: Push ServiceCatalog     Background:         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     Scenario: Service Catalog initialization         When On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: ClusterEnvironment         metadata:             name: worker             namespace: primaza-system         spec:             environmentName: dev             clusterContextSecret: primaza-kw             applicationNamespace:             - applications         """         And On Primaza Cluster "main", ServiceCatalog "dev" exists         And On Worker Cluster "worker", ServiceCatalog "dev" exists     Scenario: Add Registered Service to Service Catalog         Given On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: ClusterEnvironment         metadata:             name: worker             namespace: primaza-system         spec:             environmentName: dev             clusterContextSecret: primaza-kw             applicationNamespace:             - applications         """         And On Primaza Cluster "main", ServiceCatalog "dev" exists         And On Worker Cluster "worker", ServiceCatalog "dev" exists         When On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: RegisteredService         metadata:           name: primaza-rsdb           namespace: primaza-system         spec:           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         """         Then On Primaza Cluster "main", ServiceCatalog "dev" will contain RegisteredService "primaza-rsdb"         And On Worker Cluster "worker", ServiceCatalog "dev" will contain RegisteredService "primaza-rsdb"     Scenario: Update Registered Service in Service Catalog         Given On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: ClusterEnvironment         metadata:             name: worker             namespace: primaza-system         spec:             environmentName: dev             clusterContextSecret: primaza-kw         """         And On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: RegisteredService         metadata:           name: primaza-rsdb           namespace: primaza-system         spec:           serviceClassIdentity:             - name: type               value: psqlserver           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", ServiceCatalog "dev" will contain RegisteredService "primaza-rsdb"         And On Worker Cluster "worker", ServiceCatalog "dev" will contain RegisteredService "primaza-rsdb"         When On Primaza Cluster "main", Resource is updated         """         apiVersion: primaza.io/v1alpha1         kind: RegisteredService         metadata:           name: primaza-rsdb           namespace: primaza-system         spec:           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         """         Then On Primaza Cluster "main", ServiceCatalog "dev" has RegisteredService "primaza-rsdb" with Service Class Identity "provider=aws"         And On Worker Cluster "worker", ServiceCatalog "dev" has RegisteredService "primaza-rsdb" with Service Class Identity "provider=aws"     Scenario: Remove Registered Service from Service Catalog         Given On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: ClusterEnvironment         metadata:             name: worker             namespace: primaza-system         spec:             environmentName: dev             clusterContextSecret: primaza-kw         """         And On Primaza Cluster "main", Resource is created         """         apiVersion: primaza.io/v1alpha1         kind: RegisteredService         metadata:           name: primaza-rsdb           namespace: primaza-system         spec:           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", ServiceCatalog "dev" will contain RegisteredService "primaza-rsdb"         When On Primaza Cluster "main", RegisteredService "primaza-rsdb" is deleted         Then On Primaza Cluster "main", ServiceCatalog "dev" does not contain RegisteredService "primaza-rsdb"         And On Worker Cluster "worker", ServiceCatalog "dev" does not contain RegisteredService "primaza-rsdb"
    • AppSvc Sprint 235

      Owner: Architect:

      Francesco Ilario

      Story (Required)

      As a Developer,
      I would like Primaza to push ServiceCatalogs to application namespaces
      so that I can look at bindable services

      Background (Required)

      When a ServiceCatalog is updated in Primaza's Control Plane, we need to update it in all impacted application namespaces too.
      As of now, this logic is still missing.
      We need to introduce a new controller that takes care of this.

      See epic for arch document link.

      Glossary

      See glossary in architecture document

      Out of scope

      • handling deletion of ServiceCatalogs: Primaza may need to recreate it for consistency

      In Scope

      • ServiceCatalog controller
      • handler create/update events on ServiceCatalogs

      Approach(Required)

      Add a controller for ServiceCatalog events into Primaza's Control Plane.

      When a create/update event on a Service Catalog is processed, push the Service Catalog to application namespaces of Cluster Environments whose Environment matches the Service Catalog one.

      When a delete event is processed, no action is needed to be performed. Indeed, in this scenario the Service Catalog would be removed by the namespace cleanup procedure.

      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
        ServiceCatalog controller pushes the ServiceCatalog into matching application namespace
      • QE
        There are test cases for ServiceCatalog push on worker clusters
      • Docs
        There is a Section in our docs dedicated to explaining the update of ServiceCatalog in application namespaces
        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: