Who Owns Deployment Template Logic in GitOps?

Who should own deployment templates in GitOps: platform vs app teams, Helm library charts, CODEOWNERS, Argo CD AppProjects and admission policies.

Sep 1, 2025 - 14:54
Nov 13, 2026 - 00:51
 0  53
Who Owns Deployment Template Logic in GitOps?

In GitOps, a platform team should own the shared deployment templates (Helm library charts, Kustomize bases, Argo CD AppProjects and policies), while each application team owns its own values and overlays. Ownership is written into the repository with CODEOWNERS, enforced by branch protection, and limited at runtime by Argo CD projects and admission policies.

Deployment templates carry more business logic than most teams admit. A probe timeout, a replica floor, a rollout strategy or a label that drives cost reporting is a decision someone made about how the business runs software. When nobody is named as the owner of those decisions, they drift across copies of the same chart until an outage shows the difference. This guide sets out a split of ownership that works with GitOps as a whole and shows how to enforce it with tools you probably already run.

Key takeaways

  • Split templates into layers: shared building blocks owned by the platform team, service values owned by the application team, and environment overrides owned jointly.
  • Write the split into the repository. A CODEOWNERS file names reviewers per path, and the branch protection setting "Require review from Code Owners" makes their approval mandatory.
  • Use a Helm library chart (type: library) or a Kustomize base so business rules live in one place instead of being copied into every chart.
  • Argo CD AppProjects limit which repositories, clusters, namespaces and resource kinds each team can deploy, so ownership holds even when a review is missed.
  • Admission policies (Kyverno or OPA Gatekeeper) are the last check for rules that must never be broken, such as resource limits or approved registries.
  • Ownership needs a change process: versioned templates, a changelog, and a way for application teams to request changes without forking.

What counts as business logic in a deployment template

A template is any file that produces Kubernetes manifests from inputs: a Helm chart, a Kustomize base, a Jsonnet library or a Crossplane composition. The logic inside it falls into three groups, and each group has a natural owner.

Kind of decisionExamplesNatural owner
Organisation-wide rulesRequired labels for cost and ownership, security context defaults, approved image registries, network policy baseline, pod disruption budget shapePlatform team, with security review
Service behaviourReplica counts, resource requests, health check paths, feature flags, environment variablesApplication team
Environment differencesHostnames, scaling limits per environment, secrets references, cluster-specific storage classesApplication team, with platform review for production
Release processRollout strategy, canary steps, sync waves, sync windowsShared: platform defines the options, application team picks one

The table is a starting point, not a law. A small company with one team may own everything together. The point is to decide, write it down, and make the tools enforce it.

Why ownership goes wrong

Most ownership problems come from copying. A team copies a working chart, edits it for a new service, and the copy now carries its own version of every organisation rule. Six months later there are twenty charts with twenty slightly different security contexts. Nobody owns the rules because nobody owns the copies.

The second cause is a single shared chart that everybody edits. Ownership is "everyone", which in practice means a pull request from one team can change the rollout behaviour of every other team's service. Reviews get slow because reviewers are unsure what they are approving.

The third cause is ownership that exists only in a wiki. If the repository allows any engineer to merge a change to the base templates, the wiki page does not matter on the day someone is in a hurry.

A layered model that works

The model below separates what changes rarely and affects everyone from what changes daily and affects one service.

Layer 1: shared building blocks (platform team)

Helm has a chart type made for this. A library chart is declared with type: library in Chart.yaml. It cannot be installed on its own; Helm refuses with an error saying library charts are not installable. Its templates are named helpers, conventionally in files starting with an underscore, that application charts call with include. The platform team writes the deployment, service and network policy helpers once, with the organisation rules built in.

# platform-lib/Chart.yaml (owned by the platform team)
apiVersion: v2
name: platform-lib
type: library
version: 3.2.0
# payments-api/Chart.yaml (owned by the payments team)
apiVersion: v2
name: payments-api
type: application
version: 1.8.4
dependencies:
  - name: platform-lib
    version: "3.2.0"
    repository: "oci://registry.example.com/charts"

Kustomize users get a similar result with a shared base directory or remote base that overlays reference. The ownership rule is the same: the base lives in a path only the platform team can approve.

Layer 2: service values (application team)

