Onboard projects and teams

In this tutorial, you will learn how to onboard a new or existing project on CNO UI or CLI. We will walk through how to manage quota and members in a project.
We will show you how to create a new environment on a project.

Before to begin

Sometimes you need the project owner to fill in a number of tags to identify the project. For this, the super admin must define the mandatory tags that the owners must fill in. The super admin can also provide quota templates that owners can choose when creating a project.

  • Tags settings

    For this tutorial, We add four tags for the rest:
    • Department (required): to specify the the department of the owner

                      cnoctl adm create tag Department --type text --required
                    
    • Monitoring (required): to specify if the project needs to be monitored

                      cnoctl adm create tag Monitoring --type selection --value true,false --required
                    
    • PodNumber (required): to specify the number of pods

                      cnoctl adm create tag PodNumber --type text --required
                    
    • Language (not required): to specify the programming language

                      cnoctl adm create tag Language --type selection --value Java,PHP,Go
                    
  • Quota template setting

    For this tutorial, We add four quotas for the rest:

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

    Use the following command to create the users alice and bob. You must be a super administrator.

                    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
                  

Onboard a new project

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

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

Add a environment on project

If you have resources in a project my-first-project, you can create an environment. You have two ways to onboard an environment on CNO.

  • By importing an existing namespace on a cluster with this command:

                    cnoctl onboard <namespace> --project <projectName> [--quota <quotaName>] | [--cpu CPULimitValue,CPURequestValue --memory MemoryLimitValue,MemoryRequestValue --storage StorageValue]
                  
  • Or creating new environment with the following command

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

    NB: We can specify resource by --quota flag or by --cpu, --memory and --storage flags

For this tutorial we have to create to environments prod and dev on my-first-project project

  • 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
                  
  • let's create the prod environment

                    cnoctl create environment prod --project my-first-project --prod true --quota xlarge --cluster default
                  

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

Extend project resources

We can extend project resources by creating a new quotaRequest. You can view pending quotaRequest on a project with this command:

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

Quota request needs to be validated if you have not super admin or owner+ role.
Notice: If you are super_admin or owner+ quotaRequest will be automatically accepted else you must wait for validation. Check the status of the new quota request

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

Validation new quota request to extend resources on project

RequestQuota must be validated by the organization's validators if you are not super_admin or owner+ on the organization. Super_admin or organization’s validator can accept or reject a quotaRequest with the following command.

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

Add project members

You can onboard a team on a project.
Use the following command to add a alice as a developer and bob as admin on the 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
              

You can get team’s member and privileges for each member with this command

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