Background
The DCM is one of the components of ONAP4K8s. It will run as a microservice exposing Rest APIs, external components will use REST to communicate with the DCM while other microservices will use gRPC. The DCM will perform the following functions;
...
- Main DCM Microservice (contains the service mesh controller (formally Logical Cloud Controller), User Controller and Namespace Controller, Quota Controller (Limits resources available to each logical cloud))
- CA Key Distribution Controller ( Generate intermediate CA key for each edge which is signed by an root or intermediate key)
Design Overview
draw.io Diagram | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Fig 2: Showing Logical Clouds spanning multiple edge location. Istio Replicated Control planes are used and in each cluster, there is an istio control plane per logical cloud
DCM Source Code Directory Structure
dcm
├── core
│ └── main.go
├── namespace-controller
│ └── namespace.go
├── quota-controller
│ └── quota.go
├── service-mesh-controller
│ └── service-mesh.go
└── user-controller
└── user.go
GO API
REST API
1. Create Logical Cloud
Code Block | ||||
---|---|---|---|---|
| ||||
URL: /v2/projects/<project-name>/logical-clouds POST BODY: { "metadata" : { "name": "lc-1", //unique name for the record "description": "logical cloud for walmart finance department", //description for the logical cloud "userData1":"<user data>", "userData2":"<user data>" }, "spec" : { "namespace" : "ns-1", // one namespace per logical cloud "user" : { "user-name" : "user-1", //name of user for this cloud (username and logical cloud name would be used as subject for the user key) "type" : "certificate", //type of authentication credentials used by user (certificate, Token, UNPW) "user-permissions" : [ { "permission-name" : "permission-1", "apiGroups" : ["stable.example.com"], "resources" : ["secrets", "pods"], "verbs" : ["get", "watch", "list", "create"] }, { "permission-name" : "permission-2", "apiGroups" : [""], "resources" : ["configmaps"], "verbs" : ["*"] } ] } } } Return Status: 201 Return Body: { "name" : "logical-cloud-1", "logical-cloud-name" : "logical-cloud-1", "namespace" : "ns-1", "user-name" : "user-1" } |
...
Code Block | ||||
---|---|---|---|---|
| ||||
GET URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/status GET BODY: GET Return StatusBody : { 201 Return Body "metadata" : { "name" : "logical-cloud-1" "description" : "<description>", } "userclusters" : [ "user-1"cluster-1" : { "namespace-status" : "<status>", "role-status" : "<status>", "role-binding-status" : "<status>" } "cluster-2" : { "namespace-status" : "<status>", "role-status" : "<status>", "role-binding-status" : "<status>" } ], "status": "Creation in Progress " //Created, Creation Failed } |
...