0% found this document useful (0 votes)
19 views

Apoorva 3rd sem IT Report

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Apoorva 3rd sem IT Report

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

A

Report
Of
Industrial Training
On
“DEVOPS WITH CLOUD COMPUTING”

Submitted in partial fulfillment for the award of the degree of


Bachelor of Technology
in
Computer Science & Engineering

Submitted by: Submitted to:


Apoorva Agarwal Ms. Sneha Garg
21EJCCS038 (Assistant Professor)

Department of Computer Science & Engineering


Jaipur Engineering College & Research Centre
Jaipur, Rajasthan
2022-23

i
CERTIFICATE

This is to certify that the industrial training entitled “DevOps and Cloud Computing”
is bonafide work carried out by Apoorva Agarwal a student of BTech.in Computer
Science & Engineering at Jaipur Engineering College and Research Centre, during
the year 2021-22 in partial fulfillment of the requirements for the award of the Degree
of Bachelor of Technology in Computer Science & Engineering under my guidance.

Name of Guide: Akash Gaur

Designation : Trainer

Place : Jaipur

Date : 15 October 2022


VISION OF THE CSE DEPARTMENT

To become a renowned Centre of excellence in computer science and engineering and


make competent engineers & professionals with high ethical values prepared for
lifelong learning.

MISSION OF THE CSE DEPARTMENT

1. To impart outcome-based education for emerging technologies in the field of


Computer Science and Engineering.
2. To provide opportunities for interaction between academia and industry.
3. To provide a platform for lifelong learning by accepting the change in technologies
4. To develop for aptitude fulfilling social responsibilities.
PROGRAM OUTCOMES (POs)

1. Engineering knowledge: Apply the knowledge of mathematics, science,


engineering fundamentals, and Computer Science & Engineering specialization to the
solution of complex Computer Science & Engineering problems.
2. Problem Identity is: Identity, formulating, researching, and analyzing complex
Computer Science and Engineering problems reaching substantiated concluding first
principles of mathematics, natural sciences, and engineering sciences.
3. Design/development of solutions: Design solutions for complex Computer Science
and Engineering problems and design system components or processes that meet the
needs with moderation for the public health safety cultural, and environmental
considerations.
4. Conduct investigations of complex problems: Use research-based knowledge and
research methods including design of Computer Science and Engineering experiments,
analysis and interpretation of data, and synthesis of the information to provide valid
conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modeling to complex
Computer Science Engineering activities with an understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge
to assess societal, health, safety, legal and cultural issues and the consequent
responsibilities relevant to the professional Computer Science and Engineering
practice.
7. Environment and sustainability: Understand the impact of professional Computer
Science and Engineering solutions in societal and environmental contexts, and
demonstrate the knowledge of, and need for sustainable development.
8. Ethics: Apply ethical principles and commit to professional ethics and
responsibilities and norms of the Computer Science and Engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member
or leader in diverse teams, d in multidisciplinary settings in Computer Science and
Engineering.
10. Communication: Communicate effectively on complex Computer Science and
Engineering activities with the engineering community and with society at large, such
as being able to
comprehend and write effective reports and design documentation, make effective
presentations, and give and receive clear instructions.
11. Project management and finance: Demonstrate knowledge and understanding he
Computer Science and Engineering and management principles and apply these to
one’s work, as a member and leader in a team, to manage projects and in
multidisciplinary environments
12. Life-long learning: Recognize the need for, and have the preparation and ability to
engage in independent and life-long learning of their broader text of technological
change in Computer Science and Engineering.
PROGRAM EDUCATIONAL OBJECTIVES (PEOs)

The PEOs of the B. Tech (CSE) program are:


1. To produce graduates who can apply computer engineering knowledge to
provide turn-key IT solutions to national and international organizations.
2. To produce graduates with the necessary background and technical skills to
work professionally in one or more of the areas like – IT solution design
development and implementation consisting of system design, network design,
software design and development, system implementation and management,
etc. graduates, would be able to provide solutions through logical and analytical
thinking.
3. To able graduates to design embedded systems for industrial applications.
4. To inculcate in graduates effective communication skills and teamwork to work
in multi-disciplinary environments
5. To prepare graduates for personal and professional success with commitment to
their commitment to socialites.
6. PROGRAM SPECIFIC OUTCOMES (PSOs)

PSO1: Ability to interpret and analyze network-specific network purity issues, and
automation in the environment

