Skip to content

Commit c55c320

Browse files
authored
Support servicebinding.io/v1beta1 (vmware-tanzu#227)
1 parent 0cc820a commit c55c320

File tree

8 files changed

+208
-17
lines changed

8 files changed

+208
-17
lines changed

.ko.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
defaultBaseImage: cloudfoundry/run:tiny
1+
defaultBaseImage: gcr.io/paketo-buildpacks/run:tiny-cnb

README.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,21 @@
77
[![codecov](https://codecov.io/gh/vmware-tanzu/servicebinding/branch/main/graph/badge.svg)](https://codecov.io/gh/vmware-tanzu/servicebinding)
88

99

10-
Service Bindings for Kubernetes implements the [Service Binding Specification for Kubernetes](https://servicebinding.io/). We are tracking changes to the spec as it approaches a stable release (currently targeting [RC3](https://github.com/servicebinding/spec/tree/v1.0.0-rc3)). Backwards and forwards compatibility should not be expected for alpha versioned resources.
10+
Service Bindings for Kubernetes implements the [Service Binding Specification for Kubernetes](https://servicebinding.io/) v1.0.
1111

1212
This implementation provides support for:
13-
- [Provisioned Service](https://github.com/servicebinding/spec/tree/v1.0.0-rc3#provisioned-service)
14-
- [Workload Projection](https://github.com/servicebinding/spec/tree/v1.0.0-rc3#workload-projection)
15-
- [Service Binding](https://github.com/servicebinding/spec/tree/v1.0.0-rc3#service-binding)
16-
- [Direct Secret Reference](https://github.com/servicebinding/spec/tree/v1.0.0-rc3#direct-secret-reference)
17-
- [Role-Based Access Control (RBAC)](https://github.com/servicebinding/spec/tree/v1.0.0-rc3#role-based-access-control-rbac)
13+
- [Provisioned Service](https://github.com/servicebinding/spec/tree/v1.0.0#provisioned-service)
14+
- [Workload Projection](https://github.com/servicebinding/spec/tree/v1.0.0#workload-projection)
15+
- [Service Binding](https://github.com/servicebinding/spec/tree/v1.0.0#service-binding)
16+
- [Direct Secret Reference](https://github.com/servicebinding/spec/tree/v1.0.0#direct-secret-reference)
17+
- [Role-Based Access Control (RBAC)](https://github.com/servicebinding/spec/tree/v1.0.0#role-based-access-control-rbac)
1818

1919
The following are not implemented:
20-
- [Workload Resource Mapping](https://github.com/servicebinding/spec/tree/v1.0.0-rc3#workload-resource-mapping)
20+
- [Workload Resource Mapping](https://github.com/servicebinding/spec/tree/v1.0.0#workload-resource-mapping)
2121
- Extensions including:
22-
- [Binding Secret Generation Strategies](https://github.com/servicebinding/spec/blob/v1.0.0-rc3/extensions/secret-generation.md)
22+
- [Binding Secret Generation Strategies](https://github.com/servicebinding/spec/blob/v1.0.0/extensions/secret-generation.md)
23+
24+
Equivalent capabilities from the v1.0.0-rc3 (servicebinding.io/v1alpha3) version of the spec are also supported. There are no significant API or runtime changes between v1alpha3 and v1beta1 versions.
2325

2426
## Try it out
2527

@@ -60,12 +62,12 @@ Samples are located in the [samples directory](./samples), including:
6062

6163
## Resources
6264

63-
### ServiceBinding (servicebinding.io/v1alpha3)
65+
### ServiceBinding (servicebinding.io/v1beta1)
6466

6567
The `ServiceBinding` resource shape and behavior is defined by the spec.
6668

6769
```
68-
apiVersion: servicebinding.io/v1alpha3
70+
apiVersion: servicebinding.io/v1beta1
6971
kind: ServiceBinding
7072
metadata:
7173
name: account-db

config/300-servicebinding.yaml

+189
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,192 @@ spec:
212212
storage: true
213213
subresources:
214214
status: {}
215+
- additionalPrinterColumns:
216+
- jsonPath: .status.conditions[?(@.type=="Ready")].status
217+
name: Ready
218+
type: string
219+
- jsonPath: .status.conditions[?(@.type=="Ready")].reason
220+
name: Reason
221+
type: string
222+
- jsonPath: .metadata.creationTimestamp
223+
name: Age
224+
type: date
225+
name: v1beta1
226+
schema:
227+
openAPIV3Schema:
228+
description: ServiceBinding is the Schema for the servicebindings API
229+
properties:
230+
apiVersion:
231+
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
232+
type: string
233+
kind:
234+
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
235+
type: string
236+
metadata:
237+
type: object
238+
spec:
239+
description: ServiceBindingSpec defines the desired state of ServiceBinding
240+
properties:
241+
env:
242+
description: Env is the collection of mappings from Secret entries to environment variables
243+
items:
244+
description: EnvMapping defines a mapping from the value of a Secret entry to an environment variable
245+
properties:
246+
key:
247+
description: Key is the key in the Secret that will be exposed
248+
type: string
249+
name:
250+
description: Name is the name of the environment variable
251+
type: string
252+
required:
253+
- key
254+
- name
255+
type: object
256+
type: array
257+
name:
258+
description: Name is the name of the service as projected into the workload container. Defaults to .metadata.name.
259+
type: string
260+
provider:
261+
description: Provider is the provider of the service as projected into the workload container
262+
type: string
263+
service:
264+
description: Service is a reference to an object that fulfills the ProvisionedService duck type
265+
properties:
266+
apiVersion:
267+
description: API version of the referent.
268+
type: string
269+
kind:
270+
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
271+
type: string
272+
name:
273+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
274+
type: string
275+
required:
276+
- apiVersion
277+
- kind
278+
- name
279+
type: object
280+
type:
281+
description: Type is the type of the service as projected into the workload container
282+
type: string
283+
workload:
284+
description: Workload is a reference to an object
285+
properties:
286+
apiVersion:
287+
description: API version of the referent.
288+
type: string
289+
containers:
290+
description: Containers describes which containers in a Pod should be bound to
291+
items:
292+
type: string
293+
type: array
294+
kind:
295+
description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
296+
type: string
297+
name:
298+
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
299+
type: string
300+
selector:
301+
description: Selector is a query that selects the workload or workloads to bind the service to
302+
properties:
303+
matchExpressions:
304+
description: matchExpressions is a list of label selector requirements. The requirements are ANDed.
305+
items:
306+
description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
307+
properties:
308+
key:
309+
description: key is the label key that the selector applies to.
310+
type: string
311+
operator:
312+
description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
313+
type: string
314+
values:
315+
description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
316+
items:
317+
type: string
318+
type: array
319+
required:
320+
- key
321+
- operator
322+
type: object
323+
type: array
324+
matchLabels:
325+
additionalProperties:
326+
type: string
327+
description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
328+
type: object
329+
type: object
330+
required:
331+
- apiVersion
332+
- kind
333+
type: object
334+
required:
335+
- service
336+
- workload
337+
type: object
338+
status:
339+
description: ServiceBindingStatus defines the observed state of ServiceBinding
340+
properties:
341+
binding:
342+
description: Binding exposes the projected secret for this ServiceBinding
343+
properties:
344+
name:
345+
description: 'Name of the referent secret. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
346+
type: string
347+
required:
348+
- name
349+
type: object
350+
conditions:
351+
description: Conditions are the conditions of this ServiceBinding
352+
items:
353+
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
354+
properties:
355+
lastTransitionTime:
356+
description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
357+
format: date-time
358+
type: string
359+
message:
360+
description: message is a human readable message indicating details about the transition. This may be an empty string.
361+
maxLength: 32768
362+
type: string
363+
observedGeneration:
364+
description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
365+
format: int64
366+
minimum: 0
367+
type: integer
368+
reason:
369+
description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
370+
maxLength: 1024
371+
minLength: 1
372+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
373+
type: string
374+
status:
375+
description: status of the condition, one of True, False, Unknown.
376+
enum:
377+
- "True"
378+
- "False"
379+
- Unknown
380+
type: string
381+
type:
382+
description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
383+
maxLength: 316
384+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
385+
type: string
386+
required:
387+
- lastTransitionTime
388+
- message
389+
- reason
390+
- status
391+
- type
392+
type: object
393+
type: array
394+
observedGeneration:
395+
description: ObservedGeneration is the 'Generation' of the ServiceBinding that was last processed by the controller.
396+
format: int64
397+
type: integer
398+
type: object
399+
type: object
400+
served: true
401+
storage: false
402+
subresources:
403+
status: {}

samples/controlled-resource/service-binding.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
---
5-
apiVersion: servicebinding.io/v1alpha3
5+
apiVersion: servicebinding.io/v1beta1
66
kind: ServiceBinding
77
metadata:
88
name: controlled-resource

samples/multi-binding/service-binding.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
---
5-
apiVersion: servicebinding.io/v1alpha3
5+
apiVersion: servicebinding.io/v1beta1
66
kind: ServiceBinding
77
metadata:
88
name: multi-binding-1
@@ -23,7 +23,7 @@ spec:
2323
key: number
2424

2525
---
26-
apiVersion: servicebinding.io/v1alpha3
26+
apiVersion: servicebinding.io/v1beta1
2727
kind: ServiceBinding
2828
metadata:
2929
name: multi-binding-2

samples/overridden-type-provider/service-binding.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
---
5-
apiVersion: servicebinding.io/v1alpha3
5+
apiVersion: servicebinding.io/v1beta1
66
kind: ServiceBinding
77
metadata:
88
name: overridden-type-provider

samples/provisioned-service/service-binding.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
---
5-
apiVersion: servicebinding.io/v1alpha3
5+
apiVersion: servicebinding.io/v1beta1
66
kind: ServiceBinding
77
metadata:
88
name: provisioned-service

samples/spring-petclinic/service-binding.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
---
5-
apiVersion: servicebinding.io/v1alpha3
5+
apiVersion: servicebinding.io/v1beta1
66
kind: ServiceBinding
77
metadata:
88
name: spring-petclinic-db

0 commit comments

Comments
 (0)