Hello. This is Akiyama from Azure Cloud Solution Architect. This time, I will continue to write about the story of migrating to k8s at our Mamoru Biz .
- Vol.1 Deciding to Migrate from App Service to AKS
- Vol.2 AKS(k8s) Preparations for Migration
- The same goes for the job execution I wrote in the Vol.3 AKS(k8s) Migration <- 本記事
移行をどのように進めたかについて書きます。 まずは移行のスコープの検討です。
移行の進め方
今回の移行では Azure インフラの置き換えが主であり、例えばアプリケーションが動作している Docker コンテナについてはこれまでのものをそのまま k8s 上で動かすことにしました。 (Mamoru Biz では Docker イメージを管理しているのは基本的にアプリケーションエンジニアです。)
これは、できる限りインフラエンジニアがコントロール可能な範囲で移行を進めるための措置です。 (実際には k8s 上で動くようになった後に App Service 向けにカスタマイズしていた Docker コンテナを修正する、ということも追って対応しました。)
移行のスコープ
移行のメインターゲットは App Service ですが、 AKS(k8s) で代替可能な機能は置き換えることを計画していました。 Vol.1 article .
In addition to the Container Instance, there were also jobs that used the HTTP Request in the Logic App to run the Administrator Web API. These functions are also subject to migration because it is desirable that developers can freely create them themselves.
Now that we have the largest scope, we followed the Pareto Principle when actually moving forward, and the main part was the scope of the first release. This scope was fine-tuned as the project progressed, and we ended up with the first release with a smaller scope than we had considered.
As a result, there were no problems during the migration, but I think it was appropriate to release many times in small units to minimize problems when problems occurred.

Build an Azure infrastructure environment
When building the environment, we have been using Terraform since before this migration project to minimize differences in the three environments of development, staging, and production.
This is a measure to prevent issues such as "the application cannot access the database in the staging environment (even though it was fine in the development environment), and the firewall configuration is insufficient".
Terraform is powered by Terraform Cloud . Overall, I'm satisfied, and one thing I want to mention is the Access Control feature. Mamoru Biz limits the environments in which 'terraform apply' can be executed according to the infrastructure engineer's proficiency with Terraform and their understanding of the environment.
Developing a DevOps Environment
We mentioned infrastructure DevOps earlier, but the DevOps environment at the k8s layer needed to be maintained through this project.
By the way, App Service used the supported features to switch containers. Reference: Continuous Deployment with Custom Containers in Azure App Service I'm grateful that this area is well thought out.
For the k8s layer, we used GitHub Actions . k8s manifests and apply them to AKS.

We use Helm for deployment.
Although the DevOps environment has made it easier to release, this mechanism still needs to be improved in terms of both operations and speed compared to deployments in the App Service era.
Conclusion
So far, we have divided it into three articles and introduced the project that migrated our service Mamoru Biz from App Service to AKS (k8s). Although the transition itself is complete, we will continue to make small improvements to provide customers with a higher level of "less nothing" service.
Last but not least,
At Colorkrew, you can experience both the development of your own services and the contract business. If you are interested in our company, please enter from the recruitment page .
If you are interested in supporting the introduction of a container-configured system, please contact us below. Serverless/Container Implementation Support |