PSO2: Ability to design and develop mobile and web-based applications under
realistic constraints.

COURSE OUTCOMES (COs)

On completion of Industrial Training, Graduates will be able to-


• CO1: Generate the report based on the projects out for demonstrating the ability
to apply the knowledge the of engineering field during training
• CO2: Demonstrate Competency in relevant engineering fields through problem
identification, formulation and solution

MAPPING OF CO’s & PO’s

Program Outcomes (POs)


Subject Code Cos PO- PO- PO- PO- PO- PO- PO- PO- PO- PO- PO- PO-
1 2 3 4 5 6 7 8 9 10 11 12

3CS7-30 CO-1 3 3 2 2 2 1 1 2 2 3 3 3

Industrial Training CO-2 3 3 3 3 3 1 1 2 2 3 3 3


ACKNOWLEDGEMENT

It has been a great honour and privilege to undergo training at UPFLAIRS. I am very
grateful to Mr. Aakash Sir for giving his valuable time and constructive guidance in
preparing the report for training. It would not have been possible to complete this report
in a short period of time without their kind encouragement and valuable guidance.

I wish to express our deep sense of gratitude to our Industrial Training Guide Ms.
SNEHA GARG, Jaipur Engineering College and Research Centre, Jaipur for guiding
us from the inception till the completion of the industrial training. We sincerely
acknowledge him for giving his valuable guidance, and support for the literature survey,
critical reviews, and comments for our industrial training.
I would like, first of all, express our thanks to Mr. Arpit Agrawal Director of JECRC,
for providing us with such a great infrastructure and environment for our overall
development.
I express sincere thanks to Dr. V. K. Chandna, Principal of JECRC, for his kind
cooperation and extendible support towards the completion of our industrial training.
Words are inadequate in offering our thanks to Dr. Sanjay Gaur, HOD of the CSE
department, for consistent encouragement and support for shaping our industrial
training in the presentable form.
Also our warm thanks to Jaipur Engineering College and Research Centre, who
provided us with this opportunity to carry out this prestigious industrial training and
enhance our learning in various technical fields.

Apoorva Agarwal 21EJCCS038

viii
ABSTRACT

1. Name of the Student: Apoorva Agarwal

2. RTU Roll Number: 21EJCCS038

3. Training Status: Yes


• Organization Name: Upflairs
• Training mode: Offline
• Trainer Name: Mr. Aakash Gaur
• Trainer Contact Details: 9784389701
• Completed or Not: Completed
4. Training Duration: 13 September – 15 October

5. Training Days: 20

6. Technology: Linux Operating System; Cloud Computing; Docker; GIT; Jenkins

7. Project: Create a Jenkins container using Docker file and that image also have
docker support itself.
8. Project Description:
DevOps is a collaboration of development and operations devised to stress on
communication and integration between them. The main use of DevOps is to help an
organization grow and excel. With its, help an organization can produce software
products and services. Companies are focusing on the automation of processes this way
timely delivery and quality results are achieved. Getting the workforce trained with the
latest technologies and getting optimum work for them have become the need of the
hour. Problems can be more easily solved by this software development method.
Documented processes could be devised by it and processes could be made user-
friendly. DevOps benefits IS development and operations performance. It also has
positive effects on web service development and quality assurance performance.
Companies are focusing on the automation of processes this way timely delivery and
quality results are achieved. Getting the workforce trained with the latest technologies

ix
and getting optimum work for them have become the need of the hour. Problems can
be more easily solved by this software development method.

“Cloud” is a collective term for a large number of developments and possibilities. It is


not an invention, but more of a “practical innovation”, combining several earlier
inventions into something new and compelling. Cloud computing enables tasks to be
assigned to a combination of software and services over a network. This network of
servers is the cloud. Cloud computing can help businesses transform their existing
server infrastructures into dynamic environments, expanding and reducing server
capacity depending on their requirements. Cloud Computing is a popular phrase that
is shorthand for applications that were developed to be rich Internet applications that
run on the Internet (or “Cloud”). Cloud Computing is a popular phrase that is shorthand
for applications that were developed to be rich Internet applications that run on the
Internet (or “Cloud”).

9. Keywords: Linux Cloud, GIT, AWS, Shell, command Prompt, IP, Instance,
Hypervisor, Container, Plugins, Console, SSH, AMI, Localhost.

x
LIST OF FIGURES

