...
- Main DCM Microservice (contains the service mesh Module(formally Logical Cloud Controller), User Module and Namespace Module, Quota Module(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)
...
- Client creates logical cloud using logical cloud creation API and the following documents are created in the DCM collection
- The core module parses the Json and creates a new document for the logical cloud in the mongodb DCM collection.
- The core module also creates a cluster document in the DCM collection
- The user module parses the Json and creates a new document for user
The namespace module parses the Json and creates a new document for namespace
- Associates logical cloud with clusters (this API is called multiple times)
- Updates the cluster document with the cluster name, loadbalancer ip every time its called
- Add quota for logical cloud
- The quota module creates a quota document containing the quota details
- Apply API is called
- Service mesh module gets CA bundle from CA controller via gRPC
- Service mesh module gets names of logical cloud and creates a new namespace name using name of logical cloud name
- Service mesh module creates helm template/istioctl manifest (WIP)
- Service mesh module creates service mesh document in the DCM collection and stores the above (CA bundle contents, istio namespace, istioctl manifest) in the document
- DCM informs the resource synchronizer to start the logical cloud creation via gRPC and the resource synchronizer starts reading from the DB
- The DCM gets status from the resource synchronizer via gRPC
- When the logical cloud creation is complete, the resource synchronizer will store the modified kubeconfig file for each cluster in the cluster document of the logical cloud
...
The details of the DCM Data Model can be found in DCM MongoDB Data Model
DCM Source Code Directory Structure
...
Code Block |
---|
language | js |
---|
title | Logical Cloud Creation API |
---|
|
URL: /v2/projects/<project-name>/logical-clouds
POST BODY:
{
"metadata" : {
"logical-cloud-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 |
---|
language | js |
---|
title | PUT Logical Cloud |
---|
|
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>
PUT BODY:
{
"metadata" : {
"logical-cloud-name": "lc-1",
"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: 200 (OK)
Return Body:
{
"name" : "logical-cloud-1",
"logical-cloud-name" : "logical-cloud-1",
"namespace" : "ns-1",
"user" : "user-1"
}
|
...
Code Block |
---|
language | js |
---|
title | GET Logical Cloud |
---|
|
GET
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>
RESPONSE BODY:
{
"metadata" : {
"logical-cloud-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" : ["*"]
}
],
"clusters" : ["cluster-1", "cluster-2", "cluster-3]
}
}
}
|
...
Code Block |
---|
language | js |
---|
title | Update cluster in logical cloud |
---|
|
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/cluster-providers/<cluster-provider-name>/cluster-references/cluster-name
PUT BODY:
{
"loadbalancer-ip" : "0.0.0.0" //IP address of the istio loadbalancer for the logical cloud control plane in the cluster
}
Return Status: 200 (OK)
Return Body:
{
"cluster-name" : "cluster-1"
"loadbalancer-ip" : "0.0.0.0"
} |
...
Code Block |
---|
language | js |
---|
title | Get Clusters Associated with logical clouds |
---|
|
GET
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/cluster-providers/<cluster-provider-name>/cluster-references/
RESPONSE BODY:
{ cluster-references : [
{ "cluster-name" : "c1",
"loadbalancer-ip" : "0.0.0.0
},
{ "cluster-name" : "c2",
"loadbalancer-ip" : "x.x.x.x
}
]
}
|
...
Code Block |
---|
language | js |
---|
title | Delete Cluster from logical cloud |
---|
|
DELETE
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/cluster-providers/<cluster-provider-name>/cluster-references/<cluster-name>
RESPONSE STATUS: 204
}
|
...