Skip to content
tezvyn:

How do you architect self-service GitOps with central policy enforcement?

Source: docs.redhat.comHardHow cards are made

What it tests: balancing self-service GitOps with hard guardrails. A strong answer covers namespace-scoped controllers, OPA/Kyverno deny policies, and a centralized policy repo. Red flag: proposing manual ticket reviews instead of automated admission gates.

What's really being asked

This question evaluates whether you understand the tension between developer autonomy and platform governance in Kubernetes. The interviewer wants to see if you can separate the delivery mechanism from the enforcement boundary, and if you know how to use policy-as-code to make security guardrails self-service rather than bureaucratic.

The full answer

First, tenancy isolation for the GitOps layer itself, such as namespace-scoped Argo CD AppProjects or Flux RBAC, so each team can manage its own repositories and destinations without seeing another tenant's workloads. Second, an admission control strategy using OPA Gatekeeper or Kyverno to enforce deny policies at the API server, for example rejecting pods with privileged security contexts or services of type LoadBalancer in namespaces that are not explicitly allowlisted. Third, a centralized policy repository managed by the platform team that is continuously reconciled to the cluster, ensuring teams cannot override or disable constraints. Fourth, a clear separation between the source of truth for application manifests, which lives in team-owned repos, and the source of truth for cluster policy, which lives in a repo with restricted merge permissions. Fifth, optional but valuable, a pre-flight check in CI that surfaces policy violations early using the same constraint templates that run in the cluster, reducing feedback loops.

The mistakes people make

Proposing that the platform team manually reviews every pull request or ticket to enforce policy, which creates a bottleneck and contradicts the self-service goal. Suggesting CI-only checks without admission control, which leaves the cluster vulnerable to kubectl apply or compromised credentials. Recommending a single shared GitOps instance with cluster-admin access for all teams, which violates least privilege and makes lateral movement trivial. Proposing network policies as the primary enforcement for public load balancers, which is a mitigation but not a prevention strategy since the resource still gets created.

What usually comes next

How do you handle policy exceptions for a specific team during an incident? How do you prevent a tenant from consuming all cluster resources or creating thousands of objects in a GitOps loop? What is your strategy for secret management when teams need to inject credentials through GitOps? How do you audit drift if a user bypasses GitOps and modifies resources directly with kubectl?

A concrete example

Imagine a cluster with fifty application teams. Each team has an Argo CD AppProject scoped to their three namespaces. The platform team maintains a Kyverno policy in a central repo that mutates and validates every incoming service, rejecting any service of type LoadBalancer unless it carries an approved annotation. When a team commits a privileged container to their application repo, Argo CD syncs the manifest, but the Kyverno admission webhook blocks the pod creation and surfaces the violation in the GitOps UI. The team fixes the manifest without ever opening a ticket to the platform team, and the platform team retains audit logs of every denied request through Kubernetes audit events.

Interview question

Which architectural approach best balances developer autonomy with hard guardrails in a multi-tenant Kubernetes GitOps platform?

  • a.Allow teams to self-manage admission policies in their namespaces while the platform team audits violations post-deployment
  • b.Scope GitOps tenants to namespaces and enforce immutable deny policies via admission controllers synced from a restricted central repoCorrect
  • c.Share one cluster-admin GitOps instance across all teams and mitigate risky resources with network policies after creation
  • d.Centralize all application manifests and policies in one repo reviewed by the platform team, using CI linting as the sole enforcement point
Why?

Namespace-scoped GitOps with admission webhooks synced from a restricted policy repo lets teams self-service while preventing bypass at the API server. Relying on manual reviews or CI-only enforcement creates a bottleneck and leaves the cluster exposed to direct kubectl apply or compromised credentials.

Just read this? Test yourself on what you have been reading.

Read the original → docs.redhat.com

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on gitops — each one lists the topics its interview covers.

See open roles