Figure 1 Introduction-------------------------------------------------------------------------13
Figure 2 DevOps-------------------------------------------------------------------------------13
Figure 3 Linux Installation------------------------------------------------------------------14
Figure 4 GIT Workflow ---------------------------------------------------------------------29
Figure 5-12 Project----------------------------------------------------------------------------36
LIST OF TABLES

Table 1 Cat Command-----------------------------------------------------------------------16


Table 2 Jenkins--------------------------------------------------------------------------------29
TABLE OF CONTENTS

Certificate---------------------------------------------------------------------------------------- ii
Vision and Mission-----------------------------------------------------------------------------iii
Program Outcomes (POs)--------------------------------------------------------------------iv
Program Education Objectives (PEOs) ----------------------------------------------------v
Program Specific Outcomes (PSOs)-------------------------------------------------------vii
Course Outcomes (Cos)----------------------------------------------------------------------vii
Mapping: Cos and Pos------------------------------------------------------------------------vii
Acknowledgement----------------------------------------------------------------------------viii
Abstract------------------------------------------------------------------------------------------ix
List of Figures-----------------------------------------------------------------------------------xi
List of Tables-----------------------------------------------------------------------------------xii
INTRODUCTION------------------------------------------------------------------------------1
1) LINUX-----------------------------------------------------------------------------------2
1.1)1. Architecture of Linux System----------------------------------------------2
1.2) Basic Commands-----------------------------------------------------------------4
1.3) Visual Editor----------------------------------------------------------------------6
1.4) User Management----------------------------------------------------------------7
1.5) Permissions------------------------------------------------------------------------8

2) CLOUD COMPUTING-------------------------------------------------------------11
2.1) Introduction----------------------------------------------------------------------11
2.2) Virtualization--------------------------------------------------------------------12
2.3) AWS EC2 Instance-------------------------------------------------------------12
2.4) Hypervisor-----------------------------------------------------------------------13
2.5) Installing Apache2--------------------------------------------------------------13

3) DOCKER------------------------------------------------------------------------------14
3.1) Introduction----------------------------------------------------------------------14
3.2) Installation-----------------------------------------------------------------------14
3.3) Docker Commands--------------------------------------------------------------15

4) GIT--------------------------------------------------------------------------------------17
4.1) Introduction----------------------------------------------------------------------17
4.2) GIT Workflow-------------------------------------------------------------------17

5) JENKINS------------------------------------------------------------------------------18
5.1) Introduction----------------------------------------------------------------------18
5.2) Installations----------------------------------------------------------------------19
5.3) Freestyle Job Creation---------------------------------------------------------19

6) KUBERNETES-----------------------------------------------------------------------20
6.1) Introduction----------------------------------------------------------------------20
6.2) Architecture----------------------------------------------------------------------21
6.3) Basic Commands----------------------------------------------------------------22

7) PROJECT-----------------------------------------------------------------------------23

8) FUTURE SCOPE AND CONCLUSION----------------------------------------28

9) REFERENCES-----------------------------------------------------------------------29
INTRODUCTION

DevOps is the combination of cultural philosophies, practices, and tools that increase
an organization’s ability to deliver applications and services at high velocity: evolving
and improving products faster than organizations using traditional software
development and infrastructure management processes. This speed enables
organizations to better serve their customers and compete more effectively in the
market.

Figure 1

It aims to shorten the systems development life cycle and provide continuous
delivery with high software quality

Figure 2

DevOps is a practice used by enterprises to produce and release software. It is a


technique for quickly deploying services and applications. This process allows
businesses to produce more effective and seamless software solutions of higher quality.
DevOps with cloud-based delivery models are a great starting point to offer speed and
agility to businesses.

Cloud computing is the on-demand delivery of IT resources through the internet with
pay-to-use charges. Instead of buying and maintaining computer products and services,
you can pay to use a cloud computing service. It saves you the time, effort, and cost of
doing it all by yourself. Cloud computing services can be broken down into three
models that stack on top of one another.

1
1) LINUX

1.1) THE ARCHITECTURE OF THE LINUX SYSTEM

i) Linux operating system


An operating system can be described as an interface between the
computer hardware and any computer user. An operating system is an
essential component of system software within a computer system. The
primary aim of an operating system is to provide a platform where a user
can run any program conveniently or efficiently.

ii) Linux operating system history


