Active and Available Inventory (AAI) needs to be updated when a Resource Bundle is instantiated in one of the cloud regions managed by the k8splugin.
The requires that;
- The k8splugin provide an API to get the status of a running instance
- The status fields need to be mapped to the AAI data model
- A REST API call to AAI needs to be made when the status of resources changes.
Structure of Resources
Here is how the an instance created by K8splugin is tracked
Instance Body
{ "id": "fnKPvVAL", "request": { "rb-name": "edgex", "rb-version": "v1", "profile-name": "profile2", "cloud-region": "k8sregionone", "labels": null }, "namespace": "testns2", "resources": [ { "GVK": { "Group": "", "Version": "v1", "Kind": "Service" }, "Name": "profile2-edgex-ui" }, { "GVK": { "Group": "apps", "Version": "v1beta2", "Kind": "Deployment" }, "Name": "profile2-edgex-vault" } ] }
Each Resource is tracked as two parts that uniquely identify it in a given namespace
Name and GVK
GVK
{ "Group": "apps", "Version": "v1", "Kind": "Deployment" },