Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Main DCM Microservice (contains the service mesh controller Module(formally Logical Cloud Controller), User Controller Module and Namespace ControllerModule, Quota Controller Module(Limits resources available to each logical cloud))
  2. CA Key Distribution Controller Generate intermediate CA key for each edge which is signed by an root or intermediate key)

...

Drawio
bordertrue
viewerToolbartrue
fitWindowfalse
diagramDisplayName
lboxtrue
revision1417
diagramNameDCM
simpleViewerfalse
width1000
linksauto
tbstyletop
diagramWidth721

Fig 1: DCM ComponentsSample


DCM

...

Image Removed

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

...

Sequence

  1. 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
  2. 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
  3. Add quota for logical cloud
    • The quota module creates a quota document containing the quota details
  4. 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
  5. DCM informs the resource synchronizer to start the logical cloud creation via gRPC and the resource synchronizer starts reading from the DB
  6. The DCM gets status from the resource synchronizer via gRPC
  7.  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

dcm
├── core
│      └── main.go
├── namespace-controller
│      └── namespace.go
├── quota-controller
│      └── quota.go
├── service-mesh-controller
│      └── service-mesh.go
└── user-controller
        └── user.go

GO API

Code Block
languagepy
func createNamespace(logicalCloudName Namespace string)  error  //Stores the namespace for the logical cloud in the database

func createUser(user logicalCloudName string permissions []map[string]map[string][]string) error //Stores the user details for the logical cloud in the database

func createKVpair(name description string userData map[string]string kvPair []map[string]string) error  //Stores a new key value pair in the database

func addCluster(cluster logicalCloudName string) error //Associates a new cluster with the logical cloud

func addUserPermissions(user permissionName string apiGroups resources verbs []string) error

func applyConfig(logicalCloudName string) error //Talks to the Resource Synchronizer to start the actual creation of all the resources for the logical cloud

func getKVPair(name string) ([]map[string]string error)

func getClusterConfig(cluster logicalCloudName string) ([]byte, error) // Add return type
Returns Kubeconfig for the cluster in JSON format

func getNamespace(logicalCloudName string) (string error)

func getUser(logicalCloudName string) (string error)

func getClusters(logicalCloudName string) ([]string error)

func getUserPermissions(user string) (([]map[string]map[string][]string)  error) //Sample output [{"permission-1": {"apiGroups": ["stable.example.com"], "resources" : ["secrets", "pods"], "verbs" : ["get", "watch", "list", "create"] }}, 
                                                                                              {"permission-2": {"apiGroups": [""], "resources" : ["configmaps"], "verbs" : ["*"] }}]


...


Service Mesh API

1.  Create Logical Cloud

Code Block
languagejsvb
titleLogical Cloud Creation Service Mesh API
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"]
       },
func create_mesh () {

    func get_lc_clusters() (map[string]string) //Returns a map containing a mapping of cluster names to load balancer ip address
	func create_mesh_namespace(logical-cloud-name, []clusters)

	func create_ca_secrets(logical-cloud-name){
		func get_ca_certs(url)
	}

	func install_helm([] clusters) (or install istioctl)
	func create_helm_chart() (or istioctl manifest)
}


REST API

API to Create Logical Cloud Name and Associate some components

Create Logical cloud  name for new logical cloud, add user name, namespace and user permissions

Code Block
languagejs
titleLogical Cloud Creation API
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-21",
         "apiGroups" : ["stable.example.com"],
         "resources" : ["configmaps"secrets", "pods"],
         "verbs" : ["*get"], "watch", "list", "create"]
       },
    ]   }{ "permission-name" }
}: "permission-2",
 Return Status: 201 Return Body: {   "nameapiGroups" : ["logical-cloud-1"],
  "logical-cloud-name       "resources" : ["logical-cloud-1configmaps"],
  "namespace"   : "ns-1",   "user-nameverbs" : ["user-1*"
}

Important points to Note

  • cluster CA and cluster CRT will be gotten when a cluster is registered and this will be used to create the user crt after the user csr and user key are created

Kubeconfig will be put in the mongoDB

2.  Get Logical Cloud kubeconfig

Code Block
languagejs
titleGet Logical cloud kubeconfig
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/kubeconfig?cluster-reference=cluster-1
GET
Return Status: 201
Return Body :
  {
    "apiVersion": "v1",
    "clusters": []
       }
    ]
  }
 }
}

