...
draw.io Diagram |
---|
border | true |
---|
viewerToolbar | true |
---|
| |
---|
fitWindow | false |
---|
diagramDisplayName | |
---|
lbox | true |
---|
revision | 1013 |
---|
diagramName | DCM |
---|
simpleViewer | false |
---|
width | 1000 |
---|
links | auto |
---|
tbstyle | top |
---|
diagramWidth | 1131721 |
---|
|
Fig 1: DCM Components
Sample DCM DB tables
...
Code Block |
---|
language | js |
---|
title | Associate logical cloud with cluster |
---|
|
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/cluster-references/
POST BODY:
{
"metadata" : {
"name": "cluster-reference-1name", //name of the cluster reference record
"description
}
Return Status: 200 (OK)
Return Body:
{
"name" : "edge a cluster", //cluster description
}cluster-reference-1",
spec : {
"cluster-name" : "cluster-1" //Name of the cluster
}
}
Return Status: 200 (OK)
Return Body:
{
"name" : "cluster-reference-1",
"cluster-name" : "cluster-1"
}
|
5. GET Logical Cloud
Code Block |
---|
language | js |
---|
title | GET Logical Cloud |
---|
|
GET
URL: /v2/projects/<project-name>/logical-clouds/<name>
RESPONSE BODY:
{
"logical-cloud-namemetadata" : "logical-cloud-1",{
"namespacename" : "nslc-1", //unique name for onethe namespacerecord
per logical cloud
"description": "logical cloud for walmart finance department", //description for the logical cloud
"user" : {
"user-nameuserData1" :"<user data>"user-1",
//name of user for this cloud "userData2":"<user data>"
},
"typespec" : "certificate", {
"namespace" : "ns-1", //type ofone authenticationnamespace credentialsper used by user (certificate, Token, UNPW)
"user-permissionslogical cloud
"user" : [{
{ "permissionuser-name" : "permissionuser-1",
//name of user for this cloud "apiGroups" : ["stable.example.com"],
(username and logical cloud name would be used as subject for the user key)
"resourcestype" : ["secretscertificate", "pods"],
//type of authentication credentials used by "verbs" : ["get", "watch", "list", "create"]
},user (certificate, Token, UNPW)
"user-permissions" : [
{ "permission-name" : "permission-21",
"apiGroups" : ["stable.example.com"],
"resources" : ["configmaps"secrets", "pods"],
"verbs" : ["*get", "watch", "list", "create"]
},
]
"clusters" :{ ["clusterpermission-1name", : "clusterpermission-2", "cluster-3]
}
}
"apiGroups" : [""],
"resources" : ["configmaps"],
"verbs" : ["*"]
}
],
"clusters" : ["cluster-1", "cluster-2", "cluster-3]
}
}
}
|
6. DELETE Logical Cloud
Code Block |
---|
language | js |
---|
title | DELETE Logical Cloud |
---|
|
DELETE
URL: /v2/projects/<project-name>/logical-clouds/<name>
RESPONSE STATUS: 204
|
7. Add user permissions
Code Block |
---|
language | js |
---|
title | Add User permissions |
---|
|
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/user-permissions
POST BODY:
{ "name" : "permission-3",
"apiGroups" : [""],
"resources" : ["jobs"],
"verbs" : ["list"]
}
Return Status: 200 (OK)
Return Body:
{ "name" : "permission-3",
"apiGroups" : [""],
"resources" : ["jobs"],
"verbs" : ["list"]
}
|
8. GET User Permissions
Code Block |
---|
language | js |
---|
title | Get User permissions |
---|
|
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/user-permissions
GET:
Return Body:
{"permissions" : [
{ "name" : "permission-1",
"apiGroups" : ["stable.example.com"],
"resources" : ["secrets", "pods"],
"verbs" : ["get", "watch", "list", "create"]
},
{ "name" : "permission-2",
"apiGroups" : [""],
"resources" : ["configmaps"],
"verbs" : ["*"]
},
{ "name" : "permission-3",
"apiGroups" : [""],
"resources" : ["jobs"],
"verbs" : ["list"]
}
]
}
|
9. PUT (Update User permissions)
Code Block |
---|
language | js |
---|
title | Update User permissions |
---|
|
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/user-permissions/permission-3
POST BODY:
{
"apiGroups" : [""],
"resources" : ["pvc"],
"verbs" : ["list"]
}
Return Status: 200 (OK)
Return Body:
{ "name" : "permission-3",
"apiGroups" : [""],
"resources" : ["pvc"],
"verbs" : ["list"]
}
|
10. Delete Permissions6. DELETE Logical Cloud
Code Block |
---|
language | js |
---|
title | DELETE Logical CloudDelete User permissions |
---|
|
DELETE
URL: /v2/projects/<project-name>/logical-clouds/<name>
RESPONSE/<logical-cloud-name>/user-permissions/<permission-name>
RETURN STATUS: 204
|
...
11. Create logical cloud Quota ( quota will be applied to each cluster in the logical cloud)
This allows resources to be tuned for the logical cloud
Code Block |
---|
language | js |
---|
title | Add User permissionsCreate Logical cloud quota |
---|
|
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/usercluster-permissionsquotas
POST BODY:
BODY:
{
"metadata" : {
{ "name" : "permissionquota-31",
"apiGroups" : [""],
"resourcesdescription" : ["jobsdesc"],
"verbs" : ["list"]
},
Return Status: 200 (OK)
Return Body:
{ "name" : "permission-3",
"apiGroups" : [""],
"resources" : ["jobs"],
"verbs" : ["list"]
}
"spec" : {
"cpu": "400",
"memory": "1000Gi",
"pods": "500"
}
}
RETURN STATUS: 201 |
12. GET logical cloud Quota8. GET User Permissions
Code Block |
---|
language | js |
---|
title | Get User permissionsLogical cloud quota |
---|
|
GET
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/user-permissions
GET:
Return Body: cluster-quotas/<quota-name>
RETURN BODY:
{
{"permissionsmetadata" : [{
{ "name" : "permissionquota-1",
"apiGroupsdescription" : ["stable.example.com"],desc"
},
"resourcesspec" : ["secrets", "pods"],{
"verbscpu" : ["get400", "watch", "list", "create"]
}"memory": "1000Gi",
{ "namepods" : "permission-2500",
} "apiGroups" : [""],
}
|
13. Update Logical Cloud Quota
Code Block |
---|
language | js |
---|
title | Update Logical cloud quota |
---|
|
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/cluster-quotas/<quota-name>
PUT BODY:
{
"resourcesmetadata" : ["configmaps"],{
"verbsdescription" : ["*desc"]
},
{ "namespec" : "permission-3",{
"apiGroupscpu" : ["400"],
"resourcesmemory" : ["jobs1000Gi"],
"verbspods" : ["list500"]
}
]
}
RETURN STATUS: 201 |
14. POST (Apply all the created configuration, this creates the K8s resources9. PUT (Update User permissions)
Code Block |
---|
language | js |
---|
title | Update User permissionsApply configuration |
---|
|
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/user-permissions/permission-3
POST BODY:
{
"apiGroups" : [""],
"resourcesapply
Return Status: 200 (OK)
Return Body:
{
"logical-cloud-name" : ["pvclogical-cloud-1"],
"verbsnamespace" : ["list"]
}
Return Status: 200 (OK)
Return Body:
{ "name" : "permission-3",
"apiGroups" : [""],
"resources" : ["pvc"],
"verbsns-1", // one namespace per logical cloud
"description": "logical cloud for walmart finance department", //description for the logical cloud
"user" : "user-1",
"clusters" : ["list"]
}
|
10. Delete Permissions
Code Block |
---|
language | js |
---|
title | Delete User permissions |
---|
|
DELETE
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/user-permissions/<permission-name>
RETURN STATUS: 204
|
11. Create logical cloud Quota ( quota will be applied to each cluster in the logical cloud)
cluster1", "cluster2", "cluster3"]
"quota-name" : "quota-1"
}
|
15. GET (Check status of operation)This allows resources to be tuned for the logical cloud
Code Block |
---|
language | js |
---|
title | Create Logical cloud quotaGet Operation status |
---|
|
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/cluster-quotasstatus
POSTGET BODY:
{GET
"metadata" Return Status: {201
Return "name" : "quota-1",
"description": "desc"
},
"spec" : Body :
{
"cpuname" : "400logical-cloud-1",
"memoryuser" : "1000Giuser-1",
"podsstatus": "500"
Creation in Progress " }//Created, Creation Failed
}
RETURN STATUS: 201 |
...
16. Add Key Value pair to logical cloud database
Code Block |
---|
language | js |
---|
title | Get Logical cloud quota | Add KV pair |
---|
|
GET
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/cluster-quotas/<quota-name>
RETURNkv-pairs
POST BODY:
{
"metadata" : {
"name" : "quota-1<name>",
"description":"<description>",
"desc""userData1":"<user data>",
"userData2":"<user data>"
},
"spec" : {
"cpukv": "400",
[
{
"memory": "1000Gi",
"podskey1": "500val1"
}
}
|
13. Update Logical Cloud Quota
Code Block |
---|
language | js |
---|
title | Update Logical cloud quota |
---|
|
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/cluster-quotas/<quota-name>
PUT BODY:
,
{
"metadata" : {
"namekey2" : "quota-1val2",
"description": "desc"
}
]
},
}
}
RETURN STATUS: 201
RETURN BODY:
{
"specmetadata" : {
"cpuname": "400<name>",
"memorydescription": "1000Gi<description>",
"podsuserData1":"<user data>"500",
} "userData2":"<user
}
RETURN STATUS: 201 |
14. POST (Apply all the created configuration, this creates the K8s resources)
Code Block |
---|
language | js |
---|
title | Apply configuration |
---|
|
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/apply
Return Status: 200 (OK)
Return Body:
{
"logical-cloud-name" : "logical-cloud-1",
"namespace" : "ns-1", // one namespace per logical cloud
"description": "logical cloud for walmart finance department", //description for the logical cloud
"user" : "user-1",
}
|
15. GET (Check status of operation)
Code Block |
---|
language | js |
---|
title | Get Operation status |
---|
|
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/status
GET BODY:
GET
Return Status: 201
Return Body :
{
"name" : "logical-cloud-1"
"user" : "user-1",
"status": "Creation in Progress " //Created, Creation Failed
} |
data>"
},
"spec":{
"kv":[
{
"key1":"val1"
},
{
"key2":"val2"
}
]
}
} |
17. PUT (Update kv pair)16. Add Key Value pair to logical cloud database
Code Block |
---|
language | js |
---|
title | Add Update KV pair |
---|
|
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/kv-pairs/<name>
POSTPUT BODY
{
"namemetadata":{
: "<name>",
"description" : "<description>",
"kvuserData1":[
{
"<user data>",
"key1userData2":"val1<user data>"
},
"spec":{
"kv":[
"key2":"val2"
}{
]
}
RETURN STATUS: 201
RETURN BODY:
{
"namekey1" : "<name>val3",
"description" : "<description>" },
"kv":[
{
"key1key2":"val1val4"
}, }
]
}
}
RETURN STATUS: 201
RETURN BODY:
{
"metadata":{
"key2description":"val2"
}
]
} |
17. PUT (Update kv pair)
Code Block |
---|
language | js |
---|
title | Update KV pair |
---|
|
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/kv-pairs/<name>
PUT BODY
{
"description" : "<description>",
<description>",
"userData1":"<user data>",
"userData2":"<user data>"
},
"spec":{
"kv":[
{
"key1":"val3"
},
{
"key2":"val4"
}
]
}
RETURN STATUS: 201
RETURN BODY:}
{
]
"key1":"val10"}
} |
18. GET KV pair
Code Block |
---|
language | js |
---|
title | Get KV pair |
---|
|
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/kv-pairs/<name>
RETURN STATUS: 200
RETURN BODY:
{
RETURN STATUS: 200
RETURN BODY:
{
"metadata":{
"name":"<name>",
"description":"<description>",
"nameuserData1" :"<user "<name>data>",
"description" : "<description>","userData2":"<user data>"
},
"spec":{
"kv":[
{
"key1":"val1"
},
{
"key2":"val2"
}
]
}
} |
19. DELETE KV pair
Code Block |
---|
language | js |
---|
title | Delete KV pair |
---|
|
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/kv-pairs/<name>
RETURN STATUS: 204
|
...