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

Create Primaza's Service Binding

XMLWordPrintable

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

      None

      Show
      None
    • False
    • Hide

      Feature: Use Primaza Service Binding

      Scenario: Create a service claim with label selector
      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
      applicationNamespaces:

      • applications
        """
        And On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" state will eventually move to "Online"
        And On Primaza Cluster "primaza-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 "primaza-main", RegisteredService "primaza-rsdb" state will eventually move to "Available"
        When On Primaza Cluster "primaza-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
        """
        Then On Primaza Cluster "primaza-main", the status of ServiceClaim "sc-test" is "Resolved"
        And On Primaza Cluster "primaza-main", the secret "sc-test" has the key "type" with value "psqlserver"
        And On Worker Cluster "primaza-worker", the Secret "sc-test" exists
        And On Worker Cluster "primaza-worker", the Service Binding "sc-test" exists
      Show
      Feature: Use Primaza Service Binding Scenario: Create a service claim with label selector 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 applicationNamespaces: applications """ And On Primaza Cluster "primaza-main", ClusterEnvironment "primaza-worker" state will eventually move to "Online" And On Primaza Cluster "primaza-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 "primaza-main", RegisteredService "primaza-rsdb" state will eventually move to "Available" When On Primaza Cluster "primaza-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 """ Then On Primaza Cluster "primaza-main", the status of ServiceClaim "sc-test" is "Resolved" And On Primaza Cluster "primaza-main", the secret "sc-test" has the key "type" with value "psqlserver" And On Worker Cluster "primaza-worker", the Secret "sc-test" exists And On Worker Cluster "primaza-worker", the Service Binding "sc-test" exists

      Owner: Architect:

      Francesco Ilario

      Story (Required)

      As an OpenShift developer, I would like to claim services in the service catalog so that my application can bind to SED.

      Background (Required)

      We need to implement the ServiceClaim API as define in the Primaza architecture document.

      See epic for arch document link.

      Glossary

      See glossary in architecture document

      Out of scope

      • No ApplicationContext, only EnvironmentTag
      • No Application Name, only Label Selector
      • No TTL
      • No ClaimID

      In Scope

      • Use Primaza's Service Binding

      Approach(Required)

      The ServiceClaim controller will determine the target clusters and namespaces by searching all the RegisteredCluster resources that contain the specified EnvironmentTag.
      It will match the claim with a RegisteredService.
      The match is made if the ServiceClaim SCIKeys and SEDKeys are subsets of the RegisteredService SCI and SED correspondingly.
      Once the match is made the SCI and SED data are extracted and a secret resource created.
      A ServiceBinding Resource is also created.
      The ServiceBinding resource for this story is the Primaza's Service Binding one.
      In the ServiceBinding resource the service will point to the secret while the workload will point to the application defined in the claim.
      Both the secret and the ServiceBinding resource will be pushed to the namespaces identified in the target clusters.

      Demo requirements(Required)

      NA

      Dependencies

      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 pushes Primaza's Service Binding to target clusters
      • QE
        Update tests removing Service Binding Operator in favor of Primaza's Application Agent
      • Docs
        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

              rh-ee-filario Francesco Ilario
              rh-ee-filario Francesco Ilario
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: