0% found this document useful (0 votes)
4 views138 pages

advdevops journal

The document outlines the Program Outcomes, Educational Objectives, and Specific Outcomes for engineering graduates, particularly in the field of Information Technology at Datta Meghe College of Engineering. It details the skills and knowledge graduates are expected to acquire, including engineering knowledge, problem analysis, design solutions, and ethical responsibilities. Additionally, it includes course outcomes for the Advanced DevOps Lab, highlighting the practical skills students will gain in cloud computing, Kubernetes, and continuous integration/deployment practices.

Uploaded by

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

advdevops journal

The document outlines the Program Outcomes, Educational Objectives, and Specific Outcomes for engineering graduates, particularly in the field of Information Technology at Datta Meghe College of Engineering. It details the skills and knowledge graduates are expected to acquire, including engineering knowledge, problem analysis, design solutions, and ethical responsibilities. Additionally, it includes course outcomes for the Advanced DevOps Lab, highlighting the practical skills students will gain in cloud computing, Kubernetes, and continuous integration/deployment practices.

Uploaded by

Rutuja Jadhav
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Program Outcomes as defined by NBA (PO)

Engineering Graduates will be able to:

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


fundamentals, and an engineering specialization to the solution of complex engineering
problems.

2. Problem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of mathematics,
natural sciences, and engineering sciences.

3. Design/development of solutions: Design solutions for complex engineering problems


and design system components or processes that meet the specified needs with appropriate
consideration for the public health and safety, and the cultural, societal, and environmental
considerations.

4. Conduct investigations of complex problems: Use research-based knowledge and


research methods including design of 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 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 engineering practice.

7. Environment and sustainability: Understand the impact of the professional


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 engineering practice.

9. Individual and team work: Function effectively as an individual, and as a member or


leader in diverse teams, and in multidisciplinary settings.

10. Communication: Communicate effectively on complex 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.

1
11. Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own 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 in the broadest context of technological change.
Datta Meghe College of Engineering, Airoli, Navi Mumbai

DEPARTMENT OF INFORMATION TECHNOLOGY

Institute Vision : To create value - based technocrats to fit in the world of


work and research

Institute Mission : To adapt the best practices for creating competent


human beings to work in the world of technology and research.

Department Vision : To develop and foster students for successful careers in the dynamic
field of Information Technology.

Department Mission :

M1: To create and disseminate knowledge through research, teaching & learning and to
enhance society in meaningful and sustainable ways.

To impart a suitable environment for students and staff to showcase innovative ideas
in the field of IT.
M2:

To bridge the curriculum gap by facilitating effective interaction among industry


and Staff/Students.
M3:

2
Program Educational Objectives (PEO)

Develop proficiency as an IT technocrat with an ability to solve a wide range of


computational problems in industry, government, or other work environments.
PEO 1

Attain the ability to adapt quickly to new environments and technologies,


assimilate new information, and work in multi-disciplinary areas with a strong
focus on innovation and entrepreneurship.

PEO 2

Prepare graduates with the ability of life-long learning to innovate in


everchanging global economic and technological environments of the current
era.
PEO 3

Possess the ability to function ethically and responsibly with good cultural
values and integrity to apply the best principles and practices of Information
Technology towards the society.

PEO 4

Program Specific Outcomes (PSO)

Apply Core Information Technology knowledge to develop stable and secure IT


system
PSO1

Design, IT infrastructures for an enterprise using concepts of best practices in


Information Technology and security domain.
PSO2

Ability to work in multidisciplinary IT enabled projects for industry and society by


adapting latest trends and technologies like Analytics, Blockchain, Cloud, Data
science.

PSO3

3
Datta Meghe College of Engineering, Airoli
Department of Information Technology
Course Name: Advanced Devops Lab (R-19)
Course Code: ITL504 Year of
Study:2021 Semester: V

Course Outcomes
ITL504.1 To understand the fundamentals of Cloud Computing and be fully proficient
with Cloud based DevOps solution deployment options to meet your business
requirements

ITL504.2 To deploy single and multiple container applications and manage application
deployments with rollouts in Kubernetes

ITL504.3 To apply best practices for managing infrastructure as code environments and
use terraform to define and deploy cloud infrastructure

ITL504.4 To identify and remediate application vulnerabilities earlier and help integrate
security in the development process using SAST Technique

ITL504.5 To use Continuous Monitoring Tools to resolve any system errors (low memory,
unreachable server etc.) before they have any negative impact on the business
productivity

ITL504.6 To engineer a composition of nano services using AWS Lambda and Step
Functions with the Serverless Framework

4
DATTA MEGHE COLLEGE OF ENGINEERING
AIROLI, NAVI MUMBAI - 400708

CERTIFICATE
This is to certify that Mr. Rishi Kamal Tank of IT Branch Class TE-IT Roll No. 58

Subject Advanced Devops Lab has performed the experiments/Sheets

mentioned in the index, in the premises of this institution.

S. P. Nehete Dr. S. R. Kolhe Dr. S. D. Sawarkar

Practical Incharge Head of Dept. Principal

Date 21.10.21

Examined on

Examiner 1 _____________________________ Examiner 2 ___________________________

5
Datta Meghe DEPARTMENT OF INFORMATION TECHNOLOGY

College of Engineering, List of Experiments


Airoli, Navi Mumbai
Subject: Advanced Devops Lab
Code: ITL504
[Link]. Name of the Experiment CO Covered Page Date Signature
No.

To understand the benefits of Cloud 9


