Uploaded image for project: 'Database as a Service'
  1. Database as a Service
  2. DBAAS-814

As a GitOps adminstrator, I want to specify a label selector for DBaaSPolicy namespaces

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • 0.3.0 [R4], 0.2.0 [R3], 0.4.0 [R5]
    • Core - DBaaS Operator
    • None

      As a user, I want the option to specify namespace label selector(s) in the policy/inventory CRs. The operator would then treat any namespace(s) with said selector as valid "connection namespaces", thus allowing connections from those namespaces. 

      per rhn-gps-rspazzol - "Namespaces come and go, so If one has to list the exact namespaces in that policy one would have to update the CR every time a namespace is added or removed. Instead, having a namespace label selector would make the list of namespaces dynamic with a configuration that does not have to change. This is how a label selector works: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/."

      "What if you want to choose only the namespaces where the label is `foo: bar`?"

      The result of this change would be a new *metav1.LabelSelector field.
      In the DBaaSPolicy object, this would look like the following -

      spec:
        connections:
          nsSelector:
            matchExpressions:
              - key: test
                operator: NotIn
                values:
                  - production
            matchLabels:
            - foo: one
            - two: bar

      In the DBaaSInventory object, this would look like the following -

      spec:
        policy:
          connections:
            nsSelector:
              matchExpressions:
                - key: test
                  operator: NotIn
                  values:
                    - production
              matchLabels:
              - foo: one
              - two: bar

      As part of this, we’ll restructure the current policy type/object(s) which will require new versions of both the DBaaSPolicy & DBaaSInventory APIs.

      MVP for R4 will look like this -

      spec:
        connectionNsSelector:
          matchExpressions:
            - key: test
              operator: NotIn
              values:
                - production
          matchLabels:
          - foo: one
          - two: bar

              tohughes Tommy Hughes
              jeremy1230 Jeremy Ary
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 1 day
                  1d
                  Remaining:
                  Time Spent - 5 hours Remaining Estimate - 3 hours
                  3h
                  Logged:
                  Time Spent - 5 hours Remaining Estimate - 3 hours
                  5h