DevOps Interview Questions.
DevOps Interview Questions.
Q - what is AMI?
A - AMI is an Amazon machine image mainly contains operating system and configuration files which is
mainly used to deploy multi virtual machines, regardless of any AWS region
A- EC is a virtual machine that represents your physical machine for you to deploy an application
General purpose, compute optimised, memory, optimised, accelerated, compute instance, storage
optimisation, instance
A Block storage-elastic block storage, instant storage, both comes under block storage itself only
Elastic file system is mainly used for Linux operating system. Aws fSx is mainly useful Windows operating
system.
Challenges with instant storage-it’s a temporary storage data will be lost if you stop and start the
instance
Can be increased to 16 TB
A- Application load balancer works on TP and TPS protocol and network load balancer works on TCP and
UDP protocol. Even application load balancer works on TCP protocol, but application load balancer
doesn’t support UDP.
Because UDP is very efficient protocol when we are using streaming application or online meetings or
any sort of streaming things, it is very useful. This is not supported by application load balancer. This is
the major difference.
The major disadvantage with the network load balance is HTTP to https direction is not possible and also
web application file was not supported.
A- vertical scaling -increasing resource of existing servers, example T2 micro 2 T2 large needs to stop and
start if we have multiple servers and we want to change the size of the instance it is not possible so we
choose horizontal scaling example DB servers, file, servers, APP servers for this server, vertical scaling is
best suited
Horizontal scaling-it will automatically create servers while the load is increasing
A - latency -latency means it will take the nearest data centre. To avoid the latency.
Failover -if one server goes down, the secondary server will take over
Weighted -example, there are a lot of uses in India due to large scale users. All the heads are going to US
using latency to avoid such things we need to load balancing that is waited.
Geo location -Jio location will strictly follow the band rules, Indian New Zealand should go to India only
and US region. User should go to US only.
Multivalues -we can give multiple server IP in multi values, specifically, it takes any one of the IP.
Q- what is CDN ?
A- a large portion of all internet content is delivering through CNCN is nothing but content deliver
network
Example, if you are in India and want to watch the same brand in USA store, we will experienced bit slow
response to avoid such issues. CDN will store cache version of the US website content in multiple
geographical locations across the world also called as point of presence.
A - go to cloud front under cloud front. We do have something called distributions under distributions. >
invalidation enter /* and then clear.
A- Systems, Manager is mainly used to centrally, manage the global configuration settings by using
parameter store.
Q- what is the difference between AWS cloud Trail and AWS Config?
A - yes, we can monitor all the API activities activities such as logging in from console or CL or any third-
party application like Packer and Terraform, everything all events will be recorded by the cloud Trail
Cloud config-Cloud conflict, especially used to tracking the detail changes which is happening on your
resources. For example, if we make a 3,4 changes in your resources, you have a separate plural event,
but in cloud conflict, it will show you consolidated overview. What are the changes it’s been performed.
A - elastic beans, stock is the service for deploying and scaling web application and service. Upload your
code and elastic bet will automatically handle the deployment from load balance into health monitoring.
A- we had an application which is currently running and that application had an new updates. So all the
traffic will be hit to load balance, so we will direct the traffic to the already existing application. Once
testing part is done. Then we will route the traffic to the newly deployed application.
###########AWS########################
_____________________________________________________________________________________
##################GIT########################
A - we are following future branching strategies, which are main and integration which are long live
branches
Main always points to the production comments, and the total code is available in the integration branch
So whenever we want to work on Application code, we create branch from the integration we
developed, and we check if the pipeline is running smooth or amount. Once it is good, we will raise the
PR.
So once marking with the integration, if it’s good, then we will check with the rest of the teams like QA
pre-product production
So once it is succeeded in the production master points to the committee, so we point the tip and tag as
version 1.0
By doing this, whatever the conflict, I will get, I will sit with the developers, and I will do the necessary
things.
Q What is Git and why is it used?
A - Git is a tool for tracking changes in code. It helps developers work together and keep track of every
change.
A-Git is the tool that tracks changes in code. GitHub is a website where you can store and share your
code using Git.
A-A repository is like a folder for your project. It contains all your project files and the history of changes
made to those files.
A-git init creates a new Git repository. It sets up all the necessary files for Git to start tracking changes.
A-A commit is a snapshot of your project. It records what the project looks like at a certain point in time.
A-Use the git status command. It shows you the changes that have been made and not yet committed.
A-git add stages changes. It tells Git to include the changes in the next commit.
A-git clone copies a repository from a remote server to your local machine.
A-git pull updates your local repository with changes from a remote repository.
Q-What is a branch in Git?
A-A branch is like a separate line of development. It lets you work on new features without changing the
main codebase.
##################GIT########################
_____________________________________________________________________________________
##################Terraform########################
Terraformism is an infrastructure automation tool, which is mainly used to deploy/provision our cloud
infrastructure.
The main advantages inform is automation dry checks, validation of code, with the help of state file or
TF. We can deploy another infra.
A- Terraform import
Q - What is the use case of Terraform statefile.tf And where you save it?
A- Terraform maintenance state file that map share current state of your infrastructure along with the
configuration file
So state files are basically in local machine for the back ups or in the remote location. S3 with strategies
with the help of dynamo DB table locking policy.
Q-let’s say you have lost your Terraform state file. What will you do?
A- basically, statefile will contain very critical information. So keeping such files under locking system is
always the best practice. Imagine you have lost the file so performs don’t know that there is an existing
environment because the state file has been deleted. So if we deploy again with the source file, there
will be a drastic overlapping and we and we see cross pollinations. so the best option is to use share of
import.
A- There are multiple modules, but I have knowledge on route modules, publish modules . route
modules which consists of all resources defined in the TF file which is the main working directory.
Example it contains main.Tf or variable.tf or any additional terraform config Files.
The route modules will be considered as main configuration for your entire infra project.
A- remote back in is a place where we store all our TF state files which can be shared to other
developers of infrastructure
##################Terraform########################
_____________________________________________________________________________________
________________________________
##################Jenkins########################
A- Jenkins credentials or any third-party tools, such as AWS, secrets, manager or Google cloud key
management or Azure key or HashiCorp vault .
A- shared modules in Jenkins refers to collection of reusable and resource that can be shared across
multiple Jenkins jobs.
Q- can you use Jenkins to build application with multiple programming languages using different agents
in different stages?
A- Yes, Jenkin can be used to build applications with multiple programming languages by using different
bill agents in different stages of build
process
A- Freestyle Project is traditional way of approach to Building and Testing, where we do things manually
through the web interface
A pipeline project is the way of approach that uses cod usually in form of Jenkins or integrating git to
automate steps to software delivery process
A- Jenkins plug-in are additional software components, that extend the functionality of the software they
are used to integrate with another software and to automate various tasks. Some examples GIT plug-in
docker, pipeline plug-in, AWS plug-in, Sónar, Q plug-in, Maven plug-in. Etc
A- Jenkins build note is a machine that Jenkins uses to execute build job . It can be machine or virtual
machine, or it can be run on premises or on cloud.
A - freestyle
pipeline
Maven
GitHub organisation
parameter job
Q- How can you test and destroy Jenkins pipeline?
A-we can use Jenkins bridal features to validate the syntax and structure of the Jenkins file
Breakdown the pipeline stages and check independently to isolate and identify problems
A- Jenkins provides several options for managing build artefacts, including the use of the artefacts post
build actions which allows you to archive files generated by the build .
You can also use the copy artefact plug-in to copy, build artifacts from one job to another .
##################Jenkins########################
_____________________________________________________________________________________
________________________________
##################ANSIBLE########################
Q-Explain the difference between Ansible and other configuration management tools like Chef or
Puppet.
A-Ansible uses an agentless architecture, relying on SSH and Python to execute tasks on remote servers.
Chef and Puppet use an agent-based approach where agents need to be installed on managed nodes.
A-Ansible playbooks are YAML files that define a set of tasks to be executed. They automate
configurations, deployments, and orchestration of tasks across managed nodes.
A-An Ansible role is a way to organize playbooks and other files in a reusable structure. It encapsulates
tasks, variables, templates, and files into a directory structure.
A-Ansible can be installed using package managers like apt, yum, or brew depending on your operating
system. For example, sudo apt-get install ansible on Ubuntu.
A-An inventory file in Ansible lists the IP addresses or hostnames of managed nodes (servers) that
Ansible will work with. It defines the targets for Ansible playbooks and ad-hoc commands.
A-Ad-hoc commands are run from the command-line to perform quick tasks on remote nodes (ansible
command). Playbooks are YAML files that provide a more structured and reusable way to automate
tasks.
A-Ansible ensures idempotency by only applying changes when necessary. If a task has already been
completed successfully, Ansible will not reapply it unless changes are made to the task or its
configuration.
A-Ansible Galaxy is a website and command-line tool for finding, reusing, and sharing Ansible roles. It
provides a repository of community-contributed roles that can be used to extend Ansible functionality.
##################ANSIBLE########################
_____________________________________________________________________________________
________________________________
##################Docker########################
A-Docker is a platform that allows you to package, distribute, and run applications in containers. It's used
for creating consistent environments across development, testing, and production.
What is a container?
A-A container is a lightweight, standalone, and executable package that includes everything needed to
run a piece of software, including code, runtime, libraries, and dependencies.
A-A Docker image is a read-only template that contains the application and its dependencies. A Docker
container is a runnable instance of a Docker image.
A-You create a Docker container by running an image with the docker run command. For example,
docker run -d -p 8080-80 nginx runs a container based on the nginx image in detached mode, mapping
port 8080 on the host to port 80 in the container.
A-Docker Hub is a cloud-based registry service that allows you to store and share Docker images publicly
or privately. It's a repository of Docker images maintained by Docker.
A-Use the docker ps command to list all running containers. Adding the -a flag (docker ps -a) lists all
containers, including stopped ones.
A-A Dockerfile is a text document that contains all the commands a user could call on the command line
to assemble an image. It's used to build Docker images automatically.
How do you stop and remove a Docker container?
A-Use the docker stop command followed by the container ID or name to stop a running container. Then,
use docker rm followed by the container ID or name to remove a stopped container.
A-Docker volumes provide a way to persist data generated by and used by Docker containers. They are
stored outside the Union File System and can be shared among containers.
A-Docker networks allow containers to communicate with each other and with other non-containerized
devices on the same network. They are used to facilitate communication and isolation between
containers.
##################Docker########################
_____________________________________________________________________________________
_____________________
##################KUBERNETES########################
A-Kubernetes is an open-source platform for automating the deployment, scaling, and management of
containerized applications. It helps in managing containerized applications across multiple hosts.
What is a container?
A-A container is a lightweight, executable package of software that includes everything needed to run a
piece of software, including code, runtime, libraries, and dependencies.
A-Docker is a platform for building and running containers, while Kubernetes is a container orchestration
platform that manages the deployment and scaling of containers.
A-You create a Pod by defining a Pod manifest file in YAML format, which specifies the Pod's
configuration, such as containers, volumes, and metadata. Then, you apply this manifest file using
kubectl apply -f pod.yaml.
A-A Deployment in Kubernetes manages a set of identical Pods, ensuring that the desired number of
Pods is running and handling updates and rollbacks.
A-You create a Deployment by defining a Deployment manifest file in YAML format, which specifies the
desired state of the Deployment, including the number of replicas and the Pod template. You then apply
this manifest file using kubectl apply -f deployment.yaml.
A-A Service in Kubernetes is an abstraction that defines a logical set of Pods and a policy by which to
access them. It provides a stable endpoint for connecting to the Pods.
A-You expose a Deployment by creating a Service manifest file in YAML format, which specifies the type
of Service (e.g., ClusterIP, NodePort, LoadBalancer) and selects the Pods to expose. You apply this
manifest file using kubectl apply -f service.yaml.
A-kubectl is the command-line tool used to interact with Kubernetes clusters. It allows you to deploy and
manage applications, inspect and manage cluster resources, and view logs and troubleshooting
information.
A-You scale a Deployment by updating the replicas field in the Deployment manifest file to the desired
number of replicas (e.g., kubectl scale deployment/myapp-deployment --replicas=3).
A- A ConfigMap in Kubernetes is an API object used to store non-sensitive configuration data in key-value
pairs. It can be used to decouple configuration from Pods and containers.
A-Application logs in Kubernetes can be accessed using kubectl logs command followed by the Pod name
and optional container name. For example, kubectl logs mypod.
A-A Node in Kubernetes is a worker machine in the cluster. It may be a physical machine or a virtual
machine, and it runs Pods managed by the Kubernetes control plane.
A-Labels are key-value pairs attached to Kubernetes objects (e.g., Pods, Services) for identification and
grouping. Selectors are used to filter and select objects based on labels.
A-Kubernetes automatically restarts containers that fail or exit, based on the Pod's restartPolicy (default
is Always). It ensures that the desired state of the Pod (defined in the Deployment or Pod manifest) is
maintained
A- A Persistent Volume in Kubernetes is a piece of storage in the cluster that has been provisioned by an
administrator or dynamically provisioned using StorageClasses. It provides storage resources for Pods.
How do you upgrade Kubernetes cluster components?
A- Kubernetes cluster components (e.g., API server, Controller Manager, Scheduler) can be upgraded by
updating the Kubernetes version in a controlled manner, following the upgrade instructions provided by
the Kubernetes documentation.
A- A StatefulSet is used for stateful applications that require stable, unique network identifiers and
persistent storage. It manages Pods that are not interchangeable, whereas a Deployment is used for
stateless applications and manages interchangeable Pods.
##################KUBERNETES########################
_____________________________________________________________________________________
_____________________