Infrastructure and Setup AWS Cloud9 IDE,
Launch AWS Cloud9 IDE and Perform
1 Collaboration Demonstration. LO1 15.7.21
To Build Your Application using AWS 25
CodeBuild and Deploy on S3 / SEBS using AWS
CodePipeline, deploy Sample Application on
EC2
2 instance using AWS CodeDeploy LO1 22.7.21
To understand the Kubernetes Cluster 34
Architecture, install and Spin Up a Kubernetes
Cluster on Linux Machines/Cloud Platforms.
3 LO1,LO2 22.7.21
To install Kubectl and execute Kubectl 39
commands to manage the Kubernetes cluster and
deploy Your First Kubernetes Application.
4 LO1,LO2 29.7.21
To understand terraform lifecycle, core 44
concepts/terminologies and install it on a Linux
Machine
5 LO1,LO3 12.8.21
To Build, change, and destroy AWS / GCP 49
/Microsoft Azure/ DigitalOcean infrastructure
6 Using Terraform LO1,LO3 12.8.21
To understand Static Analysis SAST process and 57
learn to integrate Jenkins SAST to
SonarQube/GitLab 26.8.21
7 LO1,LO4
Create a Jenkins CICD Pipeline with SonarQube 64 09/09/21
/ GitLab Integration to perform a static analysis
of the code to detect bugs, code smells, and
security vulnerabilities on a sample Web / Java /
8 Python application LO1,LO4
To Understand Continuous monitoring and 72 09/09/21
Installation and configuration of Nagios Core,
Nagios Plugins and NRPE (Nagios Remote
Plugin
9 Executor) on Linux Machine LO1,LO5

6
To perform Port, Service monitoring, 83 16.09.21
Windows/Linux server monitoring using Nagios
10 LO1,LO5
Assignment No1 LO1-LO6 122 27.7.21

Assignment No 2 LO1-LO6 127 7.9.21

7
DATTA MEGHE COLLEGE OF ENGINEERING,
AIROLI
Advance Devops
EXPERIMENT 01

Name: Rishi Tank


Year: TE
Branch: Information Technology
Div.: B
Roll no. : 58

Date: 15/07/21

8
Experiment 01

Aim
To understand the benefits of Cloud Infrastructure and Setup AWS Cloud9 IDE, Launch AWS
Cloud9 IDE and Perform Collaboration Demonstration.

Theory
AWS Cloud9 is a cloud-based integrated development environment (IDE) that lets you write,
run, and debug your code with just a browser. It includes a code editor, debugger, and
terminal. Cloud9 comes prepackaged with essential tools for popular programming languages,
including JavaScript, Python, PHP, and more, so you don’t need to install files or configure your
development machine to start new projects. Since your Cloud9 IDE is cloud-based, you can
work on your projects from your office, home, or anywhere using an internet-connected
machine. Cloud9 also provides a seamless experience for developing serverless applications
enabling you to easily define resources, debug, and switch between local and remote
execution of serverless applications. With Cloud9, you can quickly share your development
environment with your team, enabling you to pair programs and track each other's inputs in
real time.

Benefits:
CODE WITH JUST A BROWSER

AWS Cloud9 gives you the flexibility to run your development environment on a managed
Amazon EC2 instance or any existing Linux server that supports SSH. This means that you can
write, run, and debug applications with just a browser, without needing to install or maintain
a local IDE. The Cloud9 code editor and integrated debugger include helpful, time-saving
features such as code hinting, code completion, and step-through debugging. The Cloud9
terminal provides a browser- based shell experience enabling you to install additional
software, do a git push, or enter commands.

CODE TOGETHER IN REAL TIME

9
AWS Cloud9 makes collaborating on code easy. You can share your development environment
with your team in just a few clicks and pair programs together. While collaborating, your team
members can see each other in real time, and instantly chat with one another from within the
IDE.

BUILD SERVERLESS APPLICATIONS WITH EASE

AWS Cloud9 makes it easy to write, run, and debug serverless applications. It preconfigures
the development environment with all the SDKs, libraries, and plug-ins needed for serverless
development. Cloud9 also provides an environment for locally testing and debugging AWS
Lambda functions. This allows you to iterate on your code directly, saving you time and
improving the quality of your code.

DIRECT TERMINAL ACCESS TO AWS

AWS Cloud9 comes with a terminal that includes sudo privileges to the managed Amazon EC2
instance that is hosting your development environment and a preauthenticated AWS
Command Line Interface. This makes it easy for you to quickly run commands and directly
access AWS services

START NEW PROJECTS QUICKLY

AWS Cloud9 makes it easy for you to start new projects. Cloud9’s development environment
comes prepackaged with tooling for over 40 programming languages, including [Link],
JavaScript, Python, PHP, Ruby, Go, and C++. This enables you to start writing code for popular
application stacks within minutes by eliminating the need to install or configure files, SDKs,
and plug-ins for your development machine. Because Cloud9 is cloud-based, you can easily
maintain multiple development environments to isolate your project’s resources.

Steps:

1. Login with your AWS account.

2. Navigate to Cloud 9 service from Developer tools section as below:

10
3. Click on Create Environment :

11
4. Provide the name for the Environment (WebAppIDE) and click on next.

5. Keep all the Default settings as shown in below:

12
13
6. Review the Environment name and Settings and click on Create Environment

14
It will take a few minutes to create an aws instance for your Cloud 9 Environment.
7. Till that time open IAM Identity and Access Management in order to Add user In another
tab.

15
8. Add the user provided manual password if you want and click on Next permission tab.

16
9. Click on Create group
11. After that group is created click on next if u want to provide tag else click on Review for

10. Provide group name and click on create group. user settings and click on create user as
shown in fig.

12. Now close that window and Navigate to user Groups from the left pane in IAM.

17
13. click on your group name which you have created and navigate to permission tab as shown

15. Now we move towards our cloud9 IDE Environment tab it shows as shown