Return Status: 201
Return Body:
{
  "name" : "logical-cloud-1",
  "logical-cloud-name" : "logical-cloud-1",
  "namespace" : "ns-1",
  "user-name" : "user-1"
}

PUT (Change logical cloud contents)

Code Block
languagejs
titlePUT Logical Cloud
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>
PUT BODY:
{
 "metadata" : {
	"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"
}


GET Logical Cloud

Code Block
languagejs
titleGET Logical Cloud
GET
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>
RESPONSE 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" : [""],
         "clusterresources" : {
      ["configmaps"],
         "certificate-authority-dataverbs" : ["LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVn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idkZaUGFDRlpPMlkvS0dpcFpYM3o0R3hiR0sxM3VweExuSllHZEI4eFBrRApmK3FISFYvMHVVV2Yzb2JpSUNTT09qUjF5VnB3eXdIVFcrTHhyM1BZcXQ5b0NTRXErYitPUDE2SVV5az0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=*",]
       }
    ],
    "serverclusters" : "https://1.2.3.4:6443"
["cluster-1", "cluster-2", "cluster-3]
  }
 }
}
  

DELETE Logical Cloud

Code Block
languagejs
titleDELETE Logical Cloud
DELETE
 },
            URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>

Logical Cloud Cluster API

 POST (Associate cluster with logical cloud )

Code Block
languagejs
titleAssociate logical cloud with cluster
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/cluster-references/
POST BODY:
{
 "metadata" : {
 	"name": "kuberneteslc-cl-1",
        }
    ]"description": "desc",
    "contextsuserData1": [
        {
       "<user data>",
    "contextuserData2":"<user {data>"
   },

 "spec" :         {
	"cluster-provider": "clustercp-1",
	"cluster-name": "c1", //name of the cluster,
	"loadbalancer-ip" : "0.0.0.0"  //IP address of the istio loadbalancer for "user": "user-1"
     the logical cloud control plane in the cluster
  }
}


},
 
}
Return Status: 200 (OK)
Return Body:
{
  "cluster-name" : "usercluster-1-context"
  "loadbalancer-ip" :     }
    ],
    "current-context": "user-1-context",
    "kind": "Config",
    "users": [
        {
            "name": "user-1",
            "user": {
                "client-certificate-data" : "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM4akNDQWRxZ0F3SUJBZ0lJZVovY05tQVE5NGd3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TURBeE1UWXlNalUwTWpKYUZ3MHlNVEF4TVRVeU1qVTBNamhhTURReApGekFWQmdOVkJBb1REbk41YzNSbGJUcHRZWE4wWlhKek1Sa3dGd1lEVlFRREV4QnJkV0psY201bGRH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Y0NwbGtRK1VFZXNmTlcrWjdiWWtocng2Z2l6eCtjY0UKS3FhNTRxTmJkQVdLQXRzSU5lZ3pQU0toV0g0eXFnaWYrNmQ1aVVZUlFoUUhNVG0yTHpEQ2xGQ001N2FPdmQ3YQpNUEZxR3BNV2tqVmlnZjlwdHV3YW1qWkYwbm5MUVE5dWIzMlB3Zjk0Yzl4NFBEdkpmdTQrUHc9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo="
            }
        }
    ]
}

...

"0.0.0.0"
}


PUT

Code Block
languagejs
titleUpdate cluster in logical cloud
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-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"
   
}

GET

Code Block
languagejs
titlePUT Logical CloudGet Clusters Associated with logical clouds
GET
URL: /v2/projects/<project-name>/logical-clouds/<name>
PUT/<logical-cloud-name>/cluster-references/