In 1991, Linux history started with the starting of a particular project by
the Finland student Linus Torvalds for creating a new free OS
kernel. The first publication of Ubuntu was published in 2004.
Oracle published its Red Hat distribution in 2006. Ubuntu insisted on
20000000+ users in 2014.

iii) Architecture
The Linux operating system's architecture mainly contains some of the
components such as the Kernel, System Library, Hardware layer,
System, and Shell.

Figure 3

a) Hardware layer- Linux operating system contains a hardware layer that


consists of several peripheral devices like CPU, HDD, and RAM.

2
b) Kernel - The kernel is one of the core sections of an operating system. It is
responsible for each of the major actions of the Linux OS. This operating
system contains distinct types of modules and cooperates with underlying
hardware directly. The kernel facilitates the required abstraction for hiding
details of low-level hardware or application programs in the system.

c) Shell –Is an interface between the kernel and the user. It can afford the
services of kernel. It can take commands through the user and runs the
functions of the kernel. There are a few types of these shells which are
categorized as follows:
▪ KSH Shell (Korn)
▪ C Shell
▪ TCSH Shell

d) Applications -These libraries can be specified as some special functions.


These are applied to implementing the operating system's functionalities.

iv) Drawbacks of Linux

▪ Games: Several games are developed for Windows but unfortunately not for
Linux. Because the platform Windows is used widely. So, the developers of the
games are more interested in windows.
▪ Software Alternative: Let's take Photoshop example which is a famous tool for
graphic editing. Photoshop exists for Windows; however, it is not available for
Linux.
▪ Hardware Drives: Most of the users of Linux face an issue while using Linux.
Various companies of hardware prefer to build drivers for Mac or Windows.
▪ Learning Curves: Linux isn't a very user-friendly operating system. Hence, it
might be confusing for many beginners.

3
vi) Linux Operating System Applications
▪ Yamaha Motive Keyboard
▪ Volvo In-Car Navigation System
▪ Lenovo Idea Pad
▪ Sony Reader
▪ Sony Bravia Television

1.2) BASIC COMMANDS FOR THE TERMINAL

a) pwd command:
Use the pwd command to find the path of your current working
directory. Simply entering pwd will return the full current path – a path
of all the directories that starts with a forward slash (/).
For example, /home/username.

b) cd command:
To navigate through the Linux files and directories, use
the cd command.
Here are some shortcuts to help you navigate:
▪ cd .. moves one directory up.
▪ cd- moves to your previous directory.

c) ls command:
The ls command lists files and directories within a system
▪ ls -a shows hidden files in addition to the visible ones.
▪ ls -lh shows the file sizes in an easily readable format.

d) mkdir command:
Use the mkdir command to create one or multiple directories at once
and set permissions for each of them.

4
mkdir directoryName

e) touch command:
The touch command allows you to create an empty file at a current
working location without changing the path.
touch FileName

To create a blank file with desired location one needs to enter the path
for the same.
touch /home/username/Documents/FileName

f) cat command:
Concatenate, or cat is one of the most frequently used Linux commands
that creates a file with text. To run the cat command, type cat followed
by the file name.
cat > FileName cat >>FileName cat FileName

To enter text into a To append content to To show the existing


new file the existing file file

TABLE 1

g) echo command:
The echo command is a built-in utility that displays a line of text or
string using the standard output.
echo [option] [string]
echo hello prints hello as output
echo $PATH prints the current working path

h) alias command :
the alias allows you to create a shortcut with the same functionality as
a command, file name, or text.

5
alias Alternative Name =” Command Name”

i) rm/rmdir command:
The rm command is used to delete files within a directory.
rm filename
To permanently delete an empty directory, use the rmdir command.
rmdir directory name

j) history command:
With history, the system will list up to 500 previously executed
commands, allowing you to reuse them without re-entering.

k) ping command:
The ping command is one of the most used basic Linux commands for
checking whether a network or a server is reachable.

1.3) VISUAL EDITOR

Vim is an advanced and highly configurable text editor built to enable efficient
text editing. Vim text editor is developed by Bram Moolenaar. To open a file in
vim editor just write the file name after the vim command in the terminal as
follows
vim FileName
i) Modes
• Command Mode where the characters are interpreted as commands.
• Insert Mode(i) where everything is inserted into file as text.

ii) Copy/Cut and Paste


‘yy’ → will copy the entire line
‘dd’ → will cut the entire line
‘dw’ → will delete a word
‘p’ → is used to paste

6
iii) Saving and Exiting