14. Now click on Add permission and select Attach Policy after that search for Cloud9 related
policy and select Aws cloud9 Environment Member policy

16. If you check at bottom side Cloud9 IDE also giving you and aws CLI for command
operations:
as we here checked git version, iam user details

18
17. Now we will setup collaborative environment Click on File you can create new file or choose
from template, here m opting html file to collaborate.

18. Edit html file and save it

19
19. Now in order to share this file to collaborate with other members of your team click on
Share option on Right Pane and username which you created in IAM before into
Invite members and enable permission as RW (Read and Write) and click on Done.
Click OK for Security warning.

[Link] Open your Browsers Incognito Window and login with IAM user which you configured
before.

20
21. After Successful login with IAM user open Cloud9 service from dashboard services and click
on shared with you environment to collaborate.

[Link] on Open IDE you will same interface as your other member have to collaborate in real
time, also you all within team can do group chats as shown below:

21
[Link] can also explore settings where you can update permissions of your teammates as from
RW to R only or you can remove users too.

22
Conclusion
Hence, we understood the benefits of Cloud Infrastructure and Setup AWS Cloud9 IDE, Launch
AWS Cloud9 IDE and Performed Collaboration Demonstration.

23
DATTA MEGHE COLLEGE OF ENGINEERING,
AIROLI
Advance Devops
EXPERIMENT 02

Name: Rishi Tank


Year: TE
Branch: Information Technology
Div.: B
Roll no. : 58

Date: 22/07/21

1
Experiment 02

AIM

To Build Your Application using AWS CodeBuildandDeploy on S3 / SEBS using AWS CodePipeline,
deploy SampleApplication on EC2 instance using AWS CodeDeploy.

THEORY
Continuous deployment allows you to deploy revisions to production environment
automatically without explicit approval from a developer, making the entire software release
process automated. You will create the pipeline using AWSCodePipeline, a service that builds,
tests, and deploys your code every time there is a code change. You will use your GitHub
account, an Amazon Simple Storage Service (S3) bucket, or an AWS CodeCommit repository as
the source location for the sample app’s code. You will also use AWS Elastic Beanstalk As the
deployment target for the sample app. Your completed pipeline will be able to detect changes
made to the source repository containing the sample app and then automatically update your
live sample app.

Step1: Create a deployment environment Your continuous deployment pipeline will need a
target environment containing virtual servers, or Amazon EC2 instances, where it will deploy
sample code. You will prepare this environment before creating the pipeline. 1) To simplify the
process of setting up and configuring EC2 instances for this tutorial, you will spin up a sample
environment using AWS Elastic Beanstalk. Elastic Beanstalk Lets you easily host web applications
without needing to launch, configure, or operate virtual servers on your own.
It automatically provisions and operates the infrastructure(e.g. virtual servers, load balancers,
etc.) and provides the application stack (e.g. OS, language and framework, web and application
server, etc.) for you.

2) Name your web app and choose PHP from the drop-down menu(or any other language you
are interested in) and then click Create Application.

2
anAmazon S3 bucket, Amazon CloudWatch alarms, and a domain name for your application.
Note: This will take several minutes to complete.

Step2: Get a copy of the sample code In this step, you will retrieve a copy of the sample app’s
code and choose a source to host the code.

3
The pipeline takes code from the source and then performs actions on it. You can use one of
three options as your source: aGitHub repository, an Amazon S3 bucket, or an AWS CodeCommit
repository. Select your preference and follow the steps below:

a. If you plan to use Amazon S3 as your source, you will retrieve the sample code from the
AWS GitHub repository, saveit toyour computer, and upload it to an Amazon S3 bucket.
• Visit our GitHub repository containing the sample codeat
[Link] codedeploy-linux-2.0 • Click
the dist folder.
b. Save the source files to your computer:
• Click the file named aws-codepipeline-s3-aws- codedeploy_linux.zip
• Click View Raw.
• Save the sample file to your local computer. c. open the Amazon S3 console and create
your AmazonS3bucket:
• Click Create Bucket
• Bucket Name: type a unique name for your bucket, such as aws codepipeline-demo
bucket- variables. All bucket names in Amazon S3 must be unique, souse one of your own,
not one with the name shown in example.
• Region: In the drop-down, select the region where you will create your pipeline, such as
apSouth-1
• Click Create.
[Link] console displays the newly created bucket, whichis empty.
• Click Properties.
• Expand Versioning and select Enable Versioning. Whenversioning is enabled, Amazon S3
saves every version of every object in the bucket. e. You will now upload the sample code
to the AmazonS3bucket:
• Click Upload.
• Follow the on-screen directions to upload the .zip file containing the sample code you

4
downloaded from GitHub

S te p 3 : C re a te y o u r P ip e lin e
In this step, you will create and configure a simple pipeline with two actions: source and deploy.

5
You will provide CodePipelinewith the locations of your source repository and deployment
environment. A true continuous deployment pipeline requires build stage, where code is
compiled and unit tested. CodePipeline lets you plug your preferred build provider intoyour
pipeline. However, in this we will skip the build stage. Goto Pipeline again and create it

S te p 4 : D e p lo y S ta g e
• Deployment provider:Click AWS Elastic Beanstalk. • Application name: MYEBS.
• Environment name: Click Myebs-env.

6
pipeline perform each action. To verify your pipeline ran successfully, monitor the progress of
the pipeline as it moves through each stage. The status of each stage will change fromNo
execution yet to In Progress, and then to either Succeeded or
Failed. The Pipeline should complete the first run within a few minutes.

Now go to your EBS environment and click on the URL to view the sample website you deployed.

7
You have successfully created an automated software releasepipeline using AWS CodePipeline!
Using CodePipeline, you created a pipeline that uses GitHub, Amazon S3, or AWS CodeCommit
as the source location for application code and then deploys the code to an AmazonEC2instance
managed by AWS Elastic Beanstalk.

