DevOps

1. What is DevOps?

  • To shorten the software development lifecycle and deliver high-quality software continuously.
  • Key Pillars: Collaboration, Automation, Continuous Integration/Delivery, and Monitoring.

2. Key Principles of DevOps

  • Automation: Automate repetitive tasks to save time and reduce errors.
  • Collaboration: Encourage communication between Dev and Ops teams.
  • Continuous Improvement: Regular updates and feedback loops.
  • Customer-Centric Action: Focus on user needs.
  • End-to-End Responsibility: Teams own the product from development to deployment.

3. Important DevOps Tools

PurposeTool Examples
Version ControlGit, SVN
Continuous IntegrationJenkins, Travis CI
Configuration MgmtAnsible, Puppet, Chef
ContainerizationDocker, Podman
Orchestration – Coordination of multiple IT processesKubernetes, Docker Swarm
MonitoringNagios, Prometheus
Cloud ServicesAWS, Azure, GCP

4. Core DevOps Concepts

  • Continuous Integration (CI): Frequently integrating code into a shared repository to detect errors early.
  • Continuous Delivery (CD): Automating the release of code changes to production.
  • Infrastructure as Code (IaC): Managing infrastructure using code (e.g., Terraform).
  • Microservices: Breaking applications into small, independent services.
  • Containers: Packaging applications and dependencies together (e.g. Docker).

5. Popular DevOps Pipelines

  • Plan: Define requirements (e.g., Jira, Trello).
  • Develop: Write and commit code (e.g., Git).
  • Build: Compile code and run tests (e.g., Maven, Gradle).
  • Test: Automated testing (e.g., Selenium, JUnit).
  • Release: Deploy changes (e.g., Jenkins, Spinnaker).
  • Operate: Monitor and manage apps (e.g., Prometheus).

6. Common DevOps Practices

  • Version Control: Track code changes (e.g., Git).
  • Automated Testing: Test code using tools (e.g., Selenium).
  • Infrastructure Automation: Use scripts to set up servers (e.g., Ansible).
  • Monitoring and Logging: Keep track of performance (e.g., ELK Stack).

7. Benefits of DevOps

  • Faster delivery of software.
  • Improved collaboration between teams.
  • Early detection of bugs.
  • Increased automation reduces manual effort.

8. Challenges in DevOps

  • Resistance to change.
  • Lack of skilled professionals.
  • Tool integration complexity.
  • Security concerns in CI/CD pipelines.

9. Cloud and DevOps

  • DevOps often uses cloud platforms (AWS, Azure, GCP) for scalable infrastructure.
  • Cloud provides flexibility, scalability, and cost-effectiveness for DevOps processes.

10. Key Terms to Remember

  • Blue-Green Deployment: Deploy new changes without downtime by having two environments.
  • Canary Deployment: Gradual release of updates to a small group before full rollout.
  • Rolling Deployment: Updates are applied gradually without downtime.
  • GitOps: Managing infrastructure using Git as a single source of truth.

11. Popular Exam Topics

  • DevOps Lifecycle: CI/CD, Automation, Monitoring.
  • Tools and Use Cases: Jenkins (CI), Docker (Containers), Kubernetes (Orchestration).
  • IaC Concepts: Terraform, Ansible.
  • Version Control: Git commands (clone, push, pull, merge).
  • Containers vs Virtual Machines: Lightweight containers vs heavy VMs.

12. Sample Commands

  • Git:
  • git init: Initialize a repository.
  • git clone [URL]: Clone a repository.
  • git add .: Add all changes to staging.
  • git commit -m "message": Commit changes.
  • git push: Push changes to remote.
  • Docker:
  • docker build -t image_name .: Build a Docker image.
  • docker run -d -p 8080:80 image_name: Run a container.
  • docker ps: List running containers.
  • docker stop [container_id]: Stop a container.
  • Kubernetes:
  • kubectl get pods: List running pods.
  • kubectl apply -f file.yaml: Deploy resources.
  • kubectl delete pod pod_name: Delete a pod.

13. Last-Minute Tips

  • Remember core DevOps tools and their purposes.
  • Understand CI/CD pipelines and how they improve software delivery.
  • Focus on IaC tools like Ansible and Terraform.
  • Know containerization basics with Docker and orchestration with Kubernetes.
  • Practice basic commands for Git, Docker, and Kubernetes.
  • Stay updated on popular DevOps practices and cloud integrations.

