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:
- Default Namespace: Pile of Trash Strategy
- App Namespace: Scope by App. Cons: No security isolation between dev and prod.
- Env Namespace: Scope by Env. Cons: As number of apps grow the env becomes pretty noisy.
- 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.
- eks-default
- eks-app
- eks-env
- 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.
Docker Essentials
1h 46m
Kubernetes Intro
1h 43m
Kubernetes Deploy Tools
48m
Kubes: Kubernetes Deploy Tool
2h 21m
Kubernetes Tips
19m
AWS EKS Kubernetes
4h 13m
Azure AKS Kubernetes
40m
Google GKE Kubernetes
3h 29m
Get full access to these great resources
All for less than the price of coffee a day