Step 5: Commit a change and then update your app In this step, you will revise the sample
code and commit the change to your repository. CodePipeline will detect your updated sample
code and then automatically initiate deploying it to your EC2 instance via Elastic Beanstalk.
Note that the sample web page you deployed refers toAWSCodeDeploy, a service that
automates code deployments. InCodePipeline, CodeDeploy is an alternative to using
ElasticBeanstalk for deployment actions. Let’s update the sample code so that it correctly states
that you deployed the sample using Elastic Beanstalk. a. Visit your own copy of the repository
that you forked GitHub.
• Open [Link] •
Select the Edit icon
b. Update the webpage by copying and pasting the following text on line 30:
c. Commit the change to your repository.
d. Return to your pipeline in the CodePipeline console. In Afew Minutes, you should see the
Source change to blue, indicating that the pipeline has detected the changes you made
toyour source repository. Once this occurs, it will automatically move the updated code
to Elastic Beanstalk.
• After the pipeline status displays Succeeded, in the status area for the Beta stage, click AWS
Elastic Beanstalk. e. The AWS Elastic Beanstalk console opens with the details of the deployment.
Select the environment you created earlier. And click the URL again from EBS environment again.

8
Step 6: Clean up your resources
To avoid future charges, you will delete all the resources you launched throughout this tutorial,
which includes the pipeline, the Elastic Beanstalk application, and the source you set up host the
code.
a. First, you will delete your pipeline:
• In the pipeline view, click Edit.
• Click Delete.
• Type in the name of your pipeline and click Delete. b. Second, delete your Elastic Beanstalk
application: • Visit the Elastic Beanstalk console.
• Click Actions.
• Then click Terminate Environment.
You have successfully created an automated software release pipeline using AWS CodePipeline!
Using CodePipeline, you created a pipeline that uses GitHub, Amazon S3, or AWS CodeCommit
as the source location for application code and then deploys the code to an AmazonEC2instance
managed by AWS Elastic Beanstalk. Your pipeline will automatically deploy your code every time
there is a code change

CONCLUSION
Hence , building Application using AWS CodeBuild and deploying on S3 / SEBS using AWS
CodePipeline, deploy Sample Application on EC2 instance using AWS CodeDeploy is successfully
implemented.

9
DATTA MEGHE COLLEGE OF ENGINEERING AIROLI
Advance Devops
EXPERIMENT 03

Name: Rishi Tank


Year: TE
Branch: Information Technology
Div.: B
Roll no. : 58

Date: 22/07/21
Experiment 03

Aim: To understand the Kubernetes Cluster Architecture, install and Spin


Up a Kubernetes Cluster on Linux Machines/Cloud Platforms.

Theory:
Kubernotes:
Kubernetes is a portable, extensible, open-source platform for managing containerized workloads
and services, that facilitates both declarative configuration and automation.

It has a large, rapidly growing ecosystem.

Kubernetes services, support, and tools are widely available.

Kubernetes is an open-source container-orchestration system for automating computer application


deployment, scaling, and management.

Nodes:
A Pod always runs on a Node.

A Node is a worker machine in Kubernetes and may be either a virtual or a physical machine,
depending on the cluster.

Each Node is managed by the control plane.

A Node can have multiple pods, and the Kubernetes control plane automatically handles scheduling
the pods across the Nodes in the cluster.

The control plane's automatic scheduling takes into account the available resources on each Node.

Controller:
A controller tracks at least one Kubernetes resource type.
These objects have a spec field that represents the desired state.
The controllers for that resource are responsible for making the current state come closer to that
desired state.
Cloud Controller Merge:
Cloud infrastructure technologies let you run Kubernetes on public, private, and hybrid clouds.
Kubernetes believes in automated, API-driven infrastructure without tight coupling between
components.
The cloud-controller-manager is a Kubernetes control plane component that embeds cloudspecific
control logic.
The cloud controller manager lets you link your cluster into your cloud provider's API, and
separates out the components that interact with that cloud platform from components that only
interact with your cluster.

Design:

Outputs:
Installing the Kubernetes-cli using chocolatey.
Installing minikube:

Spinning up Kubernetes cluster:


Conclusion: Kubernetes architecture was studied in detail and a Kubernetes
cluster was spun up successfully.
DATTA MEGHE COLLEGE OF ENGINEERING,
AIROLI
Advance Devops
EXPERIMENT 04

Name: Rishi Tank


Year: TE
Branch: Information Technology
Div.: B
Roll no. : 58

Date: 29/07/21
Experiment 04
Aim: To install Kubectl and execute Kubectl commands to manage the
Kubernetes cluster and deploy Your First Kubernetes Application.

Theory:
Kubectl:
The Kubernetes command-line tool, kubectl, allows you to run commands
against Kubernetes clusters. You can use kubectl to deploy applications,
inspect and manage cluster resources, and view logs.

Deploying applications using kubectl:


Once you have a running Kubernetes cluster, you can deploy your
containerized applications on top of it. To do so, you create a Kubernetes
Deployment configuration. The Deployment instructs Kubernetes how to
create and update instances of your application. Once you've created a
Deployment, the Kubernetes control plane schedules the application
instances included in that Deployment to run on individual Nodes in the
cluster.

Once the application instances are created, a Kubernetes Deployment


Controller continuously monitors those instances. If the Node hosting an
instance goes down or is deleted, the Deployment controller replaces the
instance with an instance on another Node in the cluster. This provides a
self-healing mechanism to address machine failure or maintenance.

In a pre-orchestration world, installation scripts would often be used to


