Course: Cloud Computing Technologies
Authors: Jacopo Marino, Fulvio Risso, Stefano Galantino, Politecnico di Torino
Source: DevOps and GitOps, 38 PDF pages (printed slides 1–38, matching PDF page numbers 1:1; slide 38 lists References).
Lecture numbering: 14 is inferred from its position in the course sequence after Lecture 13. The source was supplied in the study session and remains outside the published resources.

Learning route

Lecture 12 introduced CI/CD, GitOps, and Infrastructure as Code (IaC) as ways to close Factor X’s dev/prod parity gaps, and Lecture 11 showed how Kubernetes reconciles declarative YAML resources. This lecture unpacks the entire operational automation story from first principles. Part I (PDF pp. 2–12) defines DevOps, distinguishes Continuous Integration (CI), Continuous Delivery (CD), and Continuous Deployment, and maps the 8-phase infinity loop. Part II (PDF pp. 13–23) introduces Infrastructure as Code (IaC), Terraform’s Provider model and Write -> Plan -> Apply workflow, and its community fork OpenTofu. Part III (PDF pp. 24–34) presents GitOps (Git + Operations), its four components, the end-to-end workflow with ArgoCD, and its pros and cons. Part IV (PDF pp. 35–37) explains why declarative configuration and idempotency underpin all of these systems.

Exam priorities

Focus on: distinguishing CI, Continuous Delivery, and Continuous Deployment (and why CD depends on CI); why IaC replaces manual provisioning; Terraform’s Provider architecture and Write -> Plan -> Apply dependency ordering (plus the Terraform State File role); the 4 components of a GitOps workflow, Slide 27’s "Config files" : "Infrastructure" = "App Source Code" : "App binaries" analogy, and tracing the Slide 29 end-to-end GitOps diagram; GitOps risks—especially configuration drift and Git repository security; and declarative vs. imperative configuration alongside idempotency. Historical dates in the OpenTofu timeline (Slide 21), specific tool logos on the DevOps loop (Slide 12), and the Proxmox/ArgoCD demo outlines serve primarily as supporting context.

Part I: DevOps and CI/CD Pipelines

Before the DevOps movement (~2007), software developers wrote code separately from IT operations teams who deployed and supported it, creating organizational silos and slow, brittle handoffs. DevOps (Development + Operations) unites practices, tools, and culture into one continuous process spanning planning, building, testing, deployment, and operations.

  • Continuous Integration (CI): Developers merge changes to the shared main branch early and often, triggering automatic builds and tests (BUILD -> TEST -> MERGE).
  • Continuous Delivery (CD): Extends CI by automatically packaging the tested artifact with everything needed to deploy to any environment and releasing it to a repository, keeping production deployment ready at any time via a manual trigger.
  • Continuous Deployment: Removes the manual gate so that validated changes meeting pre-set criteria deploy automatically to production. Crucially, you can do CI without CD, but you cannot really do CD without CI already in place (Slide 9).
  • DevOps Lifecycle: Represented as an infinity loop of 8 iterative phases—Discover, Plan, Build, Test (development) and Deploy, Operate, Observe, Continuous Feedback (operations)—surrounded by continuous Collaboration and Communication. DevOps and CI-CD Pipelines

Part II: Infrastructure as Code, Terraform, and OpenTofu

Even with application CI/CD, manual infrastructure provisioning through cloud dashboards or ad-hoc APIs (“click-ops”) remains fragile and opaque. Infrastructure as Code (IaC) codifies VMs, networks, load balancers, and databases into text files committed to version control such as Git, bringing visibility, change management, automated testing, and repeatability.

HashiCorp Terraform provisions both cloud and on-premises resources using Providers—plugins that translate configuration blocks into calls to any target platform’s API (e.g., AWS, Azure, Google Cloud, Datadog, Proxmox). Every change follows a 3-stage workflow: Write (define desired resources alongside the Terraform State File), Plan (terraform plan previews what will be created, updated, or destroyed), and Apply (executes changes in dependency order, such as recreating a modified VPC before scaling VMs inside it, then updating state). Following HashiCorp’s August 2023 switch to the BSL license, the community forked Terraform under the Linux Foundation as OpenTofu (first stable release January 2024)—a drop-in replacement preserving HCL files and workflows, demonstrated in the deck by cloning a Proxmox VM from a template and testing via SSH. Infrastructure as Code Terraform and OpenTofu

Part III: GitOps Workflow, ArgoCD, and Tradeoffs

GitOps (Git + Operations) applies DevOps practices—Git version control, pull-request review, compliance, and CI/CD—directly to infrastructure automation: "Config files" : "Infrastructure" = "App Source Code" : "App binaries" (Slide 27). A GitOps workflow combines four key components: (1) a Git repository as the single source of truth, (2) a CD pipeline to build/test/update configs, (3) a deployment (GitOps) tool that automatically applies repo changes to the target environment, and (4) a monitoring system feeding operational feedback back into Git.

