Using Good Kubernetes Namespaces and App Naming Conventions

November 24, 2021

This is a common question that comes up. How should we name our Kubernetes namespaces and app names.

Will show my opinion on this and how to best manage and organize your application in Kubernetes namespaces. I walk through the evolution process that folks go through, and also provide a full blow demo what happens when you use the different naming conventions.

Typical Naming Strategy Evolution:

  1. Default Namespace: Pile of Trash Strategy
  2. App Namespace: Scope by App. Cons: No security isolation between dev and prod.
  3. Env Namespace: Scope by Env. Cons: As number of apps grow the env becomes pretty noisy.
  4. App-Env Namespace: Scope by both app and env.

Demo

Actual created 4 EKS clusters and deployed resources with all 4 strategies to really show the differences. The EKS Clusters.

  1. eks-default
  2. eks-app
  3. eks-env
  4. eks-app-env

Links

Note: Wanted to also mentioned that prod and dev should be in separate clusters entirely. However, the naming strategy should still be the same and include the env. IE: namespace = app1-dev.

The reason is because it’s common to have multiple envs in a common dev or non-prod cluster. By keeping the env in the namespace naming strategy, it's consistent for when the case comes up that folks want multiple environments in the same cluster, since there's some maintenance overhead that comes with managing each cluster.

Kubernetes Deploy Tools
48m

Get full access to these great resources

All for less than the price of coffee a day

38 courses
274 lessons
44+ hours

Get started with BoltOps Learn now and get access to easy and powerful lessons

BoltOps Tools