start applications, but they did not allow recovery from machine failure. By
both creating your application instances and keeping them running
across Nodes, Kubernetes Deployments provide a fundamentally
different approach to application management.
You can create and manage a Deployment by using the Kubernetes
command line interface, Kubectl. Kubectl uses the Kubernetes API to
interact with the cluster. In this module, you'll learn the most common
Kubectl commands needed to create Deployments that run your applications
on a Kubernetes cluster.

When you create a Deployment, you'll need to specify the container image
for your application and the number of replicas that you want to run.

Outputs:
Installing kubectl using chocolatey:
Deploying first application using Kubernetes:
Checking the deployed application:

Conclusion: Kubectl was successfully installed and an application was


successfully deployed using Kubernetes.
DATTA MEGHE COLLEGE OF ENGINEERING,
AIROLI
Advance Devops
EXPERIMENT 05

Name: Rishi Tank


Year: TE
Branch: Information Technology
Div.: B
Roll no. : 58

Date: 12/08/21
EXPERIMENT NO : 05

AIM : To understand terraform lifecycle, core


concepts/terminologies and install it on a Linux Machine
THEORY :
Terraform is an open-source infrastructure as code
software tools created by HashiCorp. Users define and
provide data center infrastructure using a declarative
configuration language known as HashiCorp Configuration
Language (HCL) or optionally JSON.
Terraform supports a number of cloud infrastructure
providers such Amazon Web Services, Microsoft Azure,
IBM Cloud, Google Cloud Platform, DigitalOcean, Oracle
Cloud Infrastructure, [Link], vMware vSphere
and OpenStack.
Terraform has four major commands
$ terraform init
$ terraform plan
$ terraform apply
$ terraform destroy
INSTALLATION OF TERRAFORM
Step 1: Download the Terraform Cli utility

Step 2: Extract the downloaded setup file


[Link] in C:\Terraform directory
Step 3: Set the System path for Terraform in
Environment variables

Step 4: Open Powershell with Admin Access


Step 5: Open Terraform in Powershell and check its
functionality

CONCLUSION : Hence we can conclude that we have


learned and implemented terraform lifecycle, core
concepts/terminologies and install it on a Linux Machine.
DATTA MEGHE COLLEGE OF ENGINEERING, AIROLI
Advance Devops
EXPERIMENT 06

Name: Rishi Tank


Year: TE
Branch: Information Technology
Div.: B
Roll no. : 58

Date: 12/08/2021
EXPERIMENT NO : 06

AIM : To Build, change and destroy


AWS/GCP/Microsoft Azure/DigitalOcean infrastructure
using Terraform THEORY :

Terraform is an open-source infrastructure as code


software tools created by HashiCorp. Users define and
provide data center infrastructure using a declarative
configuration language known as HashiCorp Configuration
Language (HCL) or optionally JSON.
Terraform supports a number of cloud infrastructure
providers such Amazon Web Services, Microsoft Azure,
IBM Cloud, Google Cloud Platform, DigitalOcean, Oracle
Cloud Infrastructure, [Link], vMware vSphere
and OpenStack.
Terraform has four major commands
$ terraform init
$ terraform plan
$ terraform apply
$ terraform destroy
DESTROY AWS INFRASTRUCTURE USING TERRAFORM
Step 1: Download AWS Cli and set environment variable
Step 2: Log into your AWS account
Step 2: Log into your AWS account

Step 3: Open the instance section in EC2 services

Step 4: Write command terraform apply to create a new


instance
Step 5: Type the command terraform destroy to delete the
instance created
CONCLUSION : Hence we can conclude that we have learned
and implemented To Build, change and destroy
AWS/GCP/Microsoft Azure/DigitalOcean infrastructure
using Terraform.
DATTA MEGHE COLLEGE OF ENGINEERING, AIROLI
Advance Devops
EXPERIMENT 07

Name: Rishi Tank


Year: TE
Branch: Information Technology
Div.: B
Roll no. : 58

Date: 26/08/2021
EXPERIEMENT NO : 07

AIM : To understand Static Analysis SAST


process and learn to integrate Jenkins SAST to
SonarQube/GitLab.

THEORY :
SonarQube is a Code Quality Assurance tool that
collects and analyzes source code, and provides
reports for the code quality of your project. It
combines static and dynamic analysis tools and
enables quality to be measured continually over
time. Everything from minor styling choices, to
design errors are inspected and evaluated by
SonarQube. This provides users with a rich
searchable history of the code to analyze where the
code is messing up and determine whether or not it
is styling issues, code defeats, code duplication, lack
of test coverage, or excessively complex code. The
software will analyze source code from different
aspects and drills down the code layer by layer,
moving module level down to the class level, with
each level producing metric values and statistics
that should reveal problematic areas in the source
code that needs improvement.
Sonarqube also ensures code reliability,
Application security, and reduces technical debt
by making your code base clean and maintainable.
Sonarqube also provides support for 27 different
languages, including C, C++, Java, Javascript, PHP,
GO, Python, and much [Link] also
provides Ci/CD integration, and gives feedback
during code review with branch analysis and pull
request decoration.
SonarQube Benefits:
• CI tools do not have a plugin which would make all of
these tools work easily together
• CI tools do not have plugins to provide nice drill-
down features that SonarQube has
• CI Plugins does not talk about overall compliance
value
• CI plugins do not provide managerial perspective
• There is no CI plugin for Design or Architectural
issues
• CI plugins do not provide a dashboard for overall
project quality
SonarQube Setup Step
1: SonarQube Instance

Step 2: Generate user token

Step 3: Add necessary plugin

Step 4: Configuring SonarQube in Codebase


Step 5: Jenkins Setup for SonarQube

Step 6: Tool configuration with SonarQube Scanner


