16 May 2025
Auto Scaling Web Server on Alibaba Cloud

Auto Scaling Web Server on Alibaba Cloud


This time the admin wants to share the stages of auto scaling web server at Alibaba Cloud. This article is not too technical, so later it only provides an outline and is given tips according to the implementation that has been carried out by the admin. Hopefully the next article can discuss technically how to do it.

Admin

Architecture

Load Balancer ---> Auto Scaling --> ECS

Equipment

  • PHP application
  • Terraform
  • Pseudo
  • Packer
  • Gitlab

1. Continuing integration process

Here the application that will be depicted by PHP and is ready to be packaged to VM Image. Source Code is on Gitlab Server.

Wake up the picture

In the level of making VM images, the admin uses tools: Packer And Pseudo.

Why use the tools?

The manufacturing process is in Alibaba Cloud and does not burden local resources, both networks and CPU/mem. One of the cloud native software that is also used to create images in other cloud providers such as GCP and AWS. The manufacturing process uses a code, so it is suitable when applying IAC.

Packer here to create an ECS image which will be used as an image that will be used by Auto Scaling Configuration.

ANSIBLE helps automate all Linux commands such as web server installations, configurations, copy, and so forth.

The flow of manufacture:

  1. Developers make changes to the application repository.
  2. Gitlab CI in the repository reads the changes according to the rules applied.
  3. Gitlab pipeline runs to execute binary packers.
  4. Packer running (running) with ansible and making images at Alibaba Cloud (ECS).
  5. When finished, the new image will be formed and information related to the image ID is seen in the Terminal / Job’s Log Pipeline Gitlab.

2. Continuing shipping process

This stage is used to launch the results of the process of making a VM image.

Infrastructure creation

Making infrastructure is good to use the code so that the changes made are seen by other engineers. If you are a single fighter, of course it is also useful for what documentation you make in the cloud provider. But if you are not used to the code, you can use a web console.

Here the admin uses terraform as a tool that can help make everything related to infra, including:

  • Load Balancer (ALB) + ALB LISTEner
  • Alb server group + alb server group attachment
  • ESS SCALING GROUP + Konfigurasi Grup Penskalaan ESS
  • Ess Scaling Rule + Ess Alarm

All of the above resources are handled by terraform, the resources are in the form of code so the admin is placed on the gitlab repository. To run it enough to make the pipeline in the repository.

So that the build image process is integrated with pipeline terraform. Gitlab supports trigger pipeline from other repositories.

Rolling updates

The rolling update that the admin has applied by scanning the latest image that is built on continuous integration. For the momentum of changes from the old image to the new image, the admin applies a schedule task 1 minute after running the pipeline terraform will be rolling updated image, this schedule task is made in Terraform using the Ess Schedule Task.



Game Center

Game News

Review Film
Rumus Matematika
Anime Batch
Berita Terkini
Berita Terkini
Berita Terkini
Berita Terkini
review anime

Gaming Center