esc: wq → save the file and quits


esc: w → save the but not quite
esc: q! → will quit but not save

1.4) USER MANAGEMENT

A user is an entity, in a Linux operating system, that can manipulate files and
perform several other operations. Each user is assigned an ID that is unique for
each user in the operating system.
A user account is used to provide security boundaries between different people
and programs that can run commands. Each user is assigned an ID that is unique
for each user in the operating system.

i) To list out user


ls –la

ii) To check id of user


Using id command, you can get the ID of any username. Every user has
an id assigned to it and the user is identified with the help of this id.
id username

iii) To add a user


useradd command adds a new user to the directory. But only root users
can add users.
sudo useradd username

iv) To change the password for the user login

7
Using the passwd command to assign a password to a user. After using
this command, we have to enter the new password for the user and then
the password gets updated to the new password.
passwd username

v) usermod command

vi) This command can change the user ID of a user. Or the group ID of a
user can be used to change the user's login name. The old login name of
the user is changed to the new login name provided.

vii) sudo usermod -u new_id username


viii) sudo usermod -g new_group_id us
sudo usermod -l new_login_name old_login_name username

ix) To Delete a user


This command deletes the user whose username is provided.
sudo userdel username

1.5) PERMISSIONS

Linux is a multi-user operating system, so it has security to prevent people from


accessing each other’s confidential files. To know the information of files in a
detailed manner one needs to write the command ls-la. When you do so, each
file will be listed on a separate line in a long format. There is an example in the
window below.

The first character will almost always be either a ‘- ‘, which means it’s a file, or
a ‘d’, which means it’s a directory.
The next nine characters (rw-r–r–) show the security.
The next column shows the owner of the file.
The next column shows the group owner of the file.

8
The next column shows the size of the file in bytes.
The next column shows the date and time the file was last modified. And, of
course, the final column gives the filename.

i) Changing Security Permission (Symbolic Mode)

• The command you use to change the security permissions on files is


called “chmod”, which stands for “change mode”.
• The first argument you give to the “chmod” command is ‘u’, ‘g’,
‘o’. We use:
g for group
o for others
a ‘+’ for adding
• Then specify the permission r, w, or x you want to change
The ‘r’ means you can “read” the file’s contents.
The ‘w’ means you can “write”, or modify the file’s contents.
The ‘x’ means you can “execute” the file. If any of the “rwx”
characters are replaced by a ‘- ‘, then that permission has been
revoked.
• The command you use to change the security permissions on files is
called “chmod”, which stands for “change mode.
• Finally, the name of the file whose permission you are changing.
chmod permissions fileName

ii) Changing Permissions (Absolute Mode)

The second way to modify permissions with the chmod command is to use
a number to specify each set of permissions for the file.
r-------- 4
w--------2
x-------- 1
permission 750 → Indicates permission given as
• 7 for user (4+2+1) → r,w and x
9
• 5 for group (4+1) → r and x
• 0 for user → no permission
chmod octal_permission filename

iii) Changing Owner and Group

Two commands are available to change the owner and the group of files −
• chown − The chown command stands for "change owner" and is used
to change the owner of a file.
chown username: file
• chgrp − The chgrp command stands for "change group" and is used to
change the group of a file.

10
2) CLOUD COMPUTING

2.1) INTRODUCTION

Cloud computing is the on-demand delivery of IT resources through the internet


with pay-to-use charges. Instead of buying and maintaining computer products
and services, you can pay to use a cloud computing service. It saves you the
time, effort, and cost of doing it all by yourself. Cloud computing services can
be broken down into three models that stack on top of one another:
Software as a Service (SaaS)
Platform as a Service (PaaS)
Infrastructure as a Service (IaaS)

But Why Choose the Cloud?


Why would you not want to have your own computers, servers, staffers, and
offices to run a company? Cloud computing allows you to accomplish a lot more
with a lot less!
• Lower computer cost
• Improved performance
• Reduced software costs
• Unlimited storage capacity
• Latest version availability
• Device independence

11
2.1) VIRTUALIZATION

In computing, virtualization means creating a virtual machine of a device such


as a server, storage device, network, or even an operating system where the
framework divides the resource into one or more execution environments.
It is an act of migrating a physical system into a virtual machine.

Why Do We Need Virtualization?


Due to its capability of running multiple operating systems and applications on
a single computer or server.

2.2) AWS EC2 INSTANCE