Step 7: SonarQube Scanner in Jenkins Pipeline
Step 8: Check the output

CONCLUSION : Hence, we Successfully


understood Static Analysis SAST process and
learnt to integrate Jenkins SAST to
SonarQube/GitLab.
DATTA MEGHE COLLEGE OF ENGINEERING, AIROLI
Advance Devops
EXPERIMENT 08

Name: Rishi Tank


Year: TE
Branch: Information Technology
Div.: B
Roll no. : 58

Date: 09/09/2021
EXPERIMENT NO . 8

AIM :- Create a Jenkins CICD Pipeline with SonarQube / GitLab


Integration to perform a static analysis of the code to detect
bugs, code smells, and security vulnerabilities on a sample Web /
Java / Python application.

THEORY :-
SonarQube is a universal tool for static code analysis that has
become more or less the industry standard. Keeping code clean,
simple, and easy to read is also a lot easier with SonarQube.
SonarQube is an open-source platform developed by SonarSource
for continuous inspection of code quality. Sonar does static code
analysis, which provides a detailed report of bugs, code smells,
vulnerabilities, code duplications.
Benefits of SonarQube
1. Sustainability - Reduces complexity, possible vulnerabilities,
and code duplications, optimising the life of applications. 2.
Increase productivity - Reduces the scale, cost of
maintenance, and risk of the application; as such, it removes
the need to spend more time changing the code
3. Quality code - Code quality control is an inseparable part of
the process of software development.
4. Detect Errors - Detects errors in the code and alerts
developers to fix them automatically before submitting them
for output.
5. Increase consistency - Determines where the code criteria
are breached and enhances the quality
Business scaling - No restriction on the number of projects to be
evaluated.
6. Enhance developer skills - Regular feedback on quality
problems helps developers to improve their coding skills.
SonarQube Setup
SonarQube Instance
Before proceeding with the integration, we will setup
SonarQube Instance. Choice of the platform is yours.

Generate User Token


Now, we need to get the SonarQube user token to make
connection between Jenkins and SonarQube. For the same, go
to User > My Account > Security and then, from the bottom of
the page you can create new tokens by clicking the Generate
Button. Copy the Token and keep it safe.

Add necessary plugin


In this Tutorial, we are following a Python-based application. So,
we need to add a python plugin in the SonarQube so that it will
collect the Bugs and Static code analysis from Jenkins. For the
same, go to Administration > Marketplace > Plugins. Then in the
search box, search for Python. Then, you will see Python Code
Quality and Security (Code Analyzer for Python). Just install.
That’s all from the SonarQube side.
Jenkins Setup for SonarQube
SonarQube plugin in Jenkins.
Before all, we need to install the SonarQube Scanner plugin in
Jenkins. For the same, go to Manage Jenkins > Plugin
Manager > Available. From here, type SonarQube Scanner then
select and install.

Tool Configuration SonarQube Scanner


Now, we need to configure the Jenkins plugin for SonarQube
Scanner to make a connection with the SonarQube Instance.
For that, got to Manage Jenkins > Configure System >
SonarQube Server. Then, Add SonarQube. In this, give the
Installation Name, Server URL then Add the Authentication
token in the Jenkins Credential Manager and select the same in
the configuration.
Then, we need to set-up the SonarQube Scanner to scan the
source code in the various stage. For the same, go to Manage
Jenkins > Global Tool Configuration > SonarQube Scanner.
Then, Click Add SonarQube Scanner Button. From there, give
some name of the scanner type and Add Installer of your
choice. In this case, I have selected SonarQube Scanner from
Maven Central.

SonarQube Scanner in Jenkins Pipeline


Now, It’s time to integrate the SonarQube Scanner in the
Jenkins Pipeline. For the same, we are going to add one more
stage in the Jenkinsfile called sonar-publish.
stage ("sonar-publish"){ steps { echo
"===========Performing Sonar
Scan============" sh
"${tool("sonarqube")}/bin/sonar-scanner"
}
}

Were this will collect the SonarQube Server information from


the [Link] file and publish the collected
information to the SonarQube Server. So, the overall code will
look like the below snippet.
pipeline { agent any stages { stage ("Git
checkout"){ steps { git branch:
"master", url:
"[Link] sh
"ls"
}
}
stage ("Python Flask Prepare"){ steps { sh
"pip3 install -r [Link]"
}

}
stage ("Unit Test"){ steps{ sh
"python3 test_basic.py"
}
}
stage ("Python Bandit Security Scan"){
steps{ sh "cat
report/[Link]" sh "sh
run_bandit.sh || true"
sh "ls"
}
}
stage ("Dependency Check with Python Safety"){
steps{ sh "docker run --rm --volume
\$(pwd)
pyupio/safety:latest safety check" sh "docker run --rm --
volume \$(pwd)
pyupio/safety:latest safety check --json > [Link]"
}
}
stage ("Static Analysis with python-taint"){ steps{
sh "docker run --rm --volume \$(pwd)
vickyrajagopal/python-taint-docker pyt ."
}
}
stage ("sonar-publish"){ steps { echo
"===========Performing Sonar
Scan============"
sh "${tool("sonarqube")}/bin/sonar- scanner"
}
}

}
}
Where it will just execute the SonarQube Scanner and collect
the SAST information and Python bandit report in the format of
JSON. Then, it will publish the same in the SonarQube Server. If
you login to the SonarQube and visit the Dashboard, you will
see the Analysis of the project there.

CONCLUSION :- Hence , Creating a Jenkins CICD Pipeline with


SonarQube / GitLab Integration to perform a static analysis of
the code to detect bugs, code smells, and security
vulnerabilities on a sample Web / Java / Python application is
successfully implemented.
DATTA MEGHE COLLEGE OF ENGINEERING, AIROLI
Advance Devops
EXPERIMENT 09

