Skip to content

Manual & Automatic Deployments with Cloudoor Deploy

Your teams are on deck, and your environments are running at full speed.

Finally, it's time to deploy your applications.

Cloudoor built several advanced deployment strategies to let you deploy with all confidence in production, with templatized frameworks.

This section will show you how to use Cloudoor to manage the deployment of your applications.
We will show you how to scale up/down applications, manually deploy new versions (continuous delivery), and detect and auto-deploy new versions pushed on your docker registry (continuous deployment).

Prerequisites

Before Starting

You must have created a project with a few environments at this point.

Let's make sure you can deploy with docker first.

Create and push an image to your docker registry

First, clone the version-printer repo

git clone https://github.com/beopencloud/version-printer.git
cd version-printer

Then, build and push version 1.0.0 of Cloudoor to your docker registry.

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

Finally, build and push version 2.0.0 of Cloudoor to your docker registry.

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

Connect to your environment

door use env -e <environmentName> --project <projectName>

This command allows you to get a kubeconfig to access your environment.

Now, you can apply kubectl commands.

Deploy the version-printer application to your environment

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

Port-forward and check if the application responds correctly

First, 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
Result example:
version 1.0.0

A CD operator on the Cloudoor data-plane monitors Kubernetes objects such as deployments, StatefulSets, DaemonSets, Services, and Ingress.

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 Cloudoor's U.I. or door.
For example, we can get the list of workloads deployed in a namespace with the following command.

door get workload --project <projectName> --env <environmentName>

Scaling your applications

You can scale up/down an application directly from Cloudoor without accessing the cluster API-server where you deployed the application.
Instead, you can do it through Cloudoor's UI, or Cloudoor's CLI, door.

Scaling your applications

  1. Go to Deploy

On this board, you will find all the applications for your project. You can filter them according to project, environment or strategy. Simply click the one you wish to edit.

  1. You'll be taken to the info page of your application where you can see all information about your application at a glance. Click "Update"

  1. Define the number of replicas for your app.

  2. Press Update

You can get the list of workloads deployed in a namespace with the following command:

door get workload --project <projectName> --env <environmentName>

It should return a list in this format:

NAME STRATEGY REPLICAS IMAGE AUTO-DEPLOY LIVE STAGING STAGING-TRAFFIC HEADERS
workload Name canary replicas Number username/workloadName true/false V1.0.0 0

You can increase or decrease the number of replicas of the version-printer application by adjusting the number of replicas you want with the following command:

door deploy workload version-printer --replicas <numberReplicas>  --project <projectName> --env <environmentName>

Yay, you scaled your application! 💪

Continuous Delivery with Cloudoor

Delivery deployment is a manual method where you will have to manually select the application's version to release to the market.

From Cloudoor's API, it is easy to update the version of an application manually. Furthermore, it prevents you from detecting the Kubernetes cluster on which you deployed the application to retrieve a kubeconfig, allowing us to access it and type kubectl commands to update the app version.

You can do it from the Cloudoor user interface or the command line with door.

Info

Continuous delivery is the default strategy applied for each onboarded application.
You can apply this strategy to deployment, Statefulset, and Deamonset applications.

Continuous Delivery

a) Go to Deploy

On this board, you will find all the applications for your project. You can filter them according to project, environment or strategy. Simply click the one you wish to edit.

You'll be taken to the info page of your application where you can see all information about your application at a glance. Click "Update"

b) Choose the Default Strategy for your application.

1. Scale up or down your application if needed by changing the Replicas number.

  1. Select the Default strategy.

  2. Select the version you want to deploy.

  3. Don't push the Auto Deploy button.

  4. Press Update.

You can find below the command to choose the version of the version-printer to apply to your workload:

door deploy workload version-printer 
--version <versionNumber> --project lab --env cno-cd-lab

You can verify if the deployment is effective with this command:

door get workload --project <projectName> --env <environmentName>

And finally, you can see that the live version of the version-printer app with:

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

Yay, you've deployed your application! 🥳

If you deploy a new image, Cloudoor will identify it.
To deploy a new image, select the new version that should automatically appear. After that, you will have to re-edit your application.

Automatic strategy for Continuous Deployment

Continuous deployment is an automatic method where Cloudoor will deploy each new onboarded version of your applications without your intervention.

Cloudoor's CD operator can monitor your docker registry and detect any new versions of your applications. It is possible to activate the auto-deployment functionality so that each time a new version of your application is pushed on your docker registry, Cloudoor will automatically deploy it. We can also apply filters on the name of the versions to be deployed.

You can do it through Cloudoor's UI or DOOR.

Info

You can apply this strategy to deployment, statefulset, and deamonset applications.

Continuous Delivery

a) Go to Deploy On this board, you will find all the applications for your project. You can filter them according to project, environment or strategy. Simply click the one you wish to edit.

You'll be taken to the info page of your application where you can see all information about your application at a glance. Click "Update"

b) Let's activate auto-deployment

1. Scale up or down your application following your needs.

  1. Select the Default strategy.

  2. Select the version you want to deploy.

  3. Push the Auto deploy button.

  4. Press Update.

Your application will be automatically deployed as soon as a new version is added. So if you want to change the strategy for this one or scale your application, you will have to re-edit your application.

c) Check your App Info Page.

You will find your application deployed according to the chosen strategies, in the example « Default.»

Run the following command to activate the auto-deploy functionality for the version-printer app:

door deploy workload version-printer --auto-deploy=true --project <projectName> --env <environmentName>

By assigning the actual value to auto-deploy, you allow the version-printer to point to the last created version of the Nginx image. Each time a new version is made, the app will automatically be deployed.

By typing the following "get workload" command, you'll notice that an auto-deploy variable now appears:

door get workload --project <projectName> --env <environmentName>

Let’s build and push version 3.0.0 to your docker registry.

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

After this, Cloudoor will automatically deploy version 3.0.0.

To verify if it worked, you can use the "get workload" command again:

door get workload --project <projectName> --env <environmentName>

Then, we can test with the following command.

curl -w "\n" http://localhost:8080
Result example
version 3.0.0

Run the following command to disable auto-deploy

door deploy workload version-printer --auto-deploy=false --project <projectName> --env <environmentName>