i) Creating an EC2 instance


ii) Connecting EC2 instance using SSH:
• Using Ubuntu
Open an SSH client and locate the private key file. The
key used to launch the instance filename.pem chmod 400
filename.pem ssh –i Downloads/filename.pem
username@public ip-address

• Using Command Prompt


Open the terminal and change the directory using
command where the downloaded .pem file is saved Then
type the ssh command with the structure.
cd Downloads
ssh –I file.pem username@public ip-address
And then allow the permissions.

12
2.3) HYPERVISOR

A hypervisor, also known as a virtual machine monitor or VMM, is software


that creates and runs virtual machines (VMs). A hypervisor allows one host
computer to support multiple guest VMs by virtually sharing its resources, such
as memory and processing. A computer on which a hypervisor runs one or more
virtual machines is called a host machine, and each virtual machine is called a
guest machine.

TYPES OF HYPERVISORS

a) Type A(Native):
A type 1 hypervisor acts like a lightweight operating system and runs
directly on the host’s hardware.
Eg. VMware ESX, Microsoft Hyper-V, Oracle VM

b) Type B(Host):
Like other computer programs, a type 2 hypervisor runs as a software layer
on an operating system.
Eg. VMware Workstation, Oracle Virtual Box, Microsoft Virtual PC

2.4) INSTALLING APACHE

To install Apache, install the latest meta-package apache2 by running:


▪ sudo apt update
▪ sudo apt install apache2
▪ sudo systemctl start apache2
▪ sudo systemctl enable apache2
▪ sudo systemctl status apache2
▪ sudo vim/var/www/html/index.html
▪ sudo systemctl restart apache

13
3) DOCKER

3.1) INTRODUCTION

Docker is a platform as an a-service product that uses OS-Level virtualization to deliver


software in packages called containers. Docker is a software platform that allows you
to build, test, and deploy applications quickly.
The software that hosts the containers is called Docker Engine.

i) Advantages of using Docker:


• Docker containers are process-isolated and don't require a hardware hypervisor.
• Docker containers are much smaller and require far fewer resources.
• Docker is very fast.
• Increase in productivity Security Management

ii) Docker Vocabulary:


• Docker Image: The basis of Docker Container. Represents full application.
• Docker Container: The standard unit in which application service resides and
executes.
• Docker Engine: Creates, ships and runs Docker container deployable.
• Docker Registry Service (Docker Hub): Cloud or server-based storage and
distribution service for your images.

3.2) DOCKER INSTALLATION

sudo apt update sudo apt install docker.io


sudo systemctl start docker sudo systemctl enable docker
sudo systemctl status docker

3.3) DOCKER COMMANDS

14
i) Pull command:
The 'docker pull' is a Docker command to download a Docker image or a
repository locally on the host from a public or private registry.
docker pull <imageName>

ii) Docker images:


List all the images in docker

iii) Docker Version:


Gives information about the current docker version

iv) docker run:


a) To perform the desired task
docker run <imageName> task
b) To create a container:
This command is used to create a container from the image and –d will
ensure that it won’t occupy the terminal in the background.
docker run –it –d <image>

v) Docker ps Command:
This command is used to see the running containers.

vi) Docker ps –a Command:


This command is used to see the exited as well as running containers

vii) Details(Id) of all container


docker ps –aq

viii) Remove Container


To remove a container but only exited container can be removed
docker rm <ContainerName>
To remove a running Container:
docker rm –f(docker ps –aq)
15
ix) Stop Command
To stop a running container stop command is used
docker stop <ContainerName/Id>

x) Exec Command
To get access to the running container and go inside it.

xi) Docker kill Command


This command kills the container by stopping its execution immediately.
The difference between ‘docker kill’ and ‘docker stop’ is that ‘docker stop’
gives the container time to shutdown gracefully, in situations when it is
taking too much time for getting the container to stop, one can opt to kill it.

xii) Docker commit


This command creates a new image of an edited container on the local
system.

xiii) Command to create Custom Image:


Using the vim Docker file command, we can create a docker image from the
base image. Docker file: It has all the information for running your software
in the base container.

16
4) GIT

4.1) INTRODUCTION

Git is a DevOps tool used for source code management. It is a free


and open-source version control system used to handle small to very
large projects efficiently. Git is used to track changes in the source
code, enabling multiple developers to work together on non-linear
development. Linus Torvalds created Git in 2005 for the
development of the Linux kernel. Every developer has an entire
copy of the code on their local systems. Any changes made to the
source code can be tracked by others. There is regular
communication between the developers

