Skaffold Multiple Profiles for GKE Replica Counts
Short answer
C Create multiple profiles, and configure the manifests.rawYaml section to override replica counts for each environment.
Question
Key Takeaways
The core concept tested is Skaffold's profile mechanism for overriding specific fields like replicas, with the common trap being the choice between Kustomize (which modifies structure) versus Raw YAML (which overrides values directly).
This question examines how to configure Skaffold profiles in skaffold.yaml to manage environment-specific Kubernetes replica counts while maintaining manifest consistency. It establishes that using multiple profiles with raw YAML is the optimal approach for minimizing overhead and ensuring configuration parity.
Common mistake: Many learners incorrectly select Option A, assuming Kustomize is required for any environment differentiation. However, Kustomize introduces structural changes and patching logic which adds complexity and potential drift compared to simple value overrides needed here.
Expert Analysis
Why the Answer Is Correct
Option C is correct because Skaffold allows you to define multiple profiles within a singleskaffold.yaml file. Each profile can override specific values in the deployment manifests. By using manifests.rawYaml, you can specify exact field overrides (like replicas) for each environment without altering the underlying YAML structure or requiring external tools like Kustomize. This ensures all other parameters remain consistent and minimizes maintenance overhead.Why the Other Options Are Wrong
Option A suggests using Kustomize, which involves creating patches and modifying the resource structure. While powerful, it is overkill for simple scalar overrides like replica counts and increases complexity. Options B and D suggest using a single profile, which cannot handle different configurations for development and production environments simultaneously within the same pipeline run context as effectively as distinct profiles.Community Comment Notes
Community feedback highlights the preference for "multiple profiles" to separate dev and prod concerns. One commenter noted thatkustomize is often chosen for its ability to change replica counts, but this overlooks the simplicity of raw YAML overrides for such specific, isolated changes. Exam Strategy
When configuring Skaffold, prioritize profiles for environment separation. Use rawYaml for direct value overrides (like replicas) to keep manifests simple and maintainable, reserving kustomize for more complex structural modifications.
Frequently Asked Questions
Why not use Kustomize for replica counts?
Can I use a single profile for both envs?
Discussion 1 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 1
-
BlackCoffee 👍 1 Answered Amultiple profiles for dev and prod, manifests.kustomize to change the replicas count for development and production
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All PCDOE Questions
Access 75 questions with complete answers and detailed explanations.
View Full PCDOE Practice Test →