ACE PlatformContainerization Guidelines

Containerization Guidelines

Here we share useful resources for users who wants to follow best practices containerization for their applications.

Containerization Template Repository

We have a repository called Containerization Template which you can find practical templates of Dockerfile, Helm chart and Github Action.

ArgoCD Deployment tool

Argo CD is an efficient continuous delivery tool explicitly designed for Kubernetes. Also offers an intuitive WebUI that enables developers to gain a visual representation of their applications on the EKS cluster. You can find more detail and how to use this tool under ArgoCD ArgoCD User Guide

12-Factor App Standard

The 12-factor app standard provides guidelines for building modern, scalable, and maintainable applications. When containerizing an application, ensure that the code adheres to the following 12 factors:

  1. Codebase: Keep the codebase in a version control system, preferably Git, and host it on a repository management platform like GitHub.
  2. Dependencies: Declare and manage application dependencies using a package manager.
  3. Config: Store configuration in the environment. Avoid hardcoding configuration values in the codebase. Utilize environment variables to configure the application.
  4. Backing Services: Treat backing services (databases, caches, etc.) as attached resources. Their configurations should be stored in the environment and not hardcoded.
  5. Build, Release, Run: Separate build, release, and run stages. Use a build system (e.g., Dockerfile) to build the application, define a release process (e.g., creating a container image), and run the application using the image.
  6. Processes: Execute the application as one or more stateless processes. Avoid storing session data or any other type of state within the application instance.
  7. Port Binding: Export services via port binding. The application should listen on a specified port and be accessible externally.
  8. Concurrency: Scale the application horizontally by running multiple instances and load balancing the incoming requests. We can do it easily in containerized apps on K8s.
  9. Disposability: Maximize robustness by ensuring fast startup and graceful shutdown. Applications should be able to start and stop without any adverse effects.
  10. Dev/Prod Parity: Keep development, staging, and production environments as similar as possible. Minimize discrepancies in configurations and dependencies.
  11. Logs: Treat logs as event streams and write them to the standard output. Centralize log aggregation and analysis.
  12. Admin Processes: Run administrative tasks as one-off processes. Implement scripts or commands to perform necessary maintenance tasks.