In the full cycle (Slide 29), application code is built into a container image pushed to an Image Repo, triggering a Config Update in the infrastructure/app-infra Git repository, which the GitOps tool (such as ArgoCD, Slide 30) continuously synchronizes across target clusters (Cluster One, Cluster Two). In practice, non-sensitive environment variables can live in Git YAML, while secret keys must never be committed in plaintext—teams instead use a Secret Manager (Vault/cloud secrets), encrypted Git secrets (Sealed Secrets/SOPS), or CI/CD secret injection with encrypted Terraform state. Key benefits include full version history/rollbacks, PR collaboration, repeatability, automated delivery, and compliance audits; major drawbacks include upfront complexity, steep learning curves, small-change overhead, tooling dependency, configuration drift from manual out-of-band edits, and concentrated security risk if the Git repo is compromised. GitOps Workflow Components and Tradeoffs

Part IV: Shift Towards Declarative Configuration

Underlying IaC, GitOps, and Kubernetes is a shift from imperative procedures (how to step-by-step build something) to declarative configuration (what the desired end state should look like). A declarative model provides idempotency—applying the same configuration multiple times always yields the exact same system state—which prevents errors in automated pipelines that run repeatedly. It also improves simplicity and clarity, fits cleanly into Git version control and collaboration, scales maintainability across large fleets, simplifies security/compliance auditing, and enables fast disaster recovery back to a known-good state. Declarative Configuration and Idempotency

Source map

PDF pagesPrinted slidesTopic
11Title (DevOps and GitOps, Jacopo Marino, Fulvio Risso, Stefano Galantino, Politecnico di Torino)
2–42–4DevOps introduction (Development + Operations), ~2007 origin, ending silos, toolchain fundamentals
5–95–9Continuous Integration (CI), Continuous Delivery (CD), Continuous Deployment, and CI-before-CD dependency rule
10–1210–12DevOps Lifecycle: 8-phase infinity loop (Discover/Plan/Build/Test + Deploy/Operate/Observe/Continuous Feedback) and tool examples
13–1613–16Infrastructure as Code (IaC): automating provisioning, text files in Git, benefits, and oversight vs. manual cloud dashboards
17–2017–20Terraform: cloud/on-prem scope, Providers -> Target API, Write / Plan / Apply workflow + VPC/VM dependency order + State File
21–2321–23From Terraform to OpenTofu: Aug 2023 BSL change -> OpenTF Manifesto -> Linux Foundation -> Jan 2024 stable drop-in replacement; HCL example; Proxmox VM clone + SSH demo
24–2724–27GitOps (Git + Operations): applying DevOps to infra automation; "Config files" : "Infrastructure" = "App Source Code" : "App binaries"
28–3028–30GitOps components & workflow: 4 key components, end-to-end GitOps multi-cluster diagram, and ArgoCD Deployment / replicas sync demo
31–3431–34GitOps Pros (1–7) and Cons (1–7): version control, PRs, automation, compliance vs. complexity, overhead, configuration drift, and Git security risk
35–3735–37Shift towards declarative configuration: simplicity, idempotency, version control, scalability, compliance, and disaster recovery
3838References (GitLab CI/GitOps, Red Hat CI/CD, Atlassian DevOps/IaC, HashiCorp Terraform, Spacelift/OpenTofu, Rafay GitOps)

Retrieval questions

  1. A pipeline automatically builds, tests, and pushes a container image to a registry on every commit, while an engineer manually clicks a button on Fridays to deploy it to production. Which stage is this, and why can’t a team skip CI and jump straight to Continuous Delivery or Deployment?
    This is Continuous Integration + Continuous Delivery (manual production gate). Replacing the manual button with automated validation-gated releases produces Continuous Deployment. You cannot skip CI because automating delivery without frequent integration and automated tests only ships broken or conflicting code faster.
  2. In Terraform/OpenTofu, you edit a config to change a VPC setting (forcing VPC replacement) and scale the VMs inside it from 3 to 5. What happens during Plan and Apply?
    Plan compares your config against the Terraform State File and previews the exact creates, updates, and destroys before touching live infrastructure. Apply respects dependencies by recreating the VPC first and then scaling the VMs, updating the state file afterward.
  3. Trace the Slide 29 GitOps workflow from an application code change to two live Kubernetes clusters, naming the four core GitOps components.
    The four components are the Git repository (single source of truth), CD pipeline, deployment/GitOps tool, and monitoring system. An app commit triggers the build/CI pipeline to push an image to the Image Repo and emit a Config Update to the infra/app Git repo; the GitOps tool (e.g., ArgoCD) watches that repo and automatically syncs Cluster One and Cluster Two, while monitoring feeds adjustments back into Git.
  4. Why must secret keys never be stored in plaintext in a GitOps repository, and what are two safe ways they reach a VM or container instead?
    Because Git is the control plane for the whole system, compromising the repo exposes all credentials (Slide 34). Teams either store only secret names in Git and fetch values at runtime from a Secret Manager (Vault/cloud secrets), or commit encrypted ciphertext (Sealed Secrets/SOPS) decrypted only inside the target cluster.
  5. Define idempotency in declarative configuration and contrast what happens when an imperative script vs. a declarative config is applied twice.
    Idempotency means applying the same configuration multiple times always produces the exact same system state. An imperative script (“create VM”) run twice can duplicate resources or fail on existing ones, whereas a declarative config (“2 VMs exist”) converges cleanly to the same desired state.