How To Design A Container-Based Application?
Source: Kubernetes Patterns Book

How To Design A Container-Based Application?

Dear Friend,

Container is an important moving part of microservices architecture.

You will need to place your application, and services into a container to get started in the Kubernetes world.

Containerising an application is an easier step, but designing it to use the full capability of cloud-native computing requires certain due diligence.

Let's discuss the guidelines which allow us to design a robust container that could withstand failure, be secure by design, decoupled so it can independently interact with other applications in a containerised environment.

??Single concern principle (SCP)

Each container should address a single concern effectively. For example, if you have a 3-tier application, then you would pack them in each container than all together in a single container.

In the micro-services world, each of your REST services would go into a container.

??High observability principle (HOP)

Containerized applications must offer APIs for health checks, and logging, and integrate with tracing and metrics-gathering libraries.

Logging important events into STDERR and STDOUT is crucial for log aggregation.

??Life-cycle conformance principle (LCP):

Containers should react to events from the platform, such as signal messages like SIGTERM for clean shutdown processes.

Handling events like PostStart and PreStop is essential for application life-cycle management.

??Image immutability principle (IIP):

Containerized applications should be immutable and rely on externalized configurations, preventing the creation of similar container images for different environments.

??Process disposability principle (PDP):

Containers should be ephemeral, ready to be replaced at any time due to various reasons like failing health checks or scaling down.

Keeping the state externalized or distributed helps in implementing this principle.

??Self-containment principle (S-CP):

Containers should contain everything they need at build time, relying only on the Linux kernel and having additional libraries added during build.

Exceptions include configurations, which are provided at runtime through Kubernetes ConfigMap.

??Runtime confinement principle (RCP):

Containers must declare resource requirements to the platform, influencing scheduling, auto-scaling, and SLAs.

Staying within indicated resource requirements reduces the likelihood of termination or migration during resource starvation.

What's Next?

In addition to the discussion above, read about general for writing docker files

Share your thoughts, and questions in the comment


要查看或添加评论,请登录

Rajesh Muthusamy的更多文章

  • Terraform in 6 Weeks - Week 2: Build a Scalable Static Website

    Terraform in 6 Weeks - Week 2: Build a Scalable Static Website

    Dear friend, The week 2 objective is to create a scalable and highly available static website hosted on S3, served…

    2 条评论
  • Terraform in 6 Weeks - Week 1: Architectural view

    Terraform in 6 Weeks - Week 1: Architectural view

    Dear Friend, In Week 0, we covered the basics of Terraform to get you started. Now, let’s dive deeper into Terraform’s…

    2 条评论
  • Terraform in 6 Weeks - Week 0: Laying the Foundation

    Terraform in 6 Weeks - Week 0: Laying the Foundation

    Dear Friend, Terraform is the gold standard in Infrastructure as Code (IaC), and mastering it is a skill that will stay…

    8 条评论
  • Understanding the OSI Model

    Understanding the OSI Model

    Dear Friend, The Open Systems Interconnection (OSI) model is a fundamental conceptual framework that illustrates how…

    2 条评论
  • Understanding Linux File Permissions

    Understanding Linux File Permissions

    Dear Friend, Linux file permissions are a fundamental aspect of the operating system's security model, determining who…

  • Kubernetes Networking

    Kubernetes Networking

    Dear Friend, In the world of kubernetes, we have different levels of networking requirements. Container-to-container…

    1 条评论
  • The Journey Of A Code To Pod

    The Journey Of A Code To Pod

    Dear Friend, The journey of code towards Pod has multiple stages, and would feel overwhelming to dig the path. But…

    2 条评论
  • How Pods Connect Over Network?

    How Pods Connect Over Network?

    Dear Friend, Kubernetes allows unrestricted communication between pods by default. All pods can communicate with each…

    5 条评论
  • What The Helm?

    What The Helm?

    Dear Friend, In the Kubernetes world, there's no shortage of buzzwords. One among them is Helm.

    1 条评论
  • Kubernetes Networking: Ingress and Controllers

    Kubernetes Networking: Ingress and Controllers

    Dear Friend, Understanding how Kubernetes manages application traffic routing is crucial for maintaining a robust and…

社区洞察

其他会员也浏览了