RESPONSE BODY:
{  "metadata" cluster-references : {[
   { "descriptioncluster-name" : "logicalc1",
cloud for walmart finance department"loadbalancer-ip",  //description for the logical cloud: "0.0.0.0
   },
    { "userData1cluster-name" : "<user data>c2",
    "userData2loadbalancer-ip" :"<user data>"
"x.x.x.x
  },
]
"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-}

DELETE (Delete cluster from Logical cloud)

Code Block
languagejs
titleDelete Cluster from logical cloud
DELETE
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/cluster-references/<cluster-name>
RESPONSE STATUS: 204
}

Logical Cloud User Permissions API

 Add user permissions

Code Block
languagejs
titleAdd 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-13",
  "apiGroups" :  [""],
   "apiGroupsresources" : ["stable.example.comjobs"],
  "verbs" : ["list"]
}
 
 "resources" : ["secrets", "pods"],


GET User Permissions

Code Block
languagejs
titleGet User permissions
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/user-permissions
GET:
Return Body:      
   {"verbspermissions" : ["get", "watch", "list",
"create"]        },
       { "permission-name" : "permission-21",
         "apiGroups" : ["stable.example.com"],
         "resources" : ["configmapssecrets", "pods"],
         "verbs" : ["*get"],        }
 "watch", "list", "create"]
  ]   }  },
}  Return Status: 200 (OK) Return Body: {   "name" : "logicalpermission-cloud-12",
         "logical-cloud-nameapiGroups" : ["logical-cloud-1"],
   "namespace      "resources" : ["ns-1configmaps"],
  "user       "verbs" : ["user-1"
}

4. POST (Associate cluster with logical cloud )

Code Block
languagejs
titleAssociate logical cloud with cluster
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/cluster-references/
POST BODY:
{

 "cluster-reference": "cluster-name" //name of the cluster
 
}
Return Status: 200 (OK)
Return Body:
{
  "name" : "cluster-reference-1",
  "cluster-name" : "cluster-1"
}

...

*"]
       },
       { "name" : "permission-3",
         "apiGroups" : [""],
         "resources" : ["jobs"],
         "verbs" : ["list"]
       }
    ]
}


PUT (Update User permissions)

GET
Code Block
languagejs
titleGET Logical Cloud
Update User permissions
URL: /v2/projects/<project-name>/logical-clouds/<name>
RESPONSE 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/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"]
}
 

 Delete User Permissions

Code Block
languagejs
titleDelete User permissions
DELETE
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/user-permissions/<permission-name>
RETURN STATUS: 204


Logical Cloud Quota API

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
languagejs
titleCreate Logical cloud quota
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/cluster-quotas
POST BODY:
{
    "metadata" : {
      "name" : "quota-1",
      "description": "desc"
     },
    "spec" : {
      "limits.cpu": "400",
         "apiGroups" "limits.memory": ["stable.example.com1000Gi"],
      "requests.cpu": "300",
 "resources" : ["secrets", "pods"],
       "requests.memory": "900Gi",
      "verbsrequests.storage" : ["get", "watch", "list", "create"]"500Gi",
       },
"requests.ephemeral-storage": "",
      { "permissionlimits.ephemeral-namestorage" : "permission-2",
         "apiGroupspersistentvolumeclaims" : [" "],
  
      "resourcespods" : ["configmaps500"], 
        "verbsconfigmaps" : ["*"],
       }
"replicationcontrollers": "",
   ],     "clustersresourcequotas" : ["cluster-1",
"cluster-2", "cluster-3]   }  }
}"services": "",
   

6. DELETE Logical Cloud

Code Block
languagejs
titleDELETE Logical Cloud
DELETE URL: /v2/projects/<project-name>/logical-clouds/<name> RESPONSE STATUS: 204

7. Add user permissions

Code Block
languagejs
titleAdd User permissions
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/user-permissions
POST BODY: "services.loadbalancers" : "",
      "services.nodeports" : "",
   {   "namesecrets" : "permission-3",
      "apiGroupscount/replicationcontrollers" : [""],
  "resources    "count/deployments.apps" : ["jobs"],
      "verbscount/replicasets.apps" : ["list"],
}      "count/statefulsets.apps" : 
Return Status: 200 (OK)
Return Body:
{ "name"",
      "count/jobs.batch" : "permission-3",
  "apiGroups    "count/cronjobs.batch" : [""],
      "resourcescount/deployments.extensions" : ["jobs"],
"
    }  "verbs" : ["list"]
}

RETURN STATUS: 

...

201


 GET logical cloud Quota

