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

Reconcile Service Classes in service namespaces

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Minor Minor
    • Primaza 0.1
    • None
    • Service Binding
    • None
    • 3
    • False
    • Hide

      None

      Show
      None
    • False
    • Hide

      Feature: Reconcile Service Classes in Service namespaces

      Scenario: Service Classes are pushed to new Cluster Environments' service namespaces
      Given Primaza Cluster "primaza-main" is running
      And Worker Cluster "primaza-worker" for "primaza-main" is running
      And Clusters "primaza-main" and "primaza-worker" can communicate
      And On Primaza Cluster "primaza-main", Worker "primaza-worker"'s ClusterContext secret "primaza-kw" is published
      And On Primaza Cluster "primaza-main", Resource is created
      """
      apiVersion: primaza.io/v1alpha1
      kind: ClusterEnvironment
      metadata:
      name: primaza-worker
      namespace: primaza-system
      spec:
      environmentName: dev
      clusterContextSecret: primaza-kw
      """
      And On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" state will eventually move to "Online"
      And On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" status condition with Type "Online" has Status "True"
      And On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" status condition with Type "serviceNamespacePermissionsRequired" has Status "False"
      And On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" status condition with Type "ServiceNamespacePermissionsRequired" has Status "False"
      And On Primaza Cluster "primaza-main", Resource is created
      """
      apiVersion: primaza.io/v1alpha1
      kind: ServiceClass
      metadata:
      name: $scenario_id-serviceclass
      namespace: primaza-system
      spec:
      constraints: {}
      resource:
      apiVersion: stable.example.com/v1
      kind: Backend
      serviceEndpointDefinitionMapping:

      • name: host
        jsonPath: .spec.host
        serviceClassIdentity:
      • name: type
        value: backend
      • name: provider
        value: stable.example.com
      • name: version
        value: v1
        """
        When On Primaza Cluster "primaza-main", Resource is updated
        """
        apiVersion: primaza.io/v1alpha1
        kind: ClusterEnvironment
        metadata:
        name: primaza-worker
        namespace: primaza-system
        spec:
        environmentName: dev
        clusterContextSecret: primaza-kw
        serviceNamespaces:
      • services
        """
        Then On Worker Cluster "primaza-worker", Service Class "$scenario_id-serviceclass" exists in "services"

      Scenario: Service Classes are pushed to service namespaces of new Cluster Environments
      Given Primaza Cluster "primaza-main" is running
      And Worker Cluster "primaza-worker" for "primaza-main" is running
      And Clusters "primaza-main" and "primaza-worker" can communicate
      And On Primaza Cluster "primaza-main", Worker "primaza-worker"'s ClusterContext secret "primaza-kw" is published
      And On Primaza Cluster "primaza-main", Resource is created
      """
      apiVersion: primaza.io/v1alpha1
      kind: ServiceClass
      metadata:
      name: $scenario_id-serviceclass
      namespace: primaza-system
      spec:
      constraints: {}
      resource:
      apiVersion: stable.example.com/v1
      kind: Backend
      serviceEndpointDefinitionMapping:

      • name: host
        jsonPath: .spec.host
        serviceClassIdentity:
      • name: type
        value: backend
      • name: provider
        value: stable.example.com
      • name: version
        value: v1
        """
        When On Primaza Cluster "primaza-main", Resource is created
        """
        apiVersion: primaza.io/v1alpha1
        kind: ClusterEnvironment
        metadata:
        name: primaza-worker
        namespace: primaza-system
        spec:
        environmentName: dev
        clusterContextSecret: primaza-kw
        serviceNamespaces:
      • services
        """
        Then On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" state will eventually move to "Online"
        And On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" status condition with Type "Online" has Status "True"
        And On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" status condition with Type "serviceNamespacePermissionsRequired" has Status "False"
        And On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" status condition with Type "ServiceNamespacePermissionsRequired" has Status "False"
        And On Worker Cluster "primaza-worker", Service Class "$scenario_id-serviceclass" exists in "services"
      Show
      Feature: Reconcile Service Classes in Service namespaces Scenario: Service Classes are pushed to new Cluster Environments' service namespaces Given Primaza Cluster "primaza-main" is running And Worker Cluster "primaza-worker" for "primaza-main" is running And Clusters "primaza-main" and "primaza-worker" can communicate And On Primaza Cluster "primaza-main", Worker "primaza-worker"'s ClusterContext secret "primaza-kw" is published And On Primaza Cluster "primaza-main", Resource is created """ apiVersion: primaza.io/v1alpha1 kind: ClusterEnvironment metadata: name: primaza-worker namespace: primaza-system spec: environmentName: dev clusterContextSecret: primaza-kw """ And On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" state will eventually move to "Online" And On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" status condition with Type "Online" has Status "True" And On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" status condition with Type "serviceNamespacePermissionsRequired" has Status "False" And On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" status condition with Type "ServiceNamespacePermissionsRequired" has Status "False" And On Primaza Cluster "primaza-main", Resource is created """ apiVersion: primaza.io/v1alpha1 kind: ServiceClass metadata: name: $scenario_id-serviceclass namespace: primaza-system spec: constraints: {} resource: apiVersion: stable.example.com/v1 kind: Backend serviceEndpointDefinitionMapping: name: host jsonPath: .spec.host serviceClassIdentity: name: type value: backend name: provider value: stable.example.com name: version value: v1 """ When On Primaza Cluster "primaza-main", Resource is updated """ apiVersion: primaza.io/v1alpha1 kind: ClusterEnvironment metadata: name: primaza-worker namespace: primaza-system spec: environmentName: dev clusterContextSecret: primaza-kw serviceNamespaces: services """ Then On Worker Cluster "primaza-worker", Service Class "$scenario_id-serviceclass" exists in "services" Scenario: Service Classes are pushed to service namespaces of new Cluster Environments Given Primaza Cluster "primaza-main" is running And Worker Cluster "primaza-worker" for "primaza-main" is running And Clusters "primaza-main" and "primaza-worker" can communicate And On Primaza Cluster "primaza-main", Worker "primaza-worker"'s ClusterContext secret "primaza-kw" is published And On Primaza Cluster "primaza-main", Resource is created """ apiVersion: primaza.io/v1alpha1 kind: ServiceClass metadata: name: $scenario_id-serviceclass namespace: primaza-system spec: constraints: {} resource: apiVersion: stable.example.com/v1 kind: Backend serviceEndpointDefinitionMapping: name: host jsonPath: .spec.host serviceClassIdentity: name: type value: backend name: provider value: stable.example.com name: version value: v1 """ When On Primaza Cluster "primaza-main", Resource is created """ apiVersion: primaza.io/v1alpha1 kind: ClusterEnvironment metadata: name: primaza-worker namespace: primaza-system spec: environmentName: dev clusterContextSecret: primaza-kw serviceNamespaces: services """ Then On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" state will eventually move to "Online" And On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" status condition with Type "Online" has Status "True" And On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" status condition with Type "serviceNamespacePermissionsRequired" has Status "False" And On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" status condition with Type "ServiceNamespacePermissionsRequired" has Status "False" And On Worker Cluster "primaza-worker", Service Class "$scenario_id-serviceclass" exists in "services"
    • AppSvc Sprint 233

      Owner: Architect:

      Francesco Ilario

      Story (Required)

      As a Primaza Developer, I would like Primaza to push Service Classes in service namespaces on Cluster Environment creation and update so that I will have Service Classes in new service namespaces

      Background (Required)

      A namespace can be added to a Cluster Environment's service namespaces list after that several Service Classes are created.
      It is hence needed to push all matching Service Classes to the service namespace.

      See epic for arch document link.

      Glossary

      See glossary in architecture document

      Out of scope

      NA

      In Scope

      • Reconcile Service Classes

      Approach(Required)

      When a creation or update event on a Cluster Environment occurs, its service namespaces should be reconciled.
      For each service namespace, matching Service Classes should be pushed.
      If the Service Class already exists in the namespace, the error should be ignored.

      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
        ClusterEnvironment controller pushes matching Service Classes to all service namespaces during reconciliation
      • QE
        There are test cases for service namespace initialization that checks for Service Classes existence
      • Docs
        There is Section in our docs dedicated to explaining service namespaces initialization
        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: