Services and service bindings API reference

This topic gives you reference information for API resources related to services and service bindings on Tanzu Platform for Kubernetes.

ServiceBinding

apiVersion: services.tanzu.vmware.com/v1
kind: ServiceBinding
metadata:
  name: name-of-the-service-binding
spec:
  # targetRef is the reference to the target resource that the service is being bound to.
  targetRef:
    apiGroup: apps.tanzu.vmware.com
    kind: ContainerApp
    name: name-of-containerapp

  # serviceRef is the reference to the service that will be bound to the target workload.
  serviceRef:
    apiGroup: bitnami.database.tanzu.vmware.com
    kind: PostgreSQLInstance
    name: dev-postgres

  # alias is an optional field that can be used to provide the directory name of the
  # target volume mount that is going to contain the binding details. If not set, the directory
  # name of the volume mount will be the ServiceBinding .metadata.name.
  alias: devdb

If the service reference points to a PreProvisionedService resource, then the connectorName field is required to identify the binding connector to use.

  # serviceRef is the reference to the service that will be bound to the target workload.
  serviceRef:
    apiGroup: services.tanzu.vmware.com
    kind: PreProvisionedService
    name: prod-aws-aurora-postgres
    connectorName: read-write

PreProvisionedService

apiVersion: services.tanzu.vmware.com/v1
kind: PreProvisionedService
metadata:
  name: prod-aws-aurora-postgres
spec:

  # Meta-information regarding the service
  description: Aurora Global Database spanning us-east and eu-west
  contact:
    email: foo@corp.com

  bindingConnectors:

    # The names of the bindingConnectors can be arbitrary
    - name: read-write
      description: Read-write available in all availability targets
      # type should conform to the "type" from Spring Cloud Bindings
      type: mysql
      # A different secret, conforming to the Kubernetes Service Binding spec should be provided for each AT in the Space.
      availabilityTargets:
        us-east:
          secretRef:
            name: secret-aurora-rw-us-east
          # Optional template to generate EgressPoint resources in the space when the service is bound to a workload.
          egressPointTemplate:
            targets:
              - hosts: ["aurora-rw.us-east.amazonaws.com"]
                port:
                  number: 3306
                  protocol: TCP
        eu-west:
          secretRef:
            name: secret-aurora-rw-eu-west
          egressPointTemplate:
            targets:
              - hosts: ["aurora-rw.eu-west.amazonaws.com"]
                port:
                  number: 3306
                  protocol: TCP

    - name: read-only
      description: Read-only available in all availability targets
      type: mysql
      # For use-cases in which the secret is the same for all ATs, this shorthand notation can be used.
      secretRef:
        name: secret-aurora-ro
      # Optional template to generate EgressPoint resources in the space when the service is bound to a workload.
      egressPointTemplate:
        targets:
          - hosts: ["aurora-ro.us-west.amazonaws.com"]
            port:
              number: 3306
              protocol: TCP
Note

For each binding connector, you should provide either the availabilityTargets configuration (as in the read-write binding connector above), or secretRef and optional egressPointTemplate that is applied to all availability targets in the space (as in the read-only binding connector above).

Bitnami Services

apiVersion: bitnami.messaging.tanzu.vmware.com/v1alpha1
kind: KafkaInstance
metadata:
  name: kafka
spec:
  # Storage size in GB
  storageGB: 1
---
apiVersion: bitnami.database.tanzu.vmware.com/v1alpha1
kind: MongoDBInstance
metadata:
  name: mongo
spec:
  storageGB: 1
---
apiVersion: bitnami.database.tanzu.vmware.com/v1alpha1
kind: MySQLInstance
metadata:
  name: mysql
spec:
  storageGB: 1
---
apiVersion: bitnami.database.tanzu.vmware.com/v1alpha1
kind: PostgreSQLInstance
metadata:
  name: postgres
spec:
  storageGB: 1
---
apiVersion: bitnami.messaging.tanzu.vmware.com/v1alpha1
kind: RabbitmqCluster
metadata:
  name: rabbit
spec:
  storageGB: 2
  # Number of Pod replicas
  replicas: 1
---
apiVersion: bitnami.caching.tanzu.vmware.com/v1alpha1
kind: RedisCluster
metadata:
  name: redis
spec:
  storageGB: 1
---
apiVersion: bitnami.caching.tanzu.vmware.com/v1alpha1
kind: ValkeyCluster
metadata:
  name: valkey
spec:
  storageGB: 1
---
apiVersion: bitnami.database.tanzu.vmware.com/v1alpha1
kind: CassandraCluster
metadata:
  name: cassandra
spec:
  storageGB: 1
---
apiVersion: bitnami.database.tanzu.vmware.com/v1alpha1
kind: Neo4jInstance
metadata:
  name: neo4j
spec:
  storageGB: 1
check-circle-line exclamation-circle-line close-line
Scroll to top icon