Operational excellence and ownership
Operational excellence starts with clear ownership
Operational excellence is the ability to deliver and maintain reliable services through repeatable procedures, explicit accountability and feedback. Terraform manages declared infrastructure during runs; Kubernetes controllers repeatedly reconcile desired and observed state. GitOps is a delivery approach in which a controller reconciles resources toward a versioned declaration. More than one tool may interact with an object, but avoid competing writers of the same desired-state fields.
Fictional ownership registerObject/field Desired-state writer Verification ownerCluster network Terraform platform team Network teamApplication Deployment GitOps application team Service teamReplica count with HPA Autoscaler Service teamDatabase schema Migration job Database teamDatabase instance Terraform data team Database teamThe table is a fictional division of responsibilities, not a product requirement. The HPA (Horizontal Pod Autoscaler) adjusts replica count. If another tool continually resets that count, both controllers can fight. Configure the GitOps and provider behavior to respect the chosen field owner, and verify the actual mechanisms for your versions. A broad ignore rule can hide security changes, so use narrow, justified exceptions and test them.
Transfer responsibility deliberately
Ownership transfer needs a source owner, receiving owner, stable identity, dependency mapping, a safe pause of conflicting reconciliation, approval and post-transfer verification. A Terraform removed block with destroy set to false can relinquish management while preserving a remote object. This does not transfer it automatically to another tool. The receiving configuration and reconciliation behavior must be independently reviewed. A temporary handoff gap needs a named human owner and a bounded time window.
# Illustrative only; replace the original resource declaration.removed { from = example_application.worker lifecycle { destroy = false }}# Fictional resource; no provider configuration supplied.Review the removal plan, preserve the identity and verify that dependent references are updated. The receiving GitOps controller must adopt or manage the intended object without replacing it; verify its specific adoption, pruning and field ownership behavior before enabling reconciliation. Conversely, when adopting into Terraform, pause the old desired-state writer through a safe, approved mechanism before importing. If both tools still actively own a conflicting field, stop the handoff. Never assume deleting a GitOps declaration preserves the live object: pruning may delete it.
Drift: investigate before choosing a direction
Drift means actual infrastructure differs from the intended declaration or last recorded state. It may result from an approved emergency intervention, external controller, accidental manual modification, stale credentials or observation failure. First identify the affected object and verify that the runner is accessing the correct account, region and workspace. Capture sanitized evidence; distinguish unavailable readings from genuine absence. Decide whether to restore declared intent or formally adopt an approved difference.
# Authorized CLI workflow shapes; not executed here.terraform plan -refresh-only# Review observed state changes; refresh-only does not edit HCL.terraform plan# Inspect the difference between refreshed reality and desired intent.Refresh-only planning proposes state/output reconciliation, not configuration editing or remediation of the remote service. Applying a refresh-only plan commits that state update. To retain an approved change, update configuration and review a normal plan; to revert unauthorized drift, plan the intended correction after security and dependency review. If the change is suspicious, preserve audit evidence and involve security before altering it. Do not blanket-ignore changes just to get a clean plan.
Respond to incidents using evidence
An incident is a disruption or significant threat to a service objective. Establish an incident lead, service owner, infrastructure operator and communications owner. Pause automated rollout expansion in the affected scope when continued changes could worsen the incident. Gather the run ID, approved revision, provider diagnostics, observed operation status, service metrics and data consistency checks. Protect logs from disclosure of credentials and customer records. Classify impact and choose containment, forward correction or tested recovery based on current conditions.
Fictional incident cardIncident: PD-17 | Owner: incident lead | severity: service degradedObserved: worker errors rising after partial infrastructure changeContainment: halt rollout; preserve state/run and service evidenceUnknown: database writes after cutover, pending provider operationDecision: data owner verifies writes; infra owner prepares fresh planExit: service metrics recovered, reconciliation and follow-up approvedEscalate when there is possible data loss, security exposure, unexplained provider activity or an exceeded recovery objective. Never run a broad destroy, force-unlock or state restore as a generic incident response. A lock may belong to a live writer. Verify the operator and actual operation status; use the documented recovery procedure for the specific backend. Communicate known facts and uncertainty rather than guesses.
Verify reliability after the change
Define service-level indicators such as success ratio, latency percentiles, queue age, transaction reconciliation and backup freshness. Assign alert owners and an observation period. A deployment can finish before downstream operations converge, so verify asynchronous work and eventual readiness. Record what changed, what failed, time to detect and recover, and corrective follow-up. For planned changes, compare actual cost and resource utilization with the estimate. A repeatable checklist supports review but should not substitute for judgment.
Example verification recordChange PD-22: approved revision r17, plan artifact digest recordedInfrastructure: expected identities retained; no unexpected plan diffService: 30-minute sample and business reconciliation completeData: recovery rehearsal meets fictional RTO/RPOOwnership: platform, application and database owners acknowledgeDecision: complete observation; cleanup remains separately gatedStore a sanitized evidence record with dates, owner and links to restricted artifacts, not raw secrets. If checks disagree, hold the change open. A passing test model is evidence only for the modeled conditions; use actual telemetry in production.
Decommission without deleting dependencies
Retirement is a distinct change. Identify consumers, routes, DNS, access grants, replication, monitoring, jobs and retained data. Confirm traffic drained, retention rules satisfied, data exports or recoverability verified, downstream owners approve and a reviewed destruction plan identifies exact resources. Remove or disable old credentials and automation after handoff, while preserving required audit evidence. Removing an object from Terraform state is not physical retirement: it can leave an orphan that incurs cost and remains accessible. Conversely, destroying an object may erase data or disrupt another service. Keep a retirement register with residual resources, retention expiry, cost and named owner. If a gate is missing, defer retirement.
Retirement gate (all required in this exercise)No active consumers | retention cleared | recovery evidenceOwner approval | reviewed scope | no active writer or pending operationUse the offline decision exercise to distinguish ownership transfer, corrective change, incident escalation and retirement. The final chapter will combine architecture, security, cost, migration and recovery in a professional multi-cloud capstone.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Operational excellence and ownership — knowledge check
Review migration, release and operational ownership decisions.
Who should own a replica count managed by HPA?
What does removed with destroy=false do?
What does refresh-only apply change?
An apply fails after a possible provider commit. What next?
When is retirement safe to approve in the worksheet?