Code Block
languagejs
titleGet User permissionsLogical cloud quota
GET
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/cluster-quotas/user<quota-permissionsname>
GET:
Return BodyRETURN BODY:
{
    
{"permissionsmetadata" : [
 {
     { "name" : "permissionquota-1",
         "apiGroupsdescription" : ["stable.example.com"],desc"
     },
    "resourcesspec" : ["secrets", "pods"],
         "verbs" : ["get", "watch", "list", "create"]{
      "cpu": "400",
       },
 "memory": "1000Gi",
     { "namepods" : "permission-2",500"
    }    
}


Update Logical Cloud Quota

Code Block
languagejs
titleUpdate Logical cloud quota
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/cluster-quotas/<quota-name>
   "apiGroups" : [""],PUT BODY:
{
         "resourcesmetadata" : ["configmaps"],
  {
      "verbsdescription" : ["*desc"]
       },
       { "namespec" : "permission-3",
  {
      "apiGroupscpu" : ["400"],
         "resourcesmemory" : ["jobs1000Gi"],
         "verbspods" : ["list500"]
    }    
}

RETURN STATUS: 201


Delete Logical Cloud Quota

Code Block
languagejs
titleUpdate Logical cloud quota
DELETE
 ]
}

...

URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/cluster-quotas/<quota-name>

RETURN STATUS: 204


Logical Cloud Key Value API

16. Add Key Value pair to logical cloud database

Code Block
languagejs
titleUpdate User permissionsAdd KV pair
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/user-permissions/permission-3kv-pairs
POST BODY:
  {
    
{
  "apiGroups" : [""],
  "resources" : ["pvc"],"metadata":{
      "verbsname" : ["list"]
}
       
Return Status: 200 (OK)
Return Body:
{ "name" : "permission-3",<name>",
      "apiGroupsdescription" : ["<description>"],
      "resourcesuserData1" :"<user ["pvcdata>"],
      "verbsuserData2" :"<user ["listdata>"]
}   

10. Delete Permissions

Code Block
languagejs
titleDelete 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)

This allows resources to be tuned for the logical cloud

Code Block
languagejs
titleCreate Logical cloud quota
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/cluster-quotas
POST BODY:
{},
   "spec":{
      "kv":[
       "metadata" : {
            "namekey1" : "quota-1"val1"
         },
      "description   {
            "key2": "descval2"
     },    }
      ]
   }
 "spec" }
 
RETURN STATUS: {201
RETURN BODY:
{
   "cpumetadata":{
"400",       "memoryname": "1000Gi<name>",
      "podsdescription": "500"
    }    
}

RETURN STATUS: 201

12. GET logical cloud Quota

Code Block
languagejs
titleGet Logical cloud quota
GET
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/cluster-quotas/<quota-name>
RETURN BODY:
{<description>",
      "userData1":"<user data>",
      "userData2"metadata:"<user :data>"
{   },
   "namespec" ::{
      "quota-1",kv":[
         {
            "descriptionkey1": "descval1"
         },
    "spec" : {    {
  "cpu": "400",          "memorykey2": "1000Gival2",
         "pods": "500"}
     } ]
   }
}

...


17.

...

PUT (Update kv pair)

Code Block
languagejs
titleUpdate Logical cloud quotaKV pair
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/clusterkv-quotaspairs/<quota<kv-pair-name>
PUT BODY:
{
    "metadata"
: {
      "description": "desc"
     },

   "specmetadata" : {
      "cpudescription": "400<description>",
      "memoryuserData1":"<user "1000Gidata>",
      "podsuserData2":"<user "500data>"
    },
   
}

RETURN STATUS: 201

14.  POST (Apply all the created configuration, this creates the K8s resources)

Code Block
languagejs
titleApply 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",
 "clusters" : ["cluster1", "cluster2", "cluster3"]
 "quota-name" : "quota-1"
}


15. GET (Check status of operation)

Code Block
languagejs
titleGet Operation status
GET
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/status
GET BODY:

