Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Associate Cloud Engineer practice bank has an additional 2,014 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
You have a Google Kubernetes Engine (GKE) cluster with Google Cloud Managed Service for Prometheus managed collection enabled. You are deploying a cluster-wide service mesh and need to collect metrics from proxy pods that share the label app.kubernetes.io/name: proxy-agent. These pods run across multiple distinct Kubernetes namespaces.
You need to define metric scraping for these pods using a single custom resource without deploying duplicate manifests into every namespace.
Which custom resource should you implement?
PodMonitoring is a namespaced Kubernetes custom resource in Google Cloud Managed Service for Prometheus designed to configure metric scraping for pods running within a single, specific namespace.
PodMonitoring resource can only discover and scrape pods located in the namespace where the resource itself is deployed. It cannot cross namespace boundaries.PodMonitoring, administrators would need to deploy and manage a separate PodMonitoring manifest in every individual namespace, violating the requirement to use a single custom resource.spec.selector.matchLabels exclusively within its local namespace.PodMonitoring object only affects metric collection within that particular namespace.This resource would be the right choice if your application pods were confined to a single dedicated namespace, or if tenant teams required self-service monitoring configurations isolated from other teams.
You can inspect all deployed PodMonitoring resources across the cluster using kubectl get podmonitoring -A, but each entry in that list operates only within its defined namespace.
MonitoringTarget is a custom resource used exclusively in Google Distributed Cloud (GDC) air-gapped environments to define workload scraping endpoints and collection frequencies for local monitoring systems.
MonitoringTarget belongs to the monitoring.gdc.goog/v1 API group designed for Google Distributed Cloud hosted environments, not Google Cloud Managed Service for Prometheus on GKE (monitoring.googleapis.com/v1).MonitoringTarget is deployed into specific project namespaces in the Management API server to collect metrics from workloads within that specific boundary.prometheus.io/port, prometheus.io/path) or static endpoint definitions inside the custom resource.MonitoringTarget custom resource definition.You were configuring metrics collection for workloads deployed inside an air-gapped Google Distributed Cloud environment using the Management API server.
When working with public Google Cloud and GKE, metric scraping target definitions are always configured using PodMonitoring or ClusterPodMonitoring.
ClusterPodMonitoring is a non-namespaced Kubernetes custom resource provided by Google Cloud Managed Service for Prometheus. It allows cluster operators to configure Prometheus scrape jobs that automatically discover and scrape metrics from pods matching specified label selectors across the entire cluster, spanning all existing and future namespaces.
ClusterPodMonitoring does not restrict its discovery process to a single namespace. It scans across all namespaces to locate any pod labeled app.kubernetes.io/name: proxy-agent.
PodMonitoring, including endpoints, interval, and metricRelabeling settings, while lifting the namespace restriction.ClusterPodMonitoring is specifically built for shared services, daemons, and cluster-wide agents like service meshes that operate across several namespaces. Using a single resource minimizes operational overhead and prevents configuration drift.
OperatorConfig is a specialized custom resource utilized by Google Cloud Managed Service for Prometheus to configure operator-level settings and credentials, primarily in environments outside of Google Kubernetes Engine.
OperatorConfig does not configure target scraping parameters, endpoint paths, ports, or pod label selectors.gmp-public namespace) to allow the collector to write metrics back to Google Cloud Monitoring.roles/monitoring.metricWriter IAM role.OperatorConfig unnecessary for basic authentication on GKE.You were configuring Google Cloud Managed Service for Prometheus on a self-managed Kubernetes cluster running on-premises or in another cloud and needed to supply authentication credentials to write metrics to Google Cloud.
Workload target discovery always relies on PodMonitoring or ClusterPodMonitoring, while administrative plumbing like OperatorConfig manages global operator connectivity.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated