Skip to content

Tutorial: Onboard Project and Teams on CNO

This tutorial will teach you how to onboard a new or existing project on CNO UI or CLI.

First, we will walk you through how to manage quota and members in a project. Then, we will show you how to create a new environment for a project.

Best-Practices First !

Sometimes, project owners need to fill in several tags to identify a project. With CNO, the super admin can define mandatory tags that the owners should fill in. In addition, the super admin can provide quota templates that owners can choose when creating a project.

Tags Settings

For this tutorial, let’s add four tags for the rest:

  • Department (required): to specify the department of the owner (in an organizational level);

  • Monitoring (required): to establish if the project needs monitoring;

  • PodNumber (required): to determine the number of pods;

  • Language (not required): to specify the programming language;

cnoctl adm create tag Department --type text --required 
cnoctl adm create tag Monitoring --type selection --value true,false --required 
cnoctl adm create tag PodNumber --type text --required 
cnoctl adm create tag Language --type selection --value Java,PHP,Go 

Quota Template Setting

 cnoctl adm create quota Small --cpu 500m,200m --memory 2Gi,1Gi --storage 20Gi 
 cnoctl adm create quota Medium --cpu 1,500m --memory 4Gi,2Gi --storage 50Gi 
 cnoctl adm create quota Large --cpu 4,2 --memory 8Gi,4Gi --storage 500Gi 
 cnoctl adm create quota Xlarge --cpu 16,8 --memory 32GI,16Gi --storage 1000Gi 

Mailing Account Setting

cnoctl adm create smtp --email example@gmail.com --smtp-password random23 --smtp-port 587 --smtp-server smtp.gmail.com

Adding Users To An Organization

Let's use the following command to create the users Alice and Bob. You must be a super admin.

cnoctl adm create user --firstname alice --lastname alice --email alice@gmail.com --username alice --department devops
cnoctl adm create user --firstname bob --lastname bob --email bob@gmail.com --username bob --department devops 

Onboarding A New Project with environments

For this tutorial, we will work with a project named my-first-project. You can create a project with the command:

cnoctl create project my-first-project --quota Large --tags Department=IT,PodNumber=5,Monitoring=false,Language=Go 

Adding An Environment To A Project

If you have resources in a project, for example my-first-project, you can create an environment.

You have two ways to onboard an environment on CNO:

a. By importing an existing namespace on a cluster with the command:

cnoctl onboard namespace <namespaceName> --project <projectName> [--quota <quotaName>] | [--cpu CPULimitValue,CPURequestValue --memory MemoryLimitValue,MemoryRequestValue --storage StorageValue]

b. Or by creating a new environment with the command:

cnoctl create environment <name> --project <projectName> --prod true|false --cluster <ClusterName>  --cpu CPULimitValue,CPURequestValue --memory MemoryLimitValue,MemoryRequestValue --storage StorageValue

Info

We can specify resources by using--cpu, --memory and --storage flags.

For this tutorial, we want to create two environments on the my-first-project project: prod and dev.

Let's create the dev environment

cnoctl create environment dev --project my-first-project --prod false --cluster default --cpu 2,1 --memory 3Gi,1.5Gi --storage 10Gi 

Then, let's create the prod environment

cnoctl create environment prod --project my-first-project --prod true --quota xlarge --cluster default 
Finally, run the following command to view my-first-project's environments.

cnoctl get env --project my-first-project 
NAME CPU LIMIT CPU REQUEST CPU USED MEMORY LIMIT MEMORY REQUEST MEMORY USED STORAGE STORAGE USED STATUS
prod 2 1 0% 3Gi 1.5Gi 0% 10Gi 0% Ready
dev 2 4 0% 4Gi 8Gi 30% 500Gi 0% Ready

Extending Project Resources

We can extend project resources by creating a new quota request. You can view pending quota requests on a project with the command:

cnoctl create quota-request my-first-project --cpu 3,1 --memory 3Gi,1Gi --storage 100Gi 

Warning

Quota requests need to be validated if you have no super admin or owner+ role.
If you are super_admin or owner+, requests will be automatically accepted; else, you must wait for validation.

Check the status of the new quota request with:

cnoctl get quota-request --project my-first-project 

Validation Of A New Quota Request To Extend Resources On A Project

If you are not super_admin or owner+ on the organization. The organization's validators must validate the Quota Requests.

Super_admin or an organization's validator can accept or reject a quota request with the following command.

cnoctl accept|reject request-quota <quota-request-id> --project projectName 

Adding Project Members

You can onboard a team on a project. Use the following command to add Alice as a developer and Bob as an admin on my-first-project.

cnoctl onboard add user alice --role developer --project my-first-project 
cnoctl onboard add user bob --role admin --project my-first-project 
cnoctl onboard get user --project my-first-project 

You can get team’s members and privileges for each member with the command:

cnoctl onboard get user --project my-first-project 

Last update: 2022-11-15