Return Body :
{
  "metadata" : {
     "name" : "logical-cloud-1""spec":{
      "kv":[
         {
            "key1":"val3"
         },
         {
            "key2":"val4"
         }
      ]
   }
}
RETURN STATUS: 201
RETURN BODY:
{
   "metadata":{
      "description" : "<description>",
   }   
  "clusters" : ["userData1":"<user data>",
      "cluster-1userData2" :"<user {data>"
   },
   "namespace-statusspec" :{
"<status>",        "role-statuskv":[
: "<status>",        "role-binding-status" : "<status>"{
       }     "cluster-2" : {"key1":"val3"
         },
 "namespace-status"  : "<status>",     {
  "role-status" : "<status>",        "role-binding-statuskey2" : "<status>val4"
     }    ],}
  "status": "Creation in Progress "]
//Created, Creation Failed }
}


16. Add Key Value pair to logical cloud database18. GET KV pair

Code Block
languagejs
titleAdd Get KV pair
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/kv-pairs
POST/<kv-pair-name>

RETURN STATUS: 200
RETURN BODY:
{
   "metadata":{
      "name":"<name>",
      "description":"<description>",
      "userData1":"<user data>",
      "userData2":"<user data>", data>"
   },
   "spec":{
      "kv":[
         {
            "userData2key1":"<user data>"val1"
         },
   "spec":      {
      "kv":[      "key2":"val2"
   {      }
      "key1":"val1"]
   }
}


19. DELETE KV pair

Code Block
languagejs
titleDelete KV pair
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/kv-pairs/<kv-pair-name>

RETURN STATUS: },
         {
            "key2":"val2"
         }
      ]
   }
}
 
RETURN STATUS: 201
RETURN BODY:
{
   "metadata":{
 204

Kubeconfig API (WORK IN PROGRESS)

Important points to Note

  • cluster CA and cluster CRT will be gotten when a cluster is registered and this will be used to create the user crt after the user csr and user key are created

Kubeconfig will be put in the mongoDB

2.  Get Logical Cloud kubeconfig

Code Block
languagejs
titleGet Logical cloud kubeconfig
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/kubeconfig?cluster-reference=cluster-1
GET
Return Status: 201
Return Body :
  {
    "nameapiVersion": "<name>v1",
      "descriptionclusters":"<description>", [
     "userData1":"<user data>",  {
    "userData2":"<user data>"    },    "speccluster": {
      "kv":[          {
   "certificate-authority-data": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJd01ERXhOakl5TlRReU1sb1hEVE13TURFeE16SXlOVFF5TWxvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTXZ5ClpSMmtHZ201OHJtRUYxZ0VVNDlwR281TjR5WlZzbUtsemJxeitHcmp3MWY4ZHBaa01JN1RYbm1xaXdjbmpiZksKdlZDYmFKblBwRm9Wc0gyMTFMRVYxa1pqQ2RZakgrQnA4VUNadFpOZnJha1o1TU91RW40MXlpbDRxVTFxRnBYcgpvMnAvTTJNSTc0bzdYSis5V2VUNmZ1MFJ0RjRjK1p6K3IzbWY3YWFnem9weEo1TzcyN010WkN5bzJHaWNJdzgyCk1uSmUrbHBnNDdEdTNwK0JzOVZ4cENNVjhUTFBDWWFxVUZHZWZ1U25zTHpCOWFHUGJaMi9kWlMrQll6VGJ1dWIKZ0pzbmxKd1o2Z1orVkJKWGtxcFN4ZmJTWFE3V2VLR1BkMkptYk04THFtd2UxcEtIMnNnVEs0cnBuM3dKdzk1Uwp5c01LZWp5aS9TcmZWci9ZdmRNQ0F3RUFBYU1qTUNFd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0RRWUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFIRkJ3VUJrRE56MDV3cGlVVkhaeld3Z0JWWTgKTFRIV2RZYUliaTZzeCthTUhIOFF3cERhSUIvME9KUlZmc01XNXd2eldTWE05d28zR2ltMlYxNnBsN0E3ZXRkLwo3OWZiT0FaTTh0bUFHMVlraFlJbjc0NzRvaE5GZjhLdjFqY3ZIUStIREZZRTRHdTBXUXhBQU9sRmh2SUNKc1VDCmRrN25mREpMRTIwa1E0M1ZIMnc3Ukg3clFVcUVNVnhVU2VTTWdid0xEQms5bWFQNm83RjdsT0ZqQnJibmhaVlgKNDA3U3Z2aTFRM0x6eCtubklhY3RidkZaUGFDRlpPMlkvS0dpcFpYM3o0R3hiR0sxM3VweExuSllHZEI4eFBrRApmK3FISFYvMHVVV2Yzb2JpSUNTT09qUjF5VnB3eXdIVFcrTHhyM1BZcXQ5b0NTRXErYitPUDE2SVV5az0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=",
        "key1":"val1"        "server": "https://1.2.3.4:6443"
  },          {},
            "key2name": "val2kubernetes"

        }
    ],
 ]   "contexts": }
}

17. PUT (Update kv pair)

Code Block
languagejs
titleUpdate KV pair
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/kv-pairs/<name>
PUT BODY
{
   "metadata":{[
        {
            "context": {
                "descriptioncluster": "<description>cluster-1",
      "userData1":"<user data>",          "user": "user-1"
       "userData2":"<user data>"    },
    "spec":{        "kv":[name": "user-1-context"
        }
{    ],
        "key1"current-context": "val3user-1-context",
    "kind": "Config",
   },
 "users": [
        {
            "key2name": "val4"user-1",
            "user": {
   }       ]    } }
RETURN STATUS: 201
RETURN BODY:
{
   "metadata":{ "client-certificate-data" : "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM4akNDQW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enRBdk4KeUk0NytqTlRNcWNWcVg3Q2hPYlEwd2dwTG5KcUxUVWR3RVhCRVN2RFdlSnlWOU5IU0F5NEJydWM5MVJqTExaUAo1L1hJMDJkQ2t5QzIrN3p2M1JqajlqUG1DOVRxTm1wMmpqVHh6TUQxZVJGRzQ4dnQyM2l5cm9yWkRRU0U5MkNzCmNDOC9Bd0tCZ1FDamRrVTNOcWFPZHUzMlpkWm5IK0cxY0NwbGtRK1VFZXNmTlcrWjdiWWtocng2Z2l6eCtjY0UKS3FhNTRxTmJkQVdLQXRzSU5lZ3pQU0toV0g0eXFnaWYrNmQ1aVVZUlFoUUhNVG0yTHpEQ2xGQ001N2FPdmQ3YQpNUEZxR3BNV2tqVmlnZjlwdHV3YW1qWkYwbm5MUVE5dWIzMlB3Zjk0Yzl4NFBEdkpmdTQrUHc9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo="
      "description":"<description>",      }
"userData1":"<user data>",       "userData2":"<user data>"}
    },
   "spec":{
      "kv":[
         {
            "key1":"val3"
         },
         {
            "key2":"val4"
         }
      ]
   }
}

...

]
}



