DevOps Interview Questions Overview
DevOps Interview Questions Overview
The blue-green deployment model involves running two identical environments referred to as 'Blue' and 'Green.' Only one is live (production) at any time, while the other is used for deployment and testing of new releases . This setup allows deployment without downtime, as traffic can be switched from the old version running on the 'Blue' environment to the new version on the 'Green.' The benefits include minimized downtime and risk since switching back to the older version is straightforward if issues arise. However, maintaining two environments can be resource-intensive and costly, especially for larger applications . The strategy is best suited for applications demanding high availability and uninterrupted user experience but requires careful resource management and monitoring to balance cost implications .
GIT is a distributed version control system, allowing each user to have a complete local copy of the repository, which can enhance performance and enable offline work . SVN, on the other hand, is a centralized version control system where the repository is maintained on a central server, and users commit their changes directly to this server. This difference affects collaboration in that GIT provides higher availability and resilience, as changes can be shared peer-to-peer without the need for a central server, whereas SVN relies on a central repository that could be a single point of failure. GIT also allows for non-linear development through branching and merging, which can facilitate more collaborative and parallel workflows compared to SVN’s linear commit history .
An Application Load Balancer (ALB) operates at the application layer (Layer 7), making it adept at routing based on content and capable of handling HTTP and HTTPS requests . It supports advanced routing, SSL termination, and WebSocket. A Network Load Balancer (NLB), on the other hand, operates at the transport layer (Layer 4), and it specializes in handling TCP traffic with high-throughput and low-latency performance . The choice between ALB and NLB depends on specific use cases: ALB is suitable for web applications requiring intricate request routing, while NLB is ideal for handling extreme TCP traffic loads or when static IP addresses are needed .
A Web Server is responsible for handling HTTP requests and serving static content such as HTML pages, images, and web files. It is best suited for simple websites with static content or front-end applications needing quick content delivery . An Application Server, however, provides a framework for running web applications and handles dynamic content by executing server-side scripts. It supports a range of enterprise-level functionalities such as transactions, messaging, and resource pooling, making it suitable for complex, data-driven applications . The selection between the two depends on the specific application's needs: web servers are preferred for straightforward, static content delivery, while application servers are necessary for complex, dynamic applications requiring interaction with databases and business logic processing .
'Git rebase' works by moving or combining a sequence of commits to a new base commit, effectively re-writing commit history . This can result in a cleaner project history by avoiding unnecessary merge commits. The primary benefits of rebasing include a more linear and comprehensible project history, as it applies changes on top of the current head of the branch . However, risks involve potential loss of commit history and conflicts, especially if rebase is performed on shared branches. 'Git merge', on the other hand, integrates changes from different branches by creating a merge commit and preserves the history of all branches involved. This keeps the project history intact but can lead to a less linear commit history with multiple merge commits .
Jenkins can handle backup and recovery through various mechanisms designed to secure and ensure continuity. Regular backups of Jenkins home directory, which includes configurations, jobs, build logs, and plugins, can be automated using scripts or plugins like ThinBackup or PeriodicBackup . These backups should be stored in a secure offsite location or cloud storage solutions to prevent data loss in case of server failure. Recovery involves restoring the back-up directory to a new Jenkins installation, ensuring that configuration files match the updated or identical plugin versions to maintain compatibility . Implementing a well-defined backup schedule and verifying restoration procedures are critical to maintaining data security and business continuity in case of unexpected failures .
EC2 Spot Instances allow users to take advantage of unused capacity at significantly reduced prices with the caveat of potential termination when capacity demands rise . They're ideal for transient, flexible jobs that can withstand interruptions. On-demand instances provide flexibility without long-term commitments, priced by the hour or second depending on the instance type, thus better suited for applications with unpredictable workloads . Reserved instances require long-term commitments (one to three years) and offer significant cost savings (up to 75%) over the standard on-demand model, making them suitable for predictable workloads . These pricing models guide cost optimization strategies by aligning instance types with workload stability and flexibility needs, allowing for strategic resource allocation to balance cost and availability .
In Jenkins, pipelines can be designed using a scripted or declarative syntax to automate the build, test, and deployment processes associated with continuous integration and continuous delivery (CI/CD). For example, a basic pipeline script can be configured to trigger upon code changes, build the code, execute tests, and, upon successful testing, deploy the application to a staging environment. Integration with tools like Nexus Repository Manager allows for storing build artifacts securely. An example scenario might involve a Jenkins pipeline configured to build a Java application, run unit tests, package the application, and deploy it to a Nexus repository as an artifact, ensuring that applications are tested and stored correctly before deployment to production .
A master-slave configuration in Jenkins allows the distribution of the workload across multiple machines, which can enhance the build process by optimizing resource usage and improving performance . This setup enables horizontal scalability by distributing builds to slave nodes, which can be tailored to specific tasks or projects, thereby freeing up the master node to handle coordination tasks efficiently. Additionally, it helps improve the reliability and uptime of the Jenkins server by decentralizing the execution of builds, reducing the risk of server overload and failure .
IAM roles are used to grant permissions to AWS services and entities dynamically, allowing secure temporary access to AWS resources, beneficial in scenarios requiring elevated access without embedding credentials directly into applications . Roles are suitable for services like EC2 instances or Lambda functions that require access to other AWS resources. IAM policies, on the other hand, are documents that define access permissions and are directly attached to users, groups, or roles. They are suitable for defining baseline permissions for specific AWS accounts or organizations . The dynamic, temporary nature of roles makes them more secure for applications and services compared to static policies directly attached to users, which are useful for consistent access control configurations .