Skip to content

Commit

Permalink
Drop "Custom Projection"
Browse files Browse the repository at this point in the history
Use "Application Resource Mapping" instead.

Signed-off-by: Scott Andrews <andrewssc@vmware.com>
  • Loading branch information
scothis committed Mar 1, 2021
1 parent 66416c9 commit 51fda96
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 475 deletions.
103 changes: 0 additions & 103 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ Behavior within the project is governed by the [Contributor Covenant Code of Con
- [Element-based Example Resource](#element-based-example-resource)
- [PodSpec-able (Default) Example Resource](#podspec-able-default-example-resource)
- [Reconciler Implementation](#reconciler-implementation-1)
- [Custom Projection](#custom-projection)
- [Custom Projection Service Binding Example Resource](#custom-projection-service-binding-example-resource)
- [Resource Type Schema](#resource-type-schema-3)
- [Service Binding Projection Example Resource](#service-binding-projection-example-resource)
- [Binding `Secret` Generation Strategies](#binding-secret-generation-strategies)
- [OLM Operator Descriptors](#olm-operator-descriptors)
- [Descriptor Examples](#descriptor-examples)
Expand Down Expand Up @@ -536,105 +532,6 @@ If a `ServiceBinding` specifies a `.spec.applications.containers` value, and the

A reconciler **MUST** apply the appropriate modification to the application resource addressed by the `ServiceBinding` as defined by `.volumes`.

## Custom Projection

There are scenarios where the Reconciler that processes a `ServiceBinding` (hereinafter referred to as "Reconciler A") is different than the Reconciler that will project the binding into the Application (hereinafter referred to as "Reconciler B"). To transfer the projection responsibility from Reconciler A to Reconciler B the `ServiceBinding` author **MUST** set the `projection.service.binding/type` annotation to `Custom`. An exemplar CRD can be found [here][sbp-crd].

Reconciler A reacts to this annotation by creating a `ServiceBindingProjection` which includes the necessary information for Reconciler B. Reconciler B takes responsibility for the `ServiceBindingProjection` resource to perform the projection. Reconciler A is responsible for updating the `ServiceBindingProjection`'s `.spec` upon corresponding changes to `ServiceBinding`.

Reconciler B **MUST** set the `ServiceBindingProjection`'s `Ready` condition according to the rules set in [Ready Condition Status](#ready-condition-status). Reconciler A **MUST** reflect `ServiceBindingProjection`'s `Ready` condition with an additional `ProjectionReady` condition on `ServiceBinding`. The `Ready` condition of `ServiceBinding` **MUST NOT** be `True` unless `ProjectionReady` is `True`.

A `ServiceBinding` with a custom projection **MUST** allow defining a `.spec.application` referencing a non-`PodSpec`-able resource in addition to the mechanisms to define an application reference described in the [Service Binding][sb] section.

[sb]: #service-binding
[sbp-crd]: internal.service.binding_servicebindingprojections.yaml

### Custom Projection Service Binding Example Resource

```yaml
apiVersion: service.binding/v1alpha2
kind: ServiceBinding
metadata:
name: account-service
annotations:
projection.service.binding/type: "Custom"
spec:
application:
apiVersion: apps/v1
kind: Deployment
name: online-banking
service:
apiVersion: com.example/v1alpha1
kind: AccountService
name: prod-account-service
status:
binding:
name: prod-account-service-projection
conditions:
- type: Ready
status: 'True'
- type: ProjectionReady
status: 'True'
```

### Resource Type Schema

```yaml
apiVersion: internal.service.binding/v1alpha2
kind: ServiceBindingProjection
metadata:
name: # string
generation: # int64, defined by the Kubernetes control plane
...
spec:
name: # string
binding: # LocalObjectReference
name: # string
application: # ObjectReference-like
apiVersion: # string
kind: # string
name: # string, mutually exclusive with selector
selector: # metav1.LabelSelector, mutually exclusive with name
containers: # []intstr.IntOrString, optional
env: # []EnvMapping, optional
- name: # string
key: # string
status:
conditions: # []Condition containing at least one entry for `Ready`
- type: # string
status: # string
lastTransitionTime: # Time
reason: # string
message: # string
observedGeneration: # int64
```
### Service Binding Projection Example Resource
```yaml
apiVersion: internal.service.binding/v1alpha2
kind: ServiceBindingProjection
metadata:
name: account-service
spec:
binding:
name: prod-account-service-projection

application:
apiVersion: apps/v1
kind: Deployment
name: online-banking

status:
conditions:
- type: Ready
status: 'True'
```
## Binding `Secret` Generation Strategies

Many services, especially initially, will not be Provisioned Service-compliant. These services will expose the appropriate binding `Secret` information, but not in the way that the specification or applications expect. Users should have a way of describing a mapping from existing data associated with arbitrary resources and CRDs to a representation of a binding `Secret`.
Expand Down
209 changes: 0 additions & 209 deletions internal.service.binding_servicebindingprojections.yaml

This file was deleted.

36 changes: 0 additions & 36 deletions internal/internal.service.binding/v1alpha2/group_version.go

This file was deleted.

Loading

0 comments on commit 51fda96

Please sign in to comment.