service-bindings

module
Version: v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2021 License: Apache-2.0

README

Service Bindings for Kubernetes

CI GoDoc Go Report Card codecov

Service Bindings for Kubernetes implements the Service Binding Specification for Kubernetes. We are tracking changes to the spec as it approaches a stable release (currently targeting pre-RC3). Backwards and forwards compatibility should not be expected for alpha versioned resources.

This implementation provides support for:

The following are not supported:

Try it out

Prerequisites:

  • a Kubernetes 1.18+ cluster

Using the latest release is recommended.

Build from source

We use Golang and ko to build the CRD and reconciler, and kapp to deploy them.

From within the cloned directory for this project, run:

kapp deploy -a service-bindings -f <(ko resolve -f config)
Uninstall
kapp delete -a service-bindings

Samples

Samples are located in the samples directory, including:

Resources

ServiceBinding (servicebinding.io/v1alpha3)

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

apiVersion: servicebinding.io/v1alpha3
kind: ServiceBinding
metadata:
  name: account-db
spec:
  service:
    apiVersion: bindings.labs.vmware.com/v1alpha1
    kind: ProvisionedService
    name: account-db
  workload:
    apiVersion: apps/v1
    kind: Deployment
    name: account-service
ProvisionedService (bindings.labs.vmware.com/v1alpha1)

The ProvisionedService exposes a resource Secret by implementing the upstream Provisioned Service duck type, and may be the target of the .spec.service reference for a ServiceBinding. It is intended for compatibility with existing services that do not directly implement the duck type.

For example to expose a service with an existing Secret named account-db-service:

apiVersion: bindings.labs.vmware.com/v1alpha1
kind: ProvisionedService
metadata:
  name: account-db
spec:
  binding:
    name: account-db-service

---
apiVersion: v1
kind: Secret
metadata:
  name: account-db-service
type: Opaque
stringData:
  type: mysql
  # use appropriate values
  host: localhost
  database: default
  password: ""
  port: "3306"
  username: root

The controller writes the resource's status to implement the duck type.

Contributing

The Service Bindings for Kubernetes project team welcomes contributions from the community. If you wish to contribute code and you have not signed our contributor license agreement (CLA), our bot will update the issue when you open a Pull Request. For any questions about the CLA process, please refer to our FAQ. For more detailed information, refer to CONTRIBUTING.md.

Acknowledgements

Service Bindings for Kubernetes is an implementation of the Service Binding Specification for Kubernetes. Thanks to Arthur De Magalhaes and Ben Hale for leading the spec effort.

The initial implementation was conceived in projectriff/bindings by Scott Andrews, Emily Casey and the riff community at large, drawing inspiration from mattmoor/bindings and Knative duck type reconcilers.

License

Apache License v2.0: see LICENSE for details.

Directories

Path Synopsis
cmd
pkg
apis/duck/v1alpha3
+k8s:deepcopy-gen=package +groupName=duck.bindings.labs.vmware.com
+k8s:deepcopy-gen=package +groupName=duck.bindings.labs.vmware.com
apis/labs/v1alpha1
+k8s:deepcopy-gen=package +groupName=bindings.labs.vmware.com
+k8s:deepcopy-gen=package +groupName=bindings.labs.vmware.com
apis/labsinternal/v1alpha1
+k8s:deepcopy-gen=package +groupName=internal.bindings.labs.vmware.com
+k8s:deepcopy-gen=package +groupName=internal.bindings.labs.vmware.com
apis/servicebinding/v1alpha3
+k8s:deepcopy-gen=package +groupName=servicebinding.io
+k8s:deepcopy-gen=package +groupName=servicebinding.io
client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/clientset/versioned/typed/duck/v1alpha3
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/duck/v1alpha3/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
client/clientset/versioned/typed/labs/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/labs/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
client/clientset/versioned/typed/labsinternal/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/labsinternal/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
client/clientset/versioned/typed/servicebinding/v1alpha3
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/servicebinding/v1alpha3/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL