cloud-operators icon indicating copy to clipboard operation
cloud-operators copied to clipboard

Add conditions to Service and Binding CR to record the time when it becomes Online

Open qibobo opened this issue 5 years ago • 0 comments

In other CRDs, there are conditions that can record when the CR is ready/online, and it is useful to measure how long it takes for the Service and Binding CR to be Online.

Below is an example for knative service:

status:
  address:
    url: http://knative-vcap.default.svc.cluster.local
  conditions:
  - lastTransitionTime: "2020-09-23T13:53:13Z"
    status: "True"
    type: ConfigurationsReady
  - lastTransitionTime: "2020-09-23T13:53:14Z"
    status: "True"
    type: Ready
  - lastTransitionTime: "2020-09-23T13:53:14Z"
    status: "True"
    type: RoutesReady

There is no such information for current Binding and Service.

kubectl get binding.ibmcloud thetranslator-9 -o yaml
apiVersion: ibmcloud.ibm.com/v1
kind: Binding
metadata:
  annotations:
    ibmcloud.ibm.com/keyId: crn:v1:bluemix:public:language-translator:us-south:a/ef6a34810cbcd892507d3ebe01e3d95a:9bc0dc93-969b-428e-a346-dd129bdeb44b:resource-key:fd24e6c1-5347-46e5-b6aa-38e43b5584e3
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"ibmcloud.ibm.com/v1alpha1","kind":"Binding","metadata":{"annotations":{"ibmcloud.ibm.com/keyId":"crn:v1:bluemix:public:language-translator:us-south:a/ef6a34810cbcd892507d3ebe01e3d95a:9bc0dc93-969b-428e-a346-dd129bdeb44b:resource-key:fd24e6c1-5347-46e5-b6aa-38e43b5584e3"},"name":"thetranslator-9","namespace":"default"},"spec":{"alias":"thetranslator","serviceName":"thetranslator"}}
  creationTimestamp: "2020-09-24T03:16:37Z"
  finalizers:
  - binding.ibmcloud.ibm.com
  generation: 1
  name: thetranslator-9
  namespace: default
  ownerReferences:
  - apiVersion: ibmcloud.ibm.com/v1
    blockOwnerDeletion: true
    controller: true
    kind: Service
    name: thetranslator
    uid: 7f77cb1f-3324-4d4c-bab5-9a9fa93250e6
  resourceVersion: "19871005"
  selfLink: /apis/ibmcloud.ibm.com/v1/namespaces/default/bindings/thetranslator-9
  uid: f6be4f2c-a088-45f9-9f01-e7bb13153ee9
spec:
  alias: thetranslator
  serviceName: thetranslator
status:
  instanceId: 'xxx'
  keyInstanceId: yyy
  message: Online
  secretName: thetranslator-9
  state: Online

qibobo avatar Sep 24 '20 05:09 qibobo