4.2) GIT WORKFLOW

Figure 4

17
5) JENKINS

5.1) INTRODUCTION

Jenkins is an open source automation server. It helps automate the


parts of software development related to building, testing,
and deploying, facilitating continuous integration and continuous
delivery.

ADVANTAGES:
• It is an open-source tool with great community support.
• It is easy to install.
• It has 1000+ plugins to ease your work. If a plugin does not
exist, you can code it and share it with the community.
• It is free of cost.

BEFORE JENKINS AFTER JENKINS


The entire source code was built and Every commit made in the source code
then tested. Locating and fixing bugs is built and tested. So, instead of
in the event of build and test failure checking the entire source code
was difficult and time-consuming, developers only need to focus on a
which in turn slows the software particular commit. This leads to
delivery process. frequent new software releases.
Developers have to wait for test results Developers know the test result of
every commit made in the source code
on the run.
The whole process is manual You only need to commit changes to
the source code and Jenkins will
automate the rest of the process for
you

TABLE 2
18
5.2) JENKINS INSTALLATIONS

i. apt update
ii. apt install docker.io -y
iii. systemctl start docker
iv. systemctl enable docker
v. systemctl status docker
vi. docker version
vii. docker pull jenkins/jenkins
viii. Run jenkins container with docker command ability:
docker run -itd -v v1:/var/jenkins_home -v
/run/docker.sock:/run/docker.sock-v
/usr/bin/docker:/bin/docker -p 8080:8080 -p 50000:50000
jenkins/jenkins
ix. To check whether a container is running or not:
docker ps
x. Give all permission for running docker sock
chmod 777 /run/docker.sock

5.3) CREATING A FREESTYLE JOB

i) Login to Jenkins
ii) Create New Item
iii) Enter Item details
iv) Enter Project details
v) Enter repository URL
vi) Tweak the settings
vii) Save the project

19
6) KUBERNETES

Kubernetes is an open-source container orchestration system for


automating software deployment, scaling, and management.

6.1) INTRODUCTION

i) WHAT IS KUBERNETES?
• A highly collaborative open-source project originally
conceived by Google.
• Google has 10+ years of experience with containerized apps.
• Red Hat has been a member since the start.
• Red Hat is the second largest contributor member with many
ideas coming from years.
• Sometimes called ‘Kube’
• Start, stop, update, and manage a cluster of machines running
containers in a consistent and maintainable way.

ii) ADVANTAGES
• Container orchestration savings
• Increased DevOps efficiency for micro services architecture
• Deploying workloads in multi-cloud environments
• More portability with less chance of vendor lock-in
• Automation of deployment and scalability.

6.2) KUBERNETES ARCHITECTURE

When you deploy Kubernetes, you get a cluster. A Kubernetes


cluster consists of a set of worker machines, called nodes, that run
containerized applications. Every cluster has at least one worker
node.
20
i) Control Plane Components
a) kube-apiserver:
The API server is a component of the Kubernetes control plane that exposes
the Kubernetes API. The API server is the front end of the Kubernetes
control plane.

b) Etcd:
Consistent and highly-available key value store used as Kubernetes' backing
store for all cluster data. If your Kubernetes cluster uses etcd as its backing
store, make sure you have a backup plan for those data.
c) Kube-scheduler
Control plane component that watches for newly created Pods with no
assigned node, and selects a node for them to run on.

d) kube-controller-manager
Control plane component that runs controller processes.
Logically, each controller is a separate process, but to reduce complexity,
they are all compiled into a single binary and run in a single process.

e) cloud-controller-manager
A Kubernetes control plane component that embeds cloud-specific control
logic. The cloud controller manager lets you link your cluster to your cloud
provider's API, and separates out the components that interact with that
cloud platform from components that only interact with your cluster. The
cloud controller manager only runs controllers that are specific to your cloud
provider. If you are running Kubernetes on your own premises, or in a
learning environment inside your own PC, the cluster does not have a cloud
controller manager.

ii) Node Components


Node components run on every node, maintaining running pods and
providing the Kubernetes runtime environment.