Name: Rishi Tank


Year: TE
Branch: Information Technology
Div.: B
Roll no. : 58

Date: 09/09/2021
EXPERIMENT NO. : 09

AIM : To understand Continuous monitoring and


Installation and configuration of Nagios Core, Nagios
Plugins and NRPE on Linux machine THEORY :

Nagios is a popular and open-source application that is


used for continuous monitoring of systems, networks,
services and applications. It constantly monitors the
status of machines and various services. In case of any
issue, it provides early warning so that administrator
can take required actions. Nagios performs all checks
on local and host machines using the externalprograms
known as plugins. It also provides you with a web
interface that allows viewing the status of hosts and
services, history, logs and generating reports.
Nagios was originally designed to run under Linux, but
it also runs on other Unix variants. It is free software
licensed under the terms of the GNU General Public
License version 2 as published by the Free Software
Foundation.

Installation and configuration of Nagios Core


Installing Nagios Core involves downloading the
Nagios Core source code; then, configuring, making
and installing it on the host that will run Nagios
Core instance.

Installing Nagios Prerequisites

Open port 80 for httpd

Creating a Nagios User and Group

Create a user and group for Nagios Core.

Then, execute the following:

Download Nagios Source Code and Plug-Ins


Download the latest version of Nagios Core and Plugins

Make and Install Nagios Core

To make and install Nagios Core, first run ./configure.

After running ./configure, compile the Nagios Core


source code.

After making Nagios Core, install it.

Copy the event handlers and change their ownership.


Finally, run the pre-flight check.

Installation and configuration of Nagios Plug-Ins


Download the latest version of the Nagios plug-ins.
Then, make and install them.

Installation and configuration of NRPE (Nagios


Remote Plugin Executor)

Enable and Start NRPE


Open Port 5666
Open port 5666 to allow communication with NRPE.

Edit the NRPE configuration with the Nagios server’s


IP address.

Add the IP address of the Nagios Core


server to the allowed_hosts setting.
Then, restart nrpe
Test the Installation
Ensure that the make and install procedures worked.

CONCLUSION :- Hence , we successfully understood


Continuous monitoring and Installation and
configuration of Nagios
Core, Nagios Plugins and NRPE (Nagios Remote Plugin
Executor) on Linux Machine is implemented.
DATTA MEGHE COLLEGE OF ENGINEERING, AIROLI

1
Advance Devops EXPERIMENT 10

2
Name: Rishi Tank

3
Year: TE

4
Branch: Information Technology
Div.: B
Roll no. : 58
Date: 16/09/2021
Experiment No-10

Aim : To perform Port, Service monitoring, Windows/Linux server monitoring using Nagios.

Theory :

Linux – Network Monitoring Tools


Network monitoring is using a system (hardware or software) that continuously
observes your network and the data flows through it, depending on how the
monitoring solution actually functions and informs the network administrator. We
can keep a check on all the activities of our network easily. While Network
management we need network Monitoring.

5
To monitor Windows Machines you will need to follow several steps and they are:

6
Install NSClient++ addon on the Windows Machine.
Configure Nagios Server for monitoring Windows Machine.
Add new host and service definitions for Windows machine monitoring.

7
Restart the Nagios Service.

8
To make this guide simple and easier, a few of configuration already done for you in the Nagios
installation.

A check_nt command definition already added to the [Link] file. This definition command is
used by check_nt plugin to monitor Windows services. A windows-server host template already
created in the [Link] file. This template allows you to add new Windows host definitions.

Check Nagios Configuration path


Login to Nagios Server. Use the following command to check the Nagios configuration path.
$ ps -ef | grep nagios

Create config files for Windows and Linux host


Create a directory, say montitorhosts in /etc/nagios/objects/

9
$ mkdir /etc/nagios/objects/monitorhosts

10
Create two directories, say linuxhosts and windowshosts in/etc/nagios/objects/monitorhosts/
$ mkdir /etc/nagios/objects/monitorhosts/windowshosts

$ mkdir /etc/nagios/objects/monitorhosts/linuxhosts

11
12
$ cp /etc/nagios/objects/[Link]
/etc/nagios/objects/monitorhosts/windowshosts/[Link]

13
14
$ cp /etc/nagios/objects/[Link]
/etc/nagios/objects/monitorhosts/linuxhosts/[Link]

15
$ nano /etc/nagios/objects/monitorhosts/windowshosts/[Link]

16
$ nano /etc/nagios/objects/monitorhosts/linuxhosts/[Link]

17
18

$ nano /etc/nagios/[Link]
19
Check the Nagios Configuration

20
$ /usr/sbin/nagios -v /etc/nagios/[Link]

21
22
Restart Nagios Service
$ service nagios restart

Configuration in Linux host


Login to Linux Server and Install nrpe plugin.

23
$ sudo yum install nrpe -y

24
25
26
Open nrpe config file

$ nano /etc/nagios/[Link]

Put the IP address of Nagios Server in allowed_hosts in [Link].

Restart nrpe service

Configuration in Windows host

27
Log in to your Windows Server and download nsclient++ and install it. You can use the following

28
link to download the nsclient++ for windows.

[Link]

Install Nsclient++ in your Windows Server.

29
Select Generic

30
Select Typical

Enter Nagios Server IP Address in Allowed Hosts and tick mark the modules as

31
mentioned in the below screenshot.

32
Click on Finish

33
[Link] settings

34
Now open the following file as run as administrator in your Windows Server

35
C:\Program Files\NSClient++\[Link]

36
CheckExternalScripts = enabled

37
CheckHelpers = enabled

CheckEventLog = enabled

CheckNSCP = enabled

