kyma-project / kyma

Kyma is an opinionated set of Kubernetes-based modular building blocks, including all necessary capabilities to develop and run enterprise-grade cloud-native applications.
https://kyma-project.io
Apache License 2.0
1.52k stars 405 forks source link

ServiceBindingUsage fails if ServiceInstance is not yet provisioned #7049

Closed brendandobbs closed 4 years ago

brendandobbs commented 4 years ago

Description

I'm trying to create a ServiceInstance, ServiceBinding and ServiceBindingUsage for redis. The Redis ServiceInstance takes a couple of minutes to provision. In the meantime creating the ServiceBindingUsage fails because the ServiceBinding is not ready.

I see the following in the status of the SBU

status:
  conditions:
  - lastTransitionTime: "2020-01-30T11:38:34Z"
    lastUpdateTime: "2020-01-30T11:41:18Z"
    message: Process error during 15 attempts from 15; cannot use ServiceBinding "brendan/redis-binding"
      which is not in ready state
    reason: ServiceBindingNotReadyError
    status: "False"
    type: Ready

The workaround is to delete and recreate the SBU after the ServiceInstance is ready.

The yaml I'm using is the following....

apiVersion: servicecatalog.k8s.io/v1beta1
kind: ServiceInstance
metadata:
  labels:
    app: productservice
  name: redis
spec:
  clusterServiceClassExternalName: redis
  clusterServicePlanExternalName: enterprise
---
apiVersion: servicecatalog.k8s.io/v1beta1
kind: ServiceBinding
metadata:
  name: redis-binding
spec:
  instanceRef:
    name: redis
---
apiVersion: servicecatalog.kyma-project.io/v1alpha1
kind: ServiceBindingUsage
metadata:
  name: redis-instance-binding-usage
  labels:
    app: productservice
spec:
 serviceBindingRef:
   name: redis-binding
 usedBy:
   kind: deployment
   name: productservice-v1

Expected result

An example of how we can provision and bind to a ServiceInstance. Maybe using a Helm chart would help? (pre-install hook)

PK85 commented 4 years ago

@brendandobbs hello Brendan, what kyma version do you use? Cause since 1.9 it will work. You will get error on SBU, but when Service Binding will be ready then SBU will be READY as well.

Cheers, PK

stale[bot] commented 4 years ago

This issue has been automatically marked as stale due to the lack of recent activity. It will soon be closed if no further activity occurs. Thank you for your contributions.

PK85 commented 4 years ago

This is already done as you described in the ticket.