SRE Automation Tools & Infrastructure as Code 3 — Questions and Answers
Question 1: What is the primary advantage of using Terraform modules?
- They speed up the terraform apply command
- They enable reuse of infrastructure configuration across projects (Correct answer)
- They automatically fix configuration drift
- They provide built-in secret management
Correct answer: They enable reuse of infrastructure configuration across projects
Terraform modules package and reuse infrastructure configuration, allowing teams to standardize common patterns across multiple projects.
Question 2: In Kubernetes, what does a Helm chart provide?
- Real-time cluster performance metrics
- A package of pre-configured Kubernetes resources (Correct answer)
- Automatic horizontal pod scaling rules
- Network policy enforcement
Correct answer: A package of pre-configured Kubernetes resources
A Helm chart is a collection of files that describe a related set of Kubernetes resources, functioning as a package manager for Kubernetes.
Question 3: Which concept describes automatically fixing infrastructure that has drifted from its desired state?
- Continuous delivery
- Self-healing (Correct answer)
- Blue-green deployment
- Configuration drift
Correct answer: Self-healing
Self-healing systems automatically detect and correct deviations from the desired state without manual intervention.
Question 4: What is 'configuration drift' in an IaC context?
- Gradual degradation of CI/CD pipeline performance
- When actual infrastructure state diverges from the defined configuration (Correct answer)
- Slow loading of Terraform provider plugins
- Incremental updates to configuration files over time
Correct answer: When actual infrastructure state diverges from the defined configuration
Configuration drift occurs when the actual state of infrastructure diverges from what is defined in the IaC configuration, often due to manual changes.
Question 5: In Chef, what is a 'cookbook'?
- A log of all configuration changes applied to nodes
- A fundamental unit of configuration containing recipes and resources (Correct answer)
- A list of managed nodes and their roles
- A testing framework for Chef policies
Correct answer: A fundamental unit of configuration containing recipes and resources
A Chef cookbook is the fundamental unit of configuration and policy distribution, containing recipes, attributes, and other files needed to configure a system.
Question 6: Which approach does Puppet use to define infrastructure configuration?
- Procedural scripting with bash-like syntax
- Declarative manifests describing desired state (Correct answer)
- Imperative YAML playbooks with task lists
- Event-driven triggers with rule-based actions
Correct answer: Declarative manifests describing desired state
Puppet uses declarative manifests written in Puppet DSL to describe the desired state of a system, letting Puppet determine how to achieve it.
Question 7: What is the role of a CI/CD pipeline in an IaC workflow?
- It replaces the need for version control of infrastructure code
- It automates testing and deployment of infrastructure changes (Correct answer)
- It generates infrastructure code from application requirements
- It monitors infrastructure costs in real time
Correct answer: It automates testing and deployment of infrastructure changes
CI/CD pipelines automate the testing, validation, and deployment of infrastructure code changes, ensuring quality and consistency.
What is the primary advantage of using Terraform modules?