0% found this document useful (0 votes)
21 views13 pages

Devops Questions

Uploaded by

santhosh G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views13 pages

Devops Questions

Uploaded by

santhosh G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

DAY 01 – GIT & GITHUB

01. Waterfall vs Agile methodology.

Waterfall Agile methodology


Sequential and linear Iterative and incremental

Rigid, difficult to make changes Highly flexible, easy to adapt to


once the project is underway changes
Changes are costly and difficult to Changes are expected and easily
implement accommodated. Its work like
sprint(release services like
microservices)

02. Difference between GIT & GITHUB

03.What is devops?
DevOps combines development (Dev) and operations (Ops) to
increase the efficiency, speed of software development and delivery of
application into the real world business enviromment.
Advantages:
 Less downtime
 Cost efficient
 Time reduction
 Effort reduction
Disadavantage:
 It has major security concern

04.Continuous Integration vs Continuous deployment vs Continuous vs


Delivery

05.Centralized version system vs Distributed version system


06. 7’c of Devops or phases

07. What is branch in Git?


A branch in Git is a lightweight movable pointer to a commit,
allowing you to create separate lines of development within a repository.
Branches enable multiple people to work on different features or fixes
simultaneously without interfering with the main codebase.
08.Lifecycle of GIT:

09.Lifecycle of Devops:
DAY 02 – GIT & GITHUB
01.Types of branches in GIT?
 Master /production/main branch
 Feature branch (i.e ., Dev, QAT, UAT ,Release, hot fix)

02.Define Hot fix branch in git.


Maintenance or “hotfix” branches are used to quickly patch production
releases. This is the only branch that should fork directly off of main.
03.Explain about git branching strategy.
First when initializing the git it has own master branch from that
the dev- team crates their own feature branch from master and they are
the only one which is having all commits log same as master. From that
dev branch new branch will be created called QA branch where the code
quality is checked. Then UAT team creates their own branch from QA
branch to run the code and release it to the production stage. Once the
client find bugs in code in production stage it needs to be corrected
quickly, here comes hot fix branch where Maintenance
or “hotfix” branches are used to quickly patch production releases. This
is the only branch that should fork directly off of main.
04. Git fetch vs Git pull.
Git fetch: only download commit from remote repo to local system.
Git pull: download and update the commits from remote repo to local
system.
05.Git clone vs git fork.
Git clone: copy whole repo within same system
git fork: Copy whole repo between different github account

DEVOPS – JENKINS
01. Define the role of Jenkins in devops
Jenkins is an open-source automation server that enables
continuous integration and continuous delivery (CI/CD) by
automating the building, testing, and deployment of applications. It
helps streamline development workflows and ensures code quality
through automated testing and deployment pipelines.
02.

03.

04. How many ways you can trigger Jenkins pipeline?


 Remote trigger
 Build after other projects are built
 Build periodically
 Github hook trigger
 Poll SCM
05. What is the current version of Jenkins?
2.452.3
06. What is prerequesticites of Jenkins?
Java must be installed on local system/ ec2 to perform operations on
Jenkins.
06.What is the hardware and software requirements of Jenkins
installation?
Hardware requirements:

 256 MB of RAM
 1 GB of drive space (although 10 GB is a recommended minimum
if running Jenkins as a Docker container)
Recommended:

 4 GB+ of RAM
 50 GB+ of drive space
Software requirements:
Java and web browser
07.Difference between freestyle and pipeline job.
A freestyle job in Jenkins is a simple, pre-configured project type with
limited customization which allows to run a single job at a time. Pipeline
job allows to run multiple job parellely through scripted pipeline
concepts.
08. Specify the port number and default path of Jenkins.
Port no: 8080
Default path : /var/lib/Jenkins
09.Difference between build periodically trigger and poll SCM trigger.
Build periodically trigger: Triggers the job to run periodically even
there is no new commits performed in that job
Poll SCM trigger: It triggers the job to run only when any new commits
are takes place in that job.
10.Give the advantages and disadvantages of using Jenkins.
Advantage: With a vast library of plugins, Jenkins can integrate with
various tools and platforms, making it highly customizable for different
workflows.
Disadvantage:
 Updates are infrequent (12 weeks min)
 Highly depends on internet connectivity.

11. How will you secure your Jenkins?


 By implementing role based authorization strategy plugin we can
restrict user level permission in Jenkins.
 The Jenkins are running in ec2, so we can encrypt the volume of
Jenkins using KMS.
 Port number access should be restricted by denying permission to
all.
12. Other related info about Jenkins.
 Thin backup plugin to backup Jenkins
 S3 publisher plugin to store backedup info about Jenkins in S3.
 LDAP : Integrate many no. of users in Jenkins in realtime
13.Jenkins installation steps:
 amazon-linux-extras install epel (extra packages for enterprise linux)
 yum update -y
 wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-
stable/jenkins.repo
 rpm –import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
 amazon-linux-extras install java-openjdk11
 yum install Jenkins
14.Auto deployment using TOMCAT steps.
Installation steps:
 First going to install tomcat.
 cd /opt  to install third party applications
 wget <tomcat install url>untar the installed file by using