CheckDisk = enabled

CheckSystem = enabled

NSClientServer = enabled NRPEServer = enabled

After changes restart the nsclient++ service in services.

38
We are now all done in our Windows Server.

AWS Security Group Configuration for Windows and Linux Server

Open Security Group for Windows Server and allow port 5666 and 12489 and
ICMP for Nagios Server IP.

39
Open Security Group for Linux Server and allow port 5666 and ICMP port for
Nagios Server IP.

Note: If your servers are not in the AWS environment, you can allow these ports in
the local firewall of both the servers.

Monitor Windows and Linux Host

Now your both Linux and Windows Servers are ready to Monitor. You can monitor
your servers using the following URL.

[Link]
Default Username: nagiosadmin

40
Default Password : nagiosadmin

Conclusion:

41
Hence, We successfully performed Port, Service monitoring, Windows/Linux server monitoring

42
using Nagios.

43
DATTA MEGHE COLLEGE OF ENGINEERING, AIROLI

Advance Devops Lab

Assignment 1

Name: Rishi Tank


Year: TE
Branch: Information Technology
Div.: B

Roll no. : 58 Date: 27/07/2021


AWS CodeStar:

AWS CodeStar enables you to quickly develop, build, and


deploy applications on AWS. AWS CodeStar provides a
unified user interface, enabling you to easily manage your
software development activities in one place. With AWS
CodeStar, you can set up your entire continuous delivery
toolchain in minutes, allowing you to start releasing code
faster. AWS CodeStar makes it easy for your whole team
to work together securely, allowing you to easily manage
access and add owners, contributors, and viewers to your
projects. Each AWS CodeStar project comes with a
project management dashboard, including an integrated
issue tracking capability powered by Atlassian JIRA
Software. With the AWS CodeStar project dashboard, you
can easily track progress across your entire software
development process, from your backlog of work items to
teams’ recent code deployments. Visit here to learn
more.
There is no additional charge for using AWS CodeStar.
You only pay for the AWSresources that you provision for
developing and running your application (for example,
Amazon EC2 instances).
AWS CodeStar feature
Project templates
AWS CodeStar provides a number of project templates to
help you quickly start developing applications for
deployment on Amazon EC2, AWS Lambda, andAWS
Elastic Beanstalk with support for many popular
programming languages including Java, JavaScript,
Python, Ruby, and PHP. With AWS CodeStar, you can use
a code editor of your choice such as Visual Studio,
Eclipse, or the o Team access management
AWS CodeStar uses AWS Identity and Access
Management (IAM) to manage developer identities and
provides built-in, role-based security policies that allow
you to easily secure access to your team. AWS CodeStar
allows you to share your projects using three levels of
access:
i. Owners ii.
Contributors iii.
Viewers
• Hosted Git repository

AWS CodeStar stores your application code securely on


AWS CodeCommit, a fullymanaged source control service
that eliminates the need to manage your own
infrastructure to host Git repositories. You can also
choose to have your project source code stored in a
GitHub repository in your own GitHub account. o Fully
managed build service
AWS CodeStar compiles and packages your source code
with AWS CodeBuild, a fullymanaged build service that
makes it possible for you to build, test, and integrate
code more frequently.

• Automated continuous delivery pipeline


AWS CodeStar accelerates software release with the help
of AWS CodePipeline, a continuous integration and
continuous delivery (CI/CD) service. Each project comes
preconfigured with an automated pipeline that
continuously builds, tests, and deploys your code with
each commit.
Sample Application:
Select HTML5 AND EC2:
DATTA MEGHE COLLEGE OF ENGINEERING, AIROLI
Advance Devops Lab

Assignment 2

Name: Rishi Tank


Year: TE
Branch: Information Technology
Div.: B

Roll no. : 58

Date: 07/09/2021
Q. Define input variable, query data with output and store remote state of
terraform.

Terraform supports a few different variable formats. Depending on the usage, the
variables are generally divided into inputs and outputs.

• The input variables are used to define values that configure your
infrastructure. These values can be used again and again without having to
remember their every occurrence in the event it needs to be updated.

• Output variables, in contrast, are used to get information about the


infrastructure after deployment. These can be useful for passing on
information such as IP addresses for connecting to the server.

Input variables
Input variables are usually defined by stating a name, type and a default value.
However, the type and default values are not strictly necessary. Terraform can
deduct the type of the variable from the default or input value.

Variables can be predetermined in a file or included in the command-line options.


As such, the simplest variable is just a name while the type and value are selected
based on the input.
The input variables,use a couple of different types: strings, lists, maps, and boolean.

Output variables
Output variables provide a convenient way to get useful information about your
infrastructure. As you might have noticed, much of the server details are calculated
at deployment and only become available afterwards. Using output variables you
can extract any server-specific values including the calculated details.
Apply your configuration
Query Data
Cloud infrastructure, applications, and services emit data, which Terraform can
query and act on using data sources. Terraform uses data sources to fetch
information from cloud provider APIs, such as disk image IDs, or information about
the rest of your infrastructure through the outputs of other Terraform configurations.

Data sources allow you to load data from APIs or other Terraform workspaces. You
can use this data to make your project's configuration more flexible, and to connect
workspaces that manage different parts of your infrastructure. You can also use data
sources to connect and share data between workspaces in Terraform Cloud and
Terraform Enterprise.
Initial configuration
Destroy infrastructure
Store Remote State

Remote backends allow Terraform to use a shared storage space for state data. The
Terraform Cloud remote backend also allows teams to easily version, audit, and
collaborate on infrastructure changes. Terraform Cloud also securely stores
variables, including API tokens and access keys. It provides a safe, stable
environment for long-running Terraform processes.

Login to terraform
Initialize Terraform

You might also like