Apply API

When the API is called, the resource synchronizer is called  and the resource creation in the cluster begins

Apply all the created configuration, this creates the K8s resources

Code Block
languagejs
titleApply 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",
 "clusters" : ["cluster1", "cluster2", "cluster3"]
 "quota-name" : "quota-1"
}



Status API

GET (Check status of operation)

Code Block
languagejs
titleGet KV pairOperation status
GET
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/kv-pairs/<name>

RETURN STATUS: 200
RETURN BODYstatus
GET BODY:

Return Body :
{
  "metadata" : {
     "metadataname" :{ "logical-cloud-1"
     "namedescription" : "<name><description>",
   }
  
  "descriptionclusters" :"<description>", [
    "cluster-1" : {
       "userData1namespace-status" : "<user data><status>",
       "userData2role-status" : "<user data><status>",
   },    "specrole-binding-status" :{ "<status>"
     "kv":[  
     }
 {   "cluster-2" : {
       "key1namespace-status" : "val1<status>",
       "role-status" : }"<status>",
         {
   "role-binding-status" : "<status>"
        "key2control-plane-status" : "val2<status>"
         }
   ],
  ]
   }
}

19. DELETE KV pair

Code Block
languagejs
titleDelete KV pair
URL: /v2/projects/<project-name>/logical-clouds/<logical-cloud-name>/kv-pairs/<name>

RETURN STATUS: 204
"status": "Creation in Progress " //Created, Creation Failed 
}