Skip to content

Infrastructure Provisioning with Kubernetes: CNPA practice questions

Infrastructure provisioning with Kubernetes means using the Kubernetes API and its controllers to create and manage resources that live outside the cluster: cloud databases, buckets, networks, DNS records, even Git repositories. The idea follows from the controller pattern.

By Ibrahim Yesilay · Published · Updated

Independent community practice, not affiliated with or endorsed by CNCF or The Linux Foundation.

What Infrastructure Provisioning with Kubernetes covers in CNPA

Infrastructure provisioning with Kubernetes means using the Kubernetes API and its controllers to create and manage resources that live outside the cluster: cloud databases, buckets, networks, DNS records, even Git repositories. The idea follows from the controller pattern. The Kubernetes documentation describes controllers that read their desired state from the API server, communicate directly with an external system to bring reality in line, and then report the current state back. Applied to infrastructure, the cluster becomes a control plane for the cloud.

Crossplane is the best-known example and describes itself as a control plane framework for platform engineering. In its terms, a control plane exposes an API where you declare desired state, configures the software accordingly and then monitors it throughout its lifecycle, automatically correcting drift. Crossplane has four components. Managed resources are ready-made custom resources that each extend Kubernetes with the ability to manage an external system, for example an RDS instance, so you do not have to write a controller. Composition lets platform teams build their own APIs: a CompositeResourceDefinition (XRD) defines the schema of a new custom API, users create composite resources (XRs) against it, and a Composition, implemented as a pipeline of functions that can be written in YAML, KCL, Python or Go, configures which resources each XR creates. Operations run function pipelines to completion for tasks such as certificate monitoring and are an alpha feature. The package manager installs managed resources, functions and whole control plane configurations.

Managed resources follow the reconcile model directly. Crossplane treats spec.forProvider as the source of truth for the external resource: if someone changes the resource in the provider's web console, Crossplane reverts it to the configured value. Conditions shown by kubectl describe report whether the resource is Ready, for example Available or still Creating, and whether it is Synced, for example ReconcileSuccess or ReconcileError.

For a platform team, this approach brings infrastructure into the same workflow as applications: declarative manifests, GitOps delivery, Kubernetes RBAC, admission policies and a single API for everything. A developer can request a database by creating a small composite resource, and the platform's composition turns it into a correctly configured instance, network rules and connection details. The Platforms White Paper places Crossplane next to Kubernetes, the Operator Framework, Helm and KubeVela as examples of APIs for automatically provisioning capabilities.

Misconceptions: Kubernetes does not provision cloud resources out of the box, so a controller such as a Crossplane provider must be installed; provisioning through Kubernetes does not mean the resources run inside the cluster, because the database still lives in the cloud; and continuous reconciliation differs from a one-off provisioning script, which applies a change once and never notices later drift.

Expect associate-level questions on what a managed resource or a composition is, why a control plane corrects drift, and how a Kubernetes-based API lets developers provision infrastructure without direct cloud access.

Key points

  • Controllers can manage external systems: read desired state from the API, change the outside world, report back.
  • Crossplane managed resources represent external resources such as cloud databases as custom resources.
  • An XRD defines a custom API, a Composition maps it to resources, and users create XRs.
  • Crossplane reverts changes made outside it to match spec.forProvider.

Three sample questions

8 CNPA questions on Infrastructure Provisioning with Kubernetes, 8 with explanations. How practice works

Question 1

In Crossplane, which pair of resources creates a new custom API (a composite resource, XR)?
  1. A.A Helm chart and its values file
  2. B.An Operation and a CronOperation
  3. C.A managed resource and the Crossplane package manager
  4. D.A CompositeResourceDefinition (XRD) and a Composition

Correct answer: D

Crossplane's XRD documentation says you use two Crossplane types to create a new custom API: a Composite Resource Definition, which defines the XR's schema, and a Composition, which configures how the XR creates other resources. XRDs are like Kubernetes CRDs with Crossplane options such as connection secrets. Why the other options are wrong. "A Helm chart and its values file": Helm templates manifests; it is not how Crossplane defines composite APIs. "An Operation and a CronOperation": Operations run function pipelines to completion for operational tasks; they do not define APIs. "A managed resource and the Crossplane package manager": Managed resources are ready-made custom resources, and the package manager installs them and composition functions; neither defines the schema of a new composite API.

Sources: CNCF CNPA curriculum (CNPA_Curriculum.pdf), Crossplane: Composite resource definitions, Crossplane: Compositions

Question 2

What are Crossplane managed resources (MRs)?
  1. A.Templates that combine several resources into a single reusable unit for users
  2. B.Kubernetes Deployments that Crossplane marks as read-only, so that application teams cannot change them
  3. C.Terraform state files that Crossplane stores in a ConfigMap for each cloud account
  4. D.Ready-made custom resources whose controllers manage external resources, such as a cloud database

Correct answer: D

Crossplane's overview describes managed resources as ready-made Kubernetes custom resources; there is an extensive library for managing almost any cloud provider or cloud native software, for example an RDS instance API whose managed resource controller creates the instance in AWS. Why the other options are wrong. "Templates that combine several resources into a single reusable unit for users": That describes a Composition, which can include managed resources. "Kubernetes Deployments that Crossplane marks as read-only, so that ...": Managed resources are custom resource types, not marked Deployments. "Terraform state files that Crossplane stores in a ConfigMap ...": Crossplane manages external resources through controllers, not stored Terraform state.

Sources: CNCF CNPA curriculum (CNPA_Curriculum.pdf), Crossplane: What's Crossplane?

Question 3

According to the Crossplane documentation, what is Crossplane's key value for a platform team?
  1. A.It lets teams build custom resource APIs without writing controllers for them.
  2. B.It replaces Kubernetes with a separate orchestrator that is purpose-built for managing cloud resources.
  3. C.It provisions infrastructure once at creation time and then stops watching it.
  4. D.It only works with a single cloud provider, chosen when Crossplane is installed.

Correct answer: A

Crossplane's overview says its key value is unlocking the benefits of building your own Kubernetes custom resources without having to write controllers for them: instead of a controller, you configure a pipeline of functions that return declarative configuration for Crossplane to apply, and drift is corrected automatically. Why the other options are wrong. "It replaces Kubernetes with a separate orchestrator that is ...": Crossplane is built on Kubernetes and works with the Kubernetes tools you already use. "It provisions infrastructure once at creation time and then stops watching it.": A control plane monitors its resources throughout their lifecycle and corrects drift. "It only works with a single cloud provider, chosen when Crossplane is installed.": Crossplane's managed resource library covers almost any cloud provider or cloud native software.

Sources: CNCF CNPA curriculum (CNPA_Curriculum.pdf), Crossplane: What's Crossplane?

Practice this topic

Focus mode keeps every question on Infrastructure Provisioning with Kubernetes until you leave it. 10 free guest answers, then a free account; no credit card.

Or open CNPA practice across all topics.

Sources

The explanation above was checked against these official documents.