21
a) Kubelet
An agent that runs on each node in the cluster. It makes sure
that containers are running in a Pod.
b) Kube-proxy
Kube-proxy is a network that runs on each node in the cluster,
implementing part of Kubernetes.
c) Container Runtime
The container runtime is the software that is responsible for running
containers.
d) Addons
Addons use Kubernetes resources (Daemon Set, Deployment, etc.) to
implement cluster features. Because these are providing cluster-level
features, namespace resources for addons belong within the kube-
system namespace.

6.3) BASIC COMMANDS


i) List namespaces with kubectl:
• Kubectl get namespace
• Kubectl get na
ii) Create your own:
kubectl create na flask
iii) Specify a namespace with kubectl
kubectl -n get all.

22
7) PROJECT

Problem Statement:
Create a Jenkins container using Docker file and that image also have docker support
itself.

Description:
In the real world there are separate environment for image building and container
deploy so you have to manage the same.In overall terms you have to create one docker
image that will offer below given things whenever you create container from this image.
1.You have to make use of docker file or any relevant method to create this image.
2. The image must have docker file support of Jenkins, SSH, HTTPD and docker also
3.That means whenever you create a container from it all above services must be
available automatically.
4. Once the test is done you have to push this image to docker hub on your personal
account
TECH and AMP: proto:
1.AWS ec2 instance
2.Docker and AMPContainers
3. Docker file
4. Docker Hub

23
SCREENSHOTS OF PROJECT

STEP 1: Launch an AWS Instance. Choose Ubutnu server t2. micro

Figure 5

GIT Repository

Figure 6

24
Figure 7

Figure 8
Docker File

Figure 9

25
GIT Clone

Figure 10

Step : Use command sudo -i for root shell


Step : docker build –t test

Figure 11

26
Image pull

Figure 12
Now run docker command.

27
8) FUTURE SCOPE AND CONCLUSION

In today’s world, everything happens over the internet. Most companies are changing
to be like IT company that provides some particular services.
For every company, its software is the critical element that brings in sales and business.
Hence automation of software deployment and infrastructure provisioning is key to all
modern businesses. It plays a crucial role in improving efficiency and bringing out the
best software. DevOps methodologies thus play a significant role in all modern
companies today.
Automation of the software is becoming important to companies, there are many
advantages attached to it, for example, the reduction in errors. In manual functioning,
there are lot many scopes for errors that are human-induced and those errors become a
setback to the process where the time, cost, or resources are over utilized. But
automation reduces the scope of an error where it saves time, effort, and cost, and utilize
the resources well and in the end, it enhances the productivity of the team.
The sole aim of DevOps is to accelerate the process of app production. Moreover, the
DevOps lifecycle is all about continuity and consistency. It drives the entire production
process through continuous integration, development, feedback, monitoring, testing,
delivery, and deployment.
In order to make the journey to the cloud smooth, efficient, and effective, technology
companies should embrace DevOps principles and practices. These principles are
embedded in the AWS platform. Indeed, they form the cornerstone of numerous AWS
services, especially those in the deployment and monitoring offerings.

28
9) REFERENCES

• https://www.nginx.com/resources/glossary/load-balancing/
• https://www.vmware.com/topics/glossary/content/hypervisor.html#:~:text=A
%20hypervisor%2C%20also%20known%20as,such%20as%20memory%20an
d%20processing.
• https://www.javatpoint.com/what-is-data-center-in-cloud-computing
• https://www.edureka.co/blog/what-is-aws/
• https://www.vmware.com/in/solutions/virtualization.html#:~:text=Virtualizati
on%20relies%20on%20software%20to,of%20scale%20and%20greater%20eff
iciency.
• https://azure.microsoft.com/en-in/resources/cloud-computing-dictionary/what-
is-cloud-computing/#uses
• https://www.digitalocean.com/community/tutorials/apache-web-server-
dockerfile
• https://docs.docker.com/engine/reference/builder/#:~:text=A%20Dockerfile%
20is%20a%20text,command%2Dline%20instructions%20in%20succession.
• https://www.digitalocean.com/community/tutorials/how-to-install-and-use-
docker-on-ubuntu-18-04
• https://www.suse.com/c/rancher_blog/an-introduction-to-
containers/#:~:text=Containers%20are%20an%20operating%20system,many
%20different%20types%20of%20infrastructure.
• https://www.geeksforgeeks.org/introduction-to-docker/?id=discuss
• https://www.geeksforgeeks.org/introduction-to-sshsecure-shell-keys/
• https://maker.pro/linux/tutorial/basic-linux-commands-for-beginners

29

You might also like