Skip to content

Application Environments and Infrastructure Concepts: CNPA practice questions

An application environment is a place where a version of a service runs for a purpose: a developer's sandbox, a shared test or staging environment, production. A platform's job is to make environments cheap to create, consistent with each other and safely separated.

By Ibrahim Yesilay · Published · Updated

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

What Application Environments and Infrastructure Concepts covers in CNPA

An application environment is a place where a version of a service runs for a purpose: a developer's sandbox, a shared test or staging environment, production. A platform's job is to make environments cheap to create, consistent with each other and safely separated. The CNCF Platforms White Paper lists provisioning complete environments from templates, combining run-time and development-time services for scenarios such as web development or MLOps, among the use cases a maturing platform should meet. The maturity model shows the opposite case: a team that needed an isolated performance-test environment waited days, because the colleague who had built the last one had moved on and nobody knew how to recreate it.

Consistency comes from treating environment differences as configuration, not as different processes. DORA's deployment automation guidance lists three inputs to a deployment: the packages created by CI, which should be deployable to any environment including production; scripts to configure the environment, deploy the packages and run a smoke test; and environment-specific configuration. It recommends keeping scripts and configuration in version control, using the same deployment process for every environment and using the same packages for every environment. In Kubernetes, the environment-specific part is often a Kustomize overlay on a shared base, or one set of Helm values per environment.

Separation inside a cluster starts with namespaces. Object names only need to be unique within a namespace, and many security controls are namespace-scoped: RBAC Roles and NetworkPolicies apply within a namespace, so users and service accounts can be restricted to one. A ResourceQuota caps the aggregate resource consumption in a namespace and can limit how many objects of each kind are created there. The Kubernetes multi-tenancy documentation stresses that Kubernetes has no first-class tenant concept. A tenant may be a team or a customer, and isolation can range from namespaces in a shared cluster to a dedicated cluster per tenant; sharing saves cost and administration, and the benefit of stronger isolation has to be weighed against its cost and complexity.

Infrastructure concepts an associate should be comfortable with include the difference between compute, networking and storage services; ephemeral environments created on demand and deleted after use; and infrastructure as code, where infrastructure is described in versioned files just like application configuration. The white paper's infrastructure services domain names compute runtimes, programmable networks, and block and volume storage, with projects such as Kubernetes, KubeVirt, Knative, Cilium, Istio, Rook and Longhorn as examples.

Typical misconceptions are that a namespace is a security boundary on its own (it scopes policies but isolates nothing without RBAC, network policies and quotas), that staging must be a hand-maintained copy of production, and that each environment needs its own build. Building once and promoting the same artifact is what makes earlier test results meaningful.

Expect questions that ask how to isolate teams or environments, what belongs in environment-specific configuration, or why the same artifact and the same deployment process should move through every environment.

Key points

  • Use the same packages and the same deployment process for every environment; only configuration differs.
  • Namespaces scope names, RBAC Roles, NetworkPolicies and ResourceQuotas, but are not isolation on their own.
  • Kubernetes has no built-in tenant object; isolation ranges from shared clusters to a cluster per tenant.
  • Environment differences are usually expressed as Kustomize overlays or per-environment Helm values.

Three sample questions

9 CNPA questions on Application Environments and Infrastructure Concepts, 9 with explanations. How practice works

Question 1

Which of these Kubernetes objects is cluster-scoped rather than namespaced?
  1. A.PersistentVolume
  2. B.ResourceQuota object
  3. C.Service
  4. D.Deployment

Correct answer: A

kubernetes.io explains that namespace-based scoping applies only to namespaced objects such as Deployments and Services, and not to cluster-wide objects such as StorageClass, Nodes and PersistentVolumes. Why the other options are wrong. "ResourceQuota object": A ResourceQuota constrains aggregate resource consumption per namespace and is created inside the namespace it limits. "Service": kubernetes.io lists Services as an example of namespaced objects. "Deployment": kubernetes.io lists Deployments as an example of namespaced objects.

Sources: CNCF CNPA curriculum (CNPA_Curriculum.pdf), Kubernetes: Namespaces, Kubernetes: Resource quotas

Question 2

A namespace has a ResourceQuota that sets a limit on requests.cpu. A developer creates a Pod in it whose containers specify no CPU request or limit, and the request is refused. What is the most likely reason?
  1. A.ResourceQuota is enforced cluster-wide, so another namespace has already used up the shared CPU allowance.
  2. B.With a quota on CPU, Pods in the namespace must specify CPU requests or limits, or they can be rejected.
  3. C.ResourceQuota limits how many nodes a namespace may schedule onto, and this namespace has none left.
  4. D.ResourceQuota admits only Pods that are created by a Deployment and always rejects bare Pods.

Correct answer: B

The resource quota page states that if quota is enabled for compute resources such as cpu and memory, users must specify requests or limits for those values when they define a Pod; otherwise the quota system may reject pod creation. A request that would violate a quota is answered with 403 Forbidden. Why the other options are wrong. "ResourceQuota is enforced cluster-wide, so another namespace has already ...": A ResourceQuota applies per namespace, so other namespaces do not consume this one's allowance. "ResourceQuota limits how many nodes a namespace may schedule ...": ResourceQuota limits aggregate resource consumption and object counts per namespace; it does not assign nodes. "ResourceQuota admits only Pods that are created by a ...": Quota checks resource usage, not which controller created the Pod.

Sources: CNCF CNPA curriculum (CNPA_Curriculum.pdf), Kubernetes: Resource quotas

Question 3

An application needs about two minutes after start to load caches before it can serve requests, and it should not receive traffic during that time. Which probe does kubernetes.io describe for deciding when a container is ready to accept traffic?
  1. A.A PodDisruptionBudget
  2. B.A liveness probe
  3. C.A readiness probe
  4. D.A startup probe

Correct answer: C

kubernetes.io says readiness probes determine when a container is ready to accept traffic, which is useful when an application must first perform time-consuming tasks such as warming caches; a failing readiness probe takes the Pod out of the Service's endpoints instead of restarting it. Why the other options are wrong. "A PodDisruptionBudget": A PodDisruptionBudget limits voluntary disruptions; it is not a container probe and does not decide traffic readiness. "A liveness probe": Liveness probes decide when to restart a container; a failing liveness probe would restart the warming application rather than hold back traffic. "A startup probe": A startup probe verifies whether the application has started and holds back the other probes until it succeeds; deciding readiness for traffic is the readiness probe's job.

Sources: CNCF CNPA curriculum (CNPA_Curriculum.pdf), Kubernetes: Liveness, readiness and startup probes

Practice this topic

Focus mode keeps every question on Application Environments and Infrastructure Concepts 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.