Deploy is the section of the console that allows developers to deploy configurations of a specific project on different environments. It can also be used to visualize the history of previous releases on that project.
This section allows to follow in a simple and effective way a Continuous Deployment approach, integrating automated tests and releasing new code versions without damaging the existing project.
The Deploy section is divided into two areas: Deploy and History. When a user enters the Deploy section, he is automatically led to Deploy area.
In this area, you can select in which environment you want to release your project configurations and which branch to deploy. You will be also able to start the deployment process from this section.
Let's see in detail how it works
The first card will let you choose the environment in which you want to release your configuration.
Once you have selected your target environment, you will be able to see all the details regarding the last release in that environment.
In the second card, you can choose the branch to be released.
Once the branch is selected the console will show:
- A link to the Gitlab page showing the code comparison between the branch you want to release and the one that has been previously released in that environment.
- The last 10 commits on the selected branch (this information will help you check if you are releasing a correct configuration).
Once you have selected the branch and the environment, the deploy page will load a card containing additional deployment details.
In particular, this card will show a comparison between the services that are going to be released and those that are currently running in the selected environment. This card will let you decide the deployment strategy, smart deploy or deploy all, and the ability to always release services that do not follow semantic versioning.
In this section you will be able to access the following information:
- The complete list of micro-services to be released
- The deploy outcome
- The running version
- The version you are going to release
Please note that using an environment variable to define the version will cause the inability to trace the correct version number.
- The tag that identifies whether the service is new or has been removed
- The status of the latest build of that service.
The card will show only the builds of the services whose link to the repo is known by the platform. This condition includes all the services created using the console either starting from an example or a template created after April 30th, 2020.
The build information will only be available to customers running GitLab CI as runners
- The link to the history of all builds
- The link to the changelog of your service
At this point, once you have verified the information, you can deploy your configurations.
By toggling the appropriate switch you can activate/deactivate the Smart Deploy functionality.
This functionality will let you release your microservices in a smart way, since only the updated services will be deployed through the console.
Smart Deploy leverages Kubernetes deployment strategies to ensure that only necessary Pods are recreated. During each deploy updated pods gets replicated to prevent disservice, however, on big projects, this might avoid huge resource consumption spikes or longer deployment times.
This feature can be activated only in projects using mlp, the Mia-Platform official command line deployment tool.
A service is considered to be eligible for a new deployment on certain circumstances: when you update the pod specification from the console, when you update the value of a pod dependency (such as a config map key) and so on.
It is important to save the configuration at least one time after the feature smart deploy has been activated. This operation will help avoid unconsistent behaviours when deploying your services.
In order to avoid unnecessary deployments, services created using an advanced configuration should be manually modified by removing all the old interpolated annotations.
When deploying for the first time using this feature, some services might not be able to collect all the necessary information to show the effective deployment strategy adopted. However, service that do not show actual differences on the cluser will not be deployed.
By deselecting the Smart Deploy toggle, you will switch to Deploy all strategy.
Smart deploy is enabled by default, if you want to force a deploy of all the services you should disable the toggle.
This strategy does not check if a microservice configuration has been updated and directly schedule the deployment of all the services. In big projects this might cause resource consumption spikes and longer deployment times. However, it can be useful to ensure a new and clean deployment environment.
The column Deploy outcome will help you understand which services will be deployed or deleted by pressing
the deploy button.
Rocket icons indicate services that are going to be considered by the smart deploy feature, while the sleeping symbol indicates services that are not going to be updated as their configuration haven't changed since the last deployment.
- A Deploy near the icon indicates that the service configuration is changed, so it will update the microservice.
- A Delete near the icon indicates that the service configuration is deleted, so it will delete the microservice.
- A No Update near the icon indicates that the service configuration remains the same.
- A No Info Available near the icon indicate the console could not collect enough information to display the outcome
An incomplete deploy outcome column might indicate the configuration has not been properly saved.
Please notice that this represents the impossibility to provide a complete preview, however, the smart deploy feature will still deploy the modified services.
If a microservice has interpolated environment variables and one of them is modified, the service will be deployed again even if the Deploy outcome column shows No update.
By checking the dedicated checkbox you can force the deployment of microservices that do not follow semantic versioning.
If you are not following sematic versioning, for example using
image:branchName, you can force the deployment by using the dedicated checkbox.
It is not recommended to activate the checkbox in a production environment, because if some of your services by mistake have a pre-release or latest version tag they will be redeployed.
The History Page is the second area of the Deploy section. In this tab it will be possible to visualize all the released deploy.
In the History table the user will be able to visualize the following information:
- Status: if the deploy is successful or if the deploy is not successful;
- Environment of the deploy;
- Deployed version;
- Deploy type;
- Who made the deploy;
- How long was the deploy;
- How much time ago the deploy was released;
- Link to Git to visualize the logs of the past deploy.