Each service has a values.yaml or overlay that sets the things the team knows best: image tag, replicas, resources, probes and configuration. The application team approves these changes without waiting for the platform team. That speed is the reason the split exists.

Layer 3: environment overrides (shared)

Per-environment files such as values-prod.yaml sit with the service, but production paths add a second reviewer. Many teams require one platform or SRE approval for production overrides and none for development.

Encode ownership in the repository

GitHub reads a CODEOWNERS file from .github/, the repository root or docs/, in that order. Patterns follow most .gitignore rules, and the last matching pattern takes precedence. Owners must have explicit write access to the repository. Code owners are requested for review automatically, but their approval is only required when the branch protection rule "Require review from Code Owners" is turned on. GitLab has an equivalent CODEOWNERS feature with approval rules.

# .github/CODEOWNERS in the deployment repository
# Default: platform team reviews anything not matched below
*                               @example-org/platform

# Each service team owns its own folder
/apps/payments-api/             @example-org/payments
/apps/catalog/                  @example-org/catalog

# Production overrides need platform review as well (listed last so it wins)
/apps/*/values-prod.yaml        @example-org/payments @example-org/catalog @example-org/platform

# Shared building blocks and policies are platform-only
/charts/platform-lib/           @example-org/platform
/policies/                      @example-org/platform @example-org/security

Order matters here. Because the last match wins, a broad rule written after a specific one would silently take over the specific path. Put general rules first and exceptions last, and test the file with a dummy pull request after every change.

Keep in mind that approval from any one listed owner satisfies the requirement. If production changes need both the service team and the platform team, use a separate required-approvals rule or a CI check, because CODEOWNERS alone will accept either.

Enforce ownership at deploy time with Argo CD projects

Repository rules stop bad merges. Runtime rules stop a merged mistake from doing damage. In Argo CD, an AppProject groups applications and restricts them. The documented fields include sourceRepos (which Git repositories are allowed, with globs and ! deny rules), destinations (which clusters and namespaces), clusterResourceWhitelist (an allow list for cluster-scoped kinds), namespaceResourceBlacklist (a deny list for namespaced kinds) and roles for project-scoped RBAC.

apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
  name: payments
  namespace: argocd
spec:
  description: Payments team services
  sourceRepos:
    - https://git.example.com/deploy/apps.git
  destinations:
    - server: https://kubernetes.default.svc
      namespace: payments-*
  clusterResourceWhitelist: []        # no cluster-scoped resources
  namespaceResourceBlacklist:
    - group: ""
      kind: ResourceQuota             # quotas stay with the platform team
  roles:
    - name: deployer
      description: Payments engineers can sync their apps
      policies:
        - p, proj:payments:deployer, applications, sync, payments/*, allow
      groups:
        - payments-engineers

With this project, the payments team cannot create a ClusterRole or edit its own quota, even if such a manifest slipped into its folder. That is ownership enforced by the system rather than by goodwill. Argo CD v3.6.1 was the latest release on the project's GitHub page when this article was checked; check the release notes when you upgrade, because project and RBAC behaviour has changed between major versions. For a refresher on how Argo CD and Flux apply Git state, read how Argo CD and Flux enable declarative deployments.

Guard the rules that must never break

Some rules are too important to rely on templates alone, because a team can still write raw YAML that skips the library chart. Admission policies check every object the API server receives, whatever produced it. Typical candidates are "every container has memory limits", "images come from the internal registry" and "no privileged pods outside system namespaces". The policies live in /policies, owned by platform and security, and the same rules can run in CI with the policy engine's command-line tool so authors see failures before merge. Our comparison of Gatekeeper and Kyverno explains how the two engines differ.

Think of the three checks as layers. CODEOWNERS decides who may change a rule. The library chart makes the right thing the easy default. Admission policy catches whatever bypasses both.

Version and release templates like software

A shared template is a product with internal customers, so treat it that way.

  1. Give the library chart a semantic version and publish it to a chart repository or OCI registry. Application charts pin an exact version in dependencies.
  2. Keep a changelog. A breaking change, such as a renamed value or a new required label, gets a major version bump and a migration note.
  3. Let application teams upgrade on their own schedule within a support window, for example the current and previous major version.
  4. Automate the upgrade pull requests with a dependency bot so teams review a small diff instead of discovering a big one later.
  5. Render templates in CI (helm template or kustomize build) and diff the output, so reviewers see the manifests that will actually change.

Version drift is the usual failure here. If twenty services pin twenty different library versions, the platform team effectively owns twenty products. A support window and automated upgrade pull requests keep the number small. Our article on version drift in distributed Helm charts covers this problem in more depth.

How application teams request changes

Ownership fails if the only way to get a change is to wait in a queue. Give application teams three paths:

  • A value or flag already exists: the team sets it in its own values file. No platform review.
  • A new option is needed: the team opens a pull request against the library chart. The platform team reviews it for impact on other services and releases a new minor version.
  • A one-off exception is needed: the team adds a raw manifest in its own folder, and admission policy still applies. If the exception keeps coming up, it becomes a library option.

Publish a short contributing guide in the template repository that explains these paths, the expected review time and who is on call for template questions.

Ownership in multi-cluster and regulated setups

With many clusters, Argo CD ApplicationSets or Flux Kustomizations generate one application per cluster from the same template. Here the generator definition is shared business logic: a change to it can deploy to every cluster at once. Keep generator files under platform ownership and roll out template changes to a small cluster group before the rest. Our guide on GitOps across multiple clusters covers the patterns.

In regulated environments, auditors usually want to see who approved a change, what the change was and that the approver was not the author. Git history, protected branches and required code owner reviews provide most of this evidence without extra tooling. Keep the evidence trail intact by disallowing direct pushes and force pushes to the deployment branch, and by keeping Argo CD sync permissions narrower than Git merge permissions.

A worked example of the split

Suppose the security team decides every pod must run as a non-root user. Under the layered model, the work looks like this:

  1. The platform team adds runAsNonRoot: true to the security context helper in the library chart and releases a new minor version with a changelog entry.
  2. Security adds an admission policy in audit mode to find workloads that would fail the rule.
  3. A dependency bot opens upgrade pull requests in each service folder. Each service team tests the new version in development and merges it.
  4. After the agreed window, the policy moves from audit to enforce. Services still on the old version show up in the policy report, and their owners are already known from CODEOWNERS.

Nobody had to edit twenty charts by hand, and every team knew which part was theirs.

Common mistakes

  • Putting the whole platform team as owner of every file. Reviews pile up and application teams start working around the process.
  • Letting the library chart grow options for every edge case. Each option is a promise to support it; push rare needs to raw manifests in the service folder.
  • Skipping rendered diffs. Reviewers approve value changes without seeing that a helper also changed the selector labels, which can break a running Deployment.
  • Giving every engineer the Argo CD admin role. Merge rights and sync rights should match the ownership model.
  • Keeping secrets in templates. Templates should reference secrets managed elsewhere; see secret management in GitOps workflows.

Learn the tooling hands-on

Helm, Kustomize, Argo CD and Kubernetes RBAC are easier to understand when you build the layers yourself on a test cluster. Our DevOps training covers GitOps with Argo CD, and the CKA training goes deeper into RBAC and cluster administration. Classes run in our Kharadi, Pune classroom and live online across India.

FAQ

Who should own Helm charts in a GitOps setup?

The platform team should own shared library charts and base templates that carry organisation-wide rules. Application teams should own the chart or values for their own services. Production overrides usually need review from both.

How do I enforce template ownership in Git?

Add a CODEOWNERS file that maps paths to teams and turn on the branch protection setting "Require review from Code Owners". Owners need explicit write access to the repository, and the last matching pattern in the file wins.

What is a Helm library chart?

A chart with type: library in Chart.yaml that only defines named templates. It cannot be installed directly. Application charts list it as a dependency and call its helpers with include.

How does Argo CD enforce ownership at runtime?

AppProjects restrict which repositories, clusters, namespaces and resource kinds each group of applications may use, and project roles limit who can sync. A merged manifest outside those limits will not deploy.

Should application teams be allowed to fork shared templates?

Avoid it. Forks copy the organisation rules and then drift. Give teams a way to request new options in the shared template and allow raw manifests in their own folder for true one-off needs.

Where do admission policies fit if we already review templates?

They catch anything that bypasses the templates, such as hand-written YAML or an old chart version. Keep the policies under platform and security ownership and run them in CI as well as in the cluster.

How do we roll out a breaking template change safely?

Release it as a new major version with a migration note, open upgrade pull requests per service, put any matching admission policy in audit mode first, and switch to enforcement after the agreed window.

References

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.