command
 tar –xvzf apache.
 Now we want to change tomcat port number because the Jenkins
and tomcat both are running in port 8080.
 cd conf  server.xml edit the port by changing port in connector
port as 9090
 Go to bin./shutdown.sh./startup.sh
 Now the installation of tomcat is over. After that we are going to
run app in tomcat.
Steps to run app in Tomcat
 Copy the url of any sample app from web
 Create job in Jenkins as Tomaact and go to tomcat folder in ec2
and paste the link in that using command wget<sample app link
address>
 To intimate that our sample app in tomcat job we need to download
plugin deploy to containergo to tomcat job configure use that
plugin and configure all steps.{in that we specify as username and
pass as deployer}
 To intimate this changes to ec2 go to cd/opt/apache/conf
 vi tomcat users.xml
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="admin" password="admin"
roles="manager-gui,manager-script,manager-jmx,manager-
status"/>
<user username="deployer" password="deployer"
roles="manager-script"/>
{paste the above script below to tomcat users}
 cd webapps/manager/ META-INF (make catlina as comment to
disable it)
 Now restart the service using shutdown and startup command
 Finally run the job and go to browser and hit pub IP and use
sample app name as path to view whether the app is successfully
hosted or not.
15.Master & slave in jenkins steps.
 Create Ec2 instance, install java, Jenkins(based on OS in official
documentation) in master node.
 Create another Ec2 instance as slave install java alone in that.
 Exit command to move from root to ubantu user in slave
 Create directory as mkdir Jenkins because we are not installed Jenkins
here. {slave}

 After creating slave node we want to attach with master so that Go to


Jenkins manage Jenkinscreate new nodeConfigure that whole
setup{in master node}
 Finally check whether the connection is established if there is a file
remoting & remoting.jar is present the connection is successful.
 After completing all steps for connection establishment create job
restrict where job run in that give label name which is used to run
job in slave.{label to identify correct slave}
16.Web server vs App server
Web server well suited for static contents such as APACHE & IIS
whereas app server suited for dynamic contents such as TOMCAT
DOCKER
01.Define Docker with its uses
Docker is a platform for developing, shipping, and running
applications in containers.
Generally each application cannot install and run in instances,
but with the help of docker can run and install the single application in
instances with the help of containers and expose these app in public
with different ports.(Eg: Apache can install and run multiple times
by exposing it with different ports to the public as 8010:80 &
8020:80)
02. Docker working process.
First we have to write a docker file which contains all info about
the process of application like where it should get run etc., and that
file should be converted to Docker image after that the image should
be pushed dockerhub. Finally that pushed image is called from hub
and run the application as a container known as docker container.
03.Define Port forwarding in docker.
It allows to change the port number of an application and run in
different containers .(Eg: Apache can install and run multiple times by
exposing it with different ports to the public as 8010:80 & 8020:80)
04. What are all can be called as images in docker.
Images: OS  amazon linux, ubuntu
Runtime  java, python
Middleware Httpd,ngnix,tomcat
DB  Mysql
05. What are all the instructions supported by Docker file?
FROM:
Defines the base image to use for the build. Must be the first non-
comment instruction in the Dockerfile.
Ex: FROM ubuntu:22.04
RUN:
Executes any commands in a new layer on top of the current image
and commits the results. Can be in shell form or exec form.
Ex: RUN apt-get update && apt-get install -y python3 python3-
pip
CMD
Provides defaults for an executing container. There can only be
one CMD instruction in a Dockerfile. If there are
multiple CMD instructions, only the last one takes effect.
EX: CMD [“echo”, “Hello World”]
COPY:
Copies new files or directories from the build context and adds them
to the filesystem of the container.
Ex:COPY requirements.txt /app/
EXPOSE:
Informs Docker that the container listens on the specified network
ports at runtime.
Ex: EXPOSE 8080
ENV:
Sets an environment variable in the container.
Ex: ENV PYTHON_VERSION=3.6
ADD:
Copies new files, directories or remote file URLs from <src> and adds
them to the filesystem of the container at the path <dest>.
Ex: ADD https://example.com/big.tar.xz /usr/src/things/
ENTRYPOINT:
Allows you to configure a container that will run as an executable.
Ex: ENTRYPOINT ["java", "-jar", "/app/app.jar"]
VOLUMES:
Creates a mount point with the specified name and marks it as holding
externally mounted volumes from native host or other containers.
VOLUME /data
06.CMD vs ENTRYPOINT in Dockerfile

 CMD - Specifies what command to run within the container


 ENTRYPOINT allows specifying a command along with the
parameters
07.What is meant by Multistage Dockerfile
In a multistage Dockerfile, developers define multiple build stages,
each encapsulating a specific set of instructions and dependencies.
These stages can be named and referenced within the Dockerfile,
enabling seamless communication between them Basically, the first
stage of creating a multistage Dockerfile is dedicated to building the
application code, while subsequent stages focus on packaging the
application and preparing it for runtime. Intermediate images that are
generated in earlier stages are discarded just after their purpose is
served, resulting in a final production image that contains only the
essential components required to run the application

You might also like