MCQ

1. What does DevOps stand for?

  • a) Development Optimization Services
  • b) Development and Operations
  • c) Developer Options
  • d) Deployment Operations

2. Which of the following is NOT a DevOps principle?

  • a) Automation
  • b) Continuous Feedback
  • c) Isolated Teams
  • d) Collaboration

3. Which tool is primarily used for continuous integration?

  • a) Jenkins
  • b) Kubernetes
  • c) Docker
  • d) Ansible

4. What is the main purpose of containerization in DevOps?

  • a) To automate code testing
  • b) To manage infrastructure as code
  • c) To create lightweight and portable application environments
  • d) To provide version control for code

5. Which tool is used for container orchestration?

  • a) Docker
  • b) Kubernetes
  • c) Terraform
  • d) Git

6. What does CI/CD stand for?

  • a) Continuous Integration/Continuous Deployment
  • b) Continuous Infrastructure/Continuous Delivery
  • c) Cloud Integration/Cloud Deployment
  • d) Code Integration/Code Development

7. Which DevOps tool is used for infrastructure automation?

  • a) Nagios
  • b) Terraform
  • c) Selenium
  • d) Prometheus

8. Which of the following is NOT a DevOps practice?

  • a) Continuous Monitoring
  • b) Continuous Integration
  • c) Manual Testing
  • d) Infrastructure as Code

9. What is the primary role of version control systems like Git in DevOps?

  • a) Automating deployments
  • b) Monitoring performance
  • c) Tracking changes in code
  • d) Orchestrating containers

10. Which of the following tools is used for monitoring in DevOps?

  • a) Jenkins
  • b) Nagios
  • c) Ansible
  • d) Docker

11. What is the purpose of the docker-compose tool?

  • a) To build Docker images
  • b) To manage multiple containers as a single application
  • c) To monitor container performance
  • d) To deploy containers on Kubernetes

12. What is the main benefit of using Infrastructure as Code (IaC)?

  • a) Reduces collaboration effort
  • b) Ensures manual configuration of servers
  • c) Enables consistent and repeatable infrastructure setup
  • d) Increase code compilation speed

13. What does the kubectl command do?

  • a) Manages Docker images
  • b) Deploys and manages Kubernetes clusters
  • c) Monitors system logs
  • d) Configures CI/CD pipelines

14. Which of the following is a Continuous Monitoring tool?

  • a) Jenkins
  • b) Prometheus
  • c) Docker
  • d) Git

15. Which deployment strategy involves two environments, one active and one idle?

  • a) Rolling Deployment
  • b) Blue-Green Deployment
  • c) Canary Deployment
  • d) Recreate Deployment

16. What is the main purpose of a CI/CD pipeline?

  • a) To manage virtual machines
  • b) To integrate and deliver code changes automatically
  • c) To replace manual code development
  • d) To design container images

17. Which of the following is NOT a feature of Kubernetes?

  • a) Automatic scaling
  • b) Service discovery
  • c) Continuous Integration
  • d) Load balancing

18. What is the command to initialize a Git repository?

  • a) git start
  • b) git init
  • c) git clone
  • d) git push

19. What is Ansible primarily used for?

  • a) Container orchestration
  • b) Infrastructure automation
  • c) Application monitoring
  • d) Code testing

20. What is a “Canary Deployment”?

  • a) Gradual rollout of new features to a subset of users
  • b) Deploying a new application version to all users immediately
  • c) Using containers for deployment
  • d) Deploying applications without downtime

21. Which of the following commands lists running Docker containers?

  • a) docker list
  • b) docker ps
  • c) docker show
  • d) docker run

22. What does the git pull command do?

  • a) Pushes local changes to the remote repository
  • b) Pulls changes from the remote repository to the local repository
  • c) Deletes files from the repository
  • d) Clones a repository

23. Which tool is best suited for container security scanning?

  • a) Prometheus
  • b) Jenkins
  • c) Docker Bench
  • d) Nagios

24. What is the purpose of the Helm tool in Kubernetes?

  • a) To automate CI/CD pipelines
  • b) To monitor Kubernetes nodes
  • c) To manage Kubernetes applications using charts
  • d) To create Docker images

25. Which of the following is a benefit of using DevOps?

  • a) Increased software delivery speed
  • b) Isolated team silos
  • c) Reduced need for collaboration
  • d) Longer development cycles