Is there a concept of inheritance for Kubernetes deployments?
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
Kubernetes does not implement object inheritance for Deployments in the way class-based languages do. You cannot define one Deployment as a parent and have another Deployment extend it directly. Instead, reuse is achieved through templating and composition tools such as Kustomize and Helm.
Why Kubernetes Has No Deployment Inheritance
A Deployment is declarative state, not executable code. The API server stores one final object after admission and validation, and controllers reconcile that object toward the desired state. Because of this model, Kubernetes expects each resource manifest to be complete at apply time.
If you need shared configuration across many Deployments, the platform pattern is not inheritance. The platform pattern is generating multiple complete manifests from shared inputs.
Common reuse options are:
- Kustomize bases and overlays
- Helm charts and values files
- Internal generators in CI pipelines
All three produce concrete YAML before objects are applied.
Reuse with Kustomize Bases and Overlays
Kustomize is built into kubectl and works well when you want patch-based customization without a templating language. You define a base Deployment once, then create overlays for each environment.
This gives inheritance-like reuse while staying native to Kubernetes workflows.
Reuse with Helm Values
Helm uses templates and values to render manifests. Think of a chart as a reusable Deployment factory. Environment differences go into separate values files.
Helm is strong when teams publish reusable app templates across many services.
Building a Safe Promotion Workflow
To keep reuse maintainable, define one base and multiple environment overlays in source control, then promote changes through staged apply commands. This approach gives you a clear audit trail for what changed between test and production.
You can apply the same pattern with Helm by templating each environment and diffing the rendered manifests. The key idea is consistent generation plus review, not direct editing inside the cluster.
Common Pitfalls
One pitfall is trying to copy one Deployment into another with manual duplication. This drifts quickly and makes environment promotion error-prone.
Another problem is mixing Kustomize and Helm without clear ownership. If both tools mutate the same fields, debugging rendered output becomes difficult.
Some teams also overuse patches for large changes. When an overlay patch rewrites most of the base, the base no longer acts as a reusable core. Split into separate bases instead.
Finally, always inspect the rendered output before apply. With Kustomize use kubectl kustomize, and with Helm use helm template. Reviewing final YAML prevents surprises.
Summary
- Kubernetes Deployments do not support direct inheritance.
- Reuse is achieved by generating full manifests from shared definitions.
- Kustomize is good for patch-based environment overlays.
- Helm is good for parameterized templates and chart reuse.
- Validate rendered manifests before deployment to reduce config drift.
Related reading
- Is there a 'max-retries' for Kubernetes Jobs?
- Is there a way in kubectl patch to delete a specific object in an array without specifying the index?
- Is there a way in Kubernetes to check when hpa happened?
- Is there a way to add arbitrary records to kube-dns?
- Is there a way to clean docker build cache?
- Is there a way to enable shareProcessNamespace for helm post-install hook?
- Is there a simple way to export the data from a meteor deployed app?
- Is there a way to kubectl apply all the files in a directory?

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.