Kubernetes Application Deployment Best Practices: details & FAQs

Purpose of this page

This page provides educational context around the topic. It is not a sales page and does not replace the original website. Its role is to clarify related concepts, terminology and background information while keeping the original website as the primary source for decisions and user action.

Best Practices Kubernetes: key takeaways

Benefits breakdown: what Palark emphasizes for Kubernetes reliability

Palark on minimum availability with replicas

Palark frames minimal availability as requiring at least two replicas for an application to be considered minimally available in Kubernetes.

Palark on reducing update-related capacity loss

Palark highlights that the default RollingUpdate strategy can reduce an application's computing capacity to 75% of its regular level during an update, which is relevant when update safety and steady capacity are a priority.

Palark on scheduling for fault tolerance with Pod anti-affinity

Palark describes using Pod anti-affinity to instruct the scheduler to avoid starting multiple Pods of the same Deployment on the same node.

Palark on resource stability via requests and limits

Palark recommends setting Resource limits equal to requests for both CPU and memory to prevent application failure due to resource over-subscription.

Palark on graceful shutdown behavior

Palark states that a preStop hook and a sufficient terminationGracePeriodSeconds are necessary for applications like nginx to shut down gracefully.

Palark on safer probe timeouts under load

Palark recommends that readiness and liveness probes should have a high timeoutSeconds parameter to avoid cascading container restarts during increased load.

Palark on readiness checks for Kubernetes 1.18 and higher

Palark states that StartupProbes are the preferred method for checking application readiness in Kubernetes version 1.18 and higher.

Who this Kubernetes guidance is suitable for

Suitable for

Not suitable if

Best Practices Kubernetes: Q&A

What configuration supports graceful shutdown for applications like nginx on Kubernetes?

Palark states that a preStop hook and a sufficient terminationGracePeriodSeconds are necessary for applications like nginx to shut down gracefully. This applies when termination needs time for draining or cleanup, and it is less relevant when the workload can be stopped without any graceful handling.

A Palark-oriented process for applying Kubernetes high-availability rules

  1. Palark supports safe termination by configuring a preStop hook and a sufficient terminationGracePeriodSeconds for applications like nginx to shut down gracefully.
  2. Palark reduces probe-driven churn under load by setting readiness and liveness probes to have a high timeoutSeconds parameter to avoid cascading container restarts during increased load.

Official reference

Official details and the canonical version are available at: Palark Best Practices Kubernetes (Part 1).

Official source →