Skip to content

Continuous Deployment Tutorial with CNO

In this tutorial, you will see how to use CNO to manage the deployment of your applications. We will show you how to scale up/down applications, manually deploy new versions (continuous delivery), detect and auto-deploy new versions pushed on your docker registry (continuous deployment), use advanced deployment strategies like Blue/Green, Canary, or A/B Testing.


  • A CNO Cluster: Head over to the QuickStart section to see how to deploy one

  • cnoctl installed on your computer

Create a Project and an Environment

1 Create a project named: lab

cnoctl create project lab --cpu 2,1 --memory 4Gi,2Gi --storage 0Gi 

This command allows you to create a project named lab with 2 cores CPU-limit, 1 core CPU-request, 4Gi memory-limit, 2Gi memory-request and, 0Gi storage.


You must wait for quota request validation if you are not super_admin or owner+.

2 Create environment named: cno-cd-lab

cnoctl create env cno-cd-lab --cpu 2,1 --memory 4Gi,2Gi --storage 0Gi --project lab --cluster default 

This command allows you to create an environment named cno-cd-lab on the lab project with two cores CPU-limit, 1 core CPU-request, 4Gi memory-limit, 2Gi memory-request, and 0Gi storage, and deploy the environment on the default cluster.

3 Create and push an image to your docker registry

Clone the version-printer repo

git clone
cd version-printer

Build and push version 1.0.0 to your docker registry

git checkout 1.0.0 
docker build . -t <your username>/version-printer:v1.0.0
docker push <your username>/version-printer:v1.0.0 

Build and push version 2.0.0 to your docker registry

git checkout 2.0.0 
docker build . -t <your username>/version-printer:v2.0.0 
docker push <your username>/version-printer:v2.0.0 

Deploy your Environment

1 Connect to the cno-cd-lab environment

cnoctl use env -e cno-cd-lab --project lab 

This command allows you to get a kubeconfig enabling you to access the cno-cd-lab environment. And then, you can apply kubectl commands.

2 Deploy the version-printer application on your environment

kubectl create deployment version-printer --image <your username>/version-printer:v1.0.0 
kubectl create service clusterip version-printer --tcp 8080:8080 

3 Port-forward and check if the application responds correctly

Open a new terminal and run the following command

kubectl port-forward service/version-printer 8080:8080 

On another terminal, run the following command to test if the application responds correctly

curl -w "\n" http://localhost:8080 
version 1.0.0

Overview of the CD Operator

A CD operator on the CNO data-plane monitors Kubernetes objects such as deployments, StatefulSets, DaemonSets, Services, and Ingress present in environments. It's, therefore, possible to retrieve the list of all workloads (applications) currently in an environment. In addition, the operator also monitors the docker registry to detect new versions of applications.

You can use cd functionality from cno U.I. or cnoctl. For example, we can get the list of workloads deployed in the namespace cno-cd-lab with the following command.

cnoctl get workload --project lab --env cno-cd-lab 
version-printer default 1/1 /version-printer false v1.0.0 -


You can scale up/down an application directly from CNO without accessing the cluster api-server where you deployed the application by typing :

cnoctl deploy workload version-printer --replicas 2  --project lab --env cno-cd-lab 

You can increase the number of replicas of the version-printer application to two with the following command:

cnoctl get workload --project lab --env cno-cd-lab 
workloadName strategyChosen replicasNumber username/workloadName liveVersion -

For example:

version-printer default 2/2 your username/version-printer 1.0.0

And you can scale down to 1 by typing this command:

cnoctl deploy workload version-printer --replicas 1  --project lab --env cno-cd-lab 

Last update: 2022-11-29