11.1 Cloud Native CI/CD Pipelines & Build Tooling
Key Takeaways
- Continuous integration builds and tests every commit, continuous delivery keeps every build releasable behind a manual approval, and continuous deployment releases automatically with no human gate.
- Tekton and Argo Workflows are CNCF pipeline engines that model pipeline steps as Kubernetes custom resources executed in Pods.
- Building images inside a cluster without a privileged Docker daemon uses daemonless builders such as Kaniko, Buildah, or BuildKit in rootless mode.
- Cloud Native Buildpacks turn source code into an OCI image without a Dockerfile and can rebase a base-image security patch without a full rebuild.
- A CI system holding cluster credentials is a high-value target, which is why pull-based GitOps and short-lived OIDC federation have replaced long-lived kubeconfig secrets.
11.1 Cloud Native CI/CD Pipelines & Build Tooling
Quick Answer: Continuous Integration builds and tests every commit. Continuous Delivery keeps every successful build deployable, releasing on a human decision. Continuous Deployment removes that decision and ships automatically. In Kubernetes, pipelines increasingly run as Kubernetes objects — Tekton
Task/Pipelineand Argo Workflows — and images are built without a privileged Docker daemon using Kaniko, Buildah, BuildKit, or Cloud Native Buildpacks.
The official curriculum lists Application Delivery as a competency in its own right. This section covers the build-and-promote half; section 11.2 covers the GitOps half that puts the result into a cluster.
1. CI, CD, and CD — Three Different Things
commit ──► BUILD ──► TEST ──► PACKAGE ──► [approval] ──► DEPLOY
└──────── Continuous Integration ────────┘
└───────────── Continuous Delivery ──────────────────┘
(approval gate present)
└───────────── Continuous Deployment ────────────────┘
(no approval gate)
| Term | What is automated | Where it stops |
|---|---|---|
| Continuous Integration | Merge, build, unit and integration tests, static analysis, artifact creation | At a tested artifact |
| Continuous Delivery | Everything above, plus deployment machinery that is proven to work | At a human approval before production |
| Continuous Deployment | Everything, including the production release | Nowhere — every green commit reaches production |
Both CD variants abbreviate to "CD", which is why the exam-relevant discriminator is always the presence or absence of the manual gate.
2. A Cloud Native Pipeline End to End
[1] Commit to the application repository
[2] CI triggers:
• unit tests, linting, static analysis (SAST)
• dependency vulnerability scan
• build an OCI image (reproducible, multi-arch)
• generate an SBOM (Syft / Trivy)
• scan the image for CVEs (Trivy / Grype)
• sign the image digest (Cosign) + attach provenance
• push to the registry
[3] CI updates the image digest in the CONFIG repository
[4] An in-cluster GitOps controller notices the change
[5] Admission verifies the signature, then the rollout proceeds
The deliberate split between an application repository (source) and a configuration repository (manifests) is what allows CI to hold no cluster credentials at all — it writes a commit, and the cluster pulls. That is the security argument for GitOps as much as the workflow argument.
3. Kubernetes-Native Pipeline Engines
Traditional CI servers run pipelines on their own agents. Kubernetes-native engines model the pipeline itself as custom resources reconciled by a controller (the CRD pattern from section 5.3), so every step runs in a Pod with the cluster's own RBAC, quotas, scheduling, and autoscaling.
| Engine | Model | Notes |
|---|---|---|
| Tekton | Task, TaskRun, Pipeline, PipelineRun CRDs; each Step is a container | A CD Foundation project. Reusable Tasks are shared via Tekton Hub. |
| Argo Workflows | Workflow CRD expressing a DAG or step sequence | CNCF graduated, part of the Argo project. Strong for data, ML, and batch pipelines as well as CI. |
| Jenkins X / Jenkins Kubernetes plugin | Dynamic agents scheduled as Pods | Bridges an existing Jenkins estate onto Kubernetes |
| GitHub Actions / GitLab CI | Hosted runners, optionally self-hosted in-cluster | The most common starting point; not Kubernetes-native by default |
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: build-and-push
spec:
params:
- name: image
steps:
- name: build
image: gcr.io/kaniko-project/executor:latest
args:
- --dockerfile=Dockerfile
- --destination=$(params.image)
The advantage is uniformity: pipeline capacity autoscales like any other workload, secrets come from the same Secret objects, and there is no second permission model to maintain.
4. Building Images Without a Docker Daemon
Building an image inside a cluster used to mean mounting the node's Docker socket into a build Pod — effectively granting root on that node, since anything that can talk to the daemon can start a privileged container. Daemonless builders exist precisely to remove that:
| Tool | How it works |
|---|---|
| Kaniko | Executes Dockerfile instructions entirely in userspace inside a container; no daemon, no privileged mode |
| Buildah | Daemonless, rootless-capable builder from the Podman ecosystem; can build with or without a Dockerfile |
| BuildKit (rootless) | The modern Docker build engine, runnable standalone with parallel stage execution and better caching |
| Cloud Native Buildpacks | No Dockerfile at all — detects the language, applies a build image and a run image, and outputs an OCI image |
Why Buildpacks Matter
Buildpacks (a CNCF project, driven by the pack CLI and used by Heroku, Google Cloud, and Paketo) invert the responsibility model. Developers stop writing and maintaining Dockerfiles; the platform team maintains the base images. The killer feature is rebase: when a CVE lands in the base OS layer, buildpacks swap the run image underneath thousands of applications without rebuilding or re-testing any of them, because the application layer is unchanged.
5. Testing Stages
| Stage | Runs against | Typical tooling |
|---|---|---|
| Unit | Individual functions, no dependencies | Language test frameworks |
| Integration | Real dependencies in throwaway containers | Testcontainers, kind clusters in CI |
| Contract | The agreed interface between two services | Pact and similar |
| End-to-end | A deployed environment | Cypress, Playwright, k6 |
| Policy / manifest | The YAML itself, before it ever reaches a cluster | kubeconform, conftest, Kyverno CLI |
| Security | Source, dependencies, and the built image | SAST, SCA, Trivy, Grype |
Validating manifests in CI is disproportionately valuable: a schema error or a policy violation caught in a pull request costs seconds, while the same error caught at admission costs a failed rollout.
6. Securing the Pipeline
CI is a privileged system that writes the artifacts your cluster runs. Treat it as production:
| Risk | Control |
|---|---|
| Long-lived cluster credentials in CI | Use pull-based GitOps so CI never touches the cluster, or OIDC federation for short-lived tokens |
| Compromised dependency injected at build | Pin versions with lockfiles, verify checksums, use a curated internal proxy |
| Tampering between build and deploy | Sign the digest with Cosign and verify at admission |
| "Which pipeline built this?" | Emit SLSA provenance / in-toto attestations |
| Secrets leaking into logs or layers | Use build secrets that are never committed to a layer; scan for leaked credentials |
| A malicious pull request running privileged CI | Require approval before running workflows from forks; isolate build runners |
The recurring theme is that the pipeline is part of the attack surface. An attacker who can modify a pipeline definition does not need to break into the cluster at all — the cluster will happily deploy whatever the pipeline produces, which is exactly why signature verification at admission is the control that matters.
What distinguishes continuous deployment from continuous delivery?
Why do cloud native pipelines use Kaniko or Buildah instead of mounting the node's Docker socket into a build Pod?
What advantage do Cloud Native Buildpacks offer over hand-written Dockerfiles when a CVE is found in the base operating system layer?