Skip to content

Instantly share code, notes, and snippets.

@sbose78
Created February 12, 2019 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbose78/879edcf12d324c91ee8d6d75388825c2 to your computer and use it in GitHub Desktop.
Save sbose78/879edcf12d324c91ee8d6d75388825c2 to your computer and use it in GitHub Desktop.
create component
@startuml
participant UI
participant AppServiceAPI
participant OpenShiftAPI
participant GitServiceAPI
== Create component ==
UI -> AppServiceAPI : Create Component {codebase:xyz , build:nodejs , port:8089}
group Option 1 : controller-driven openshift object creation
AppServiceAPI -> OpenShiftAPI : Create devfile CR
OpenShiftAPI -> AppServiceAPI : devfile created
AppServiceAPI -> UI : Component descriptor created as a devfile successfully
OpenShiftAPI --> OpenShiftAPI : Auto triggers controller which \n watches on the devfile CR \n and creates objects BC,DC
end
group Option 2 : Synchronous object creation
AppServiceAPI -> OpenShiftAPI : creates objects BC,DC
OpenShiftAPI -> AppServiceAPI : BC,DC created successfully
AppServiceAPI -> UI : Component initialized
end
== List available Services ==
UI -> AppServiceAPI : Get Available Services
AppServiceAPI -> OpenShiftAPI : Get list of service classes svcat get classes
OpenShiftAPI --> AppServiceAPI : { service1,service2..}
AppServiceAPI -> OpenShiftAPI : Call Operator Catalog API
OpenShiftAPI --> AppServiceAPI : { service3,service4..}
AppServiceAPI -> UI : Return list of available services \n from service catalog and \n the operator catalog.
== Provision Service ==
UI -> AppServiceAPI : Provision Service "postgresql-persistent"
group Option 1 : controller-driven Kubernetes object creation
AppServiceAPI -> OpenShiftAPI : Update devfile CR
AppServiceAPI -> UI : Component descriptor aka devfile updated successfully
OpenShiftAPI -> OpenShiftAPI : Auto trigger controller \n which watches devfile CR and \n provisions service ( ServiceInstance, ServiceBinding..)
end
group Option 2 : Synchronous Kubernetes object creation
AppServiceAPI -> OpenShiftAPI : provision service by creating \n a ServiceInstance and a ServiceBinding.
OpenShiftAPI -> AppServiceAPI : Service objects created successfully.
AppServiceAPI -> UI : Service initialization in progress
end
== Associate Service with Component ==
UI -> AppServiceAPI : {name:ENV_VAR_NAME,\nvalueFrom:\n{secretKeyRef: \n {name:postgresql-persistent,key:db_name}\n}\n}
AppServiceAPI -> OpenShiftAPI : update deploymentConfig for the component \n Optionally trigger build.
OpenShiftAPI -> AppServiceAPI : DeploymentConfig updated.
AppServiceAPI -> UI : Service association complete.
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment