Understanding SDLC and DevOps Frameworks
Understanding SDLC and DevOps Frameworks
n and
Course
Hand-out Perform activity – Create 2
briefing project team, demo on process
of following SDLC process
SDLC also called as Software Development Process
Developme
nt Life Framework which details the various tasks
performed at every step
Cycle
Objective is to high quality software as an end
product
Requirement
Initiation Planning Design
Analysis
Waterfall
Model Divided into various phases
The output of one phase acts as the input for
the next phase
AGILE
Plan Design Develop Test Release Feedback
• Agile team produces software in small amount and incrementally instead of a big large release
• Constant and better collaboration with stakeholders and continuous improvement at every stage
Developer Operations
ges of
DevOps Hard to manage adoption of new DevOps
technologies in short time
•DevOps pipeline consists of various phases, and it tries to get rid of manual
operations as much possible in these phases
•It may include one or more manual gates that require human intervention before
it proceed to next phase
Continuous Development
Continuous Integration
Continuous Testing
Lifecycle
of Continuous Monitoring
DevOps Continuous Feedback
Continuous Deployment
Continuous Operations
The project goal and plans are created
during planning.
s by developers.
Continuou
s It helps in early detection of problems if any exists
in the code.
Integration
One of the popular tool, Jenkins, can be used to
perform automation in this phase. Any change in
the Git repository, Jenkins fetches the updated
code and prepares a build of that code and
package it. This build is then forwarded to the test
server or the production server.
In this phase the artifact, the compiled tested
bundled code, is deployed on the production server.
Continuou
s In this phase, specifically for production deployment,
Deployme
a manual gate is preferred.
nt
In other non-production environments, the
deployment can be automated and continuous.
In this phase the application is continuously
monitored for its performance.
Continuou
s Logs, metrices, events etc. are recorded and
analyzed for application performance and issues.
Monitoring
Operations team setup the tools and provide access
to developers to various metrices, logs which
developers to closely check the health of the
application.
It consists of two types of feedback – end user
feedback and application monitoring feedback.
Continuou
s End user provides their feedback based on their
experiences while browsing the application.
Feedback
Automated monitoring tools also provide vital
information and alerts on the application
performance and issues when used by end user.
DevOps Pipeline
The management of deployment pipelines can be approached prior to releasing artifacts into production. Continuous
Delivery and Continuous Deployment are the strategies focusing on the roles of manual intervention and approval
automation.
Continuous Delivery and Continuous Deployment
Continuous Delivery
Automates the software release process, but requires a manual decision to deploy to production. This
gives developers time to review changes and coordinate with other business activities. Continuous delivery is a
good choice for organizations that need to balance speed and reliability.
Continuous Deployment
Automates the entire release process, including the deployment to production. This means that every
change that passes all stages of the production pipeline is automatically released to customers. Continuous
deployment is a good choice for organizations that want to quickly innovate and minimize release
friction. However, it has a higher risk because of the lack of manual intervention
DevOps Lifecycle
DevOps
Ecosystem
Market trends of DevOps
Serverless Microservices
Containerization
computing architecture
Infrastructure as a
Automation
code
1. Containerization
Marke Container technologies has made an impact in the rise of DevOps. Containers are lightweight, self-
contained environments that make it easier to host and manage web applications. By 2023,
Gartner expects 70% of companies to run two or more containerized applications. As more and
t more apps will be developed, DevOps will be needed to deal with the system complexities.
of The concept of serverless computing has emerged as a new and exciting approach to deploying
software and other services. Serverless computing removes server maintenance, system updates
workload from the developers. Serverless computing generates code for DevOps pipelines without
s 3. Microservices Architecture
Microservices architecture focuses on building smaller and manageable applications than a large
monolithic applications. It encourages shorter software release intervals. Along with robust DevOps
processes, it becomes easier to build applications faster.
4. DevSecOps
Building internet facing application, security becomes a major concern for organizations.
DevSecOps integrates best practices in software development, delivery, and operations with an
Marke emphasis on security and observability, so the risks and vulnerabilities in the given applications are
reduced. DevSecOps helps to close the security knowledge gap between IT and business. It
supports the early detection of cyber risks and the reduction of costs associated with their
t remediation.
5. Low-code apps
trends Low-code platforms allow you to build apps without coding knowledge. This allows non-technical
of people to contribute to software development through a visual interface that manages the entire
app development process. It allows users to build their own workflows and logic by dragging and
dropping elements. This trend in DevOps speeds up the entire development and deployment
DevOp
process by creating simple and user-friendly apps.
s
6. GitOps
GitOps is one of the ways to implement and manage Kubernetes clusters. By releasing incremental
updates, continuous delivery enables development teams to build, test, and deploy software more
quickly. It is essential that a Kubernetes continuous integration and runtime pipeline be capable of
reading and writing files to Git, updating container repositories, and loading containers. Version
control for configuration changes, as well as real-time monitoring and alerting are all possible with
GitOps, allowing the business to better manage infrastructure.
Marke 7. Infrastructure as a Code
t Infrastructure as a Code automates resource management and provisioning by using code, instead
of using configuration tools. DevOps teams may provide and control all parts of the environment,
trends including VMs, operating systems, containers, application configuration, storage, networking, and
connections between multiple components, using infrastructure as code.
of 8. Automation
DevOp DevOps encourages towards automation and help businesses become more efficient, responsive,
and transparent to their customers. In order to meet the increasing demands and quick software
s turn around, a high level of multitasking skilled development team is expected and the only way to
achieve this is to adopt and accelerate automation. Automation of time-consuming long processes
enables development team to focus on other critical requirements.
DevOps Roles, Responsibilities, Skills
•It allows to track and work together with project team members at the same
workspace.
•Developers can compare earlier versions of the code with an older version to
fix the mistakes.
Git Repository
•Repository is the storage location where all files, packages/folders are kept.
•Developers works on their local repository and push their work to remote repository.
Remote Repository
Server
Remote Repository
Developer 2 Developer 3
Developer 1
Local Repository Local Repository
Local Repository
Git Installation
Follow the installation wizard and click on next next button.
Download [Link]
windows/git/releases/download/v2.3
[Link].2/[Link]
Git init
•This command is used to create a local repository.
•Syntax
using GitHub
•Git clone command
Git clone •This command is used to make a copy of a repository from an existing URL. If I want a local copy of my repository
from GitHub, this command allows creating a local copy of that repository on your local directory from the
repository URL.
Command •Syntax
•$ git clone URL
Create a
sample Java
Project
•Create a sample Java project
using any IDE.
Git add
Command
•Git add command
•This command is used to add
one or more files to staging
(Index) area.
•Syntax
•To add one file
•$ git add Filename
•Syntax
•To check the status of the files
•$ git status
Git Files Status
Tracked files are those files which Git knows. These are referred as tracked files. The files were present in the last snapshot,
as well as any newly staged files; they can be unmodified, modified, or staged.
Remaining files are Untracked files. Any file in the working directory that were not in the last snapshot and are not in the
staging area. When we first clone a repository, all of our files will be tracked and unmodified because Git just checked them
out and you haven’t edited anything.
As we edit files, Git sees them as modified, because we have changed them since the last commit. As we work, we
selectively stage these modified files and then commit all those staged changes
git add
Edit an existing file
rm filename
git add
(delete a file)
git commit
Git Token Setting
During git push command a token will be used as auth token instead of credentials :
Login to Github
Click on Profile Settings - Developer Settings - Personal access tokens - Tokens Classic - Generate new token
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
Verify on windows computer : open Run Credential manager --. Check Generic Credentials section for git entry
Git Commit Command
Git Commit
•The "commit" command is used to save changes to the local repository. It is used to record the changes in the
repository. It is the next command after the git add. Every commit contains the index data and the commit message.
•When we add a file in Git, it will take place in the staging area. A commit command is used to fetch updates from
the staging area to the repository.
•Staging allows us to continue in making changes to the repository, and when we want to share these changes to the
version control system, committing allows us to record these changes.
•Commits are the snapshots of the project.
•Syntax
$ git commit -m "Commit message."
Git Push Command
Git Push
•The git push command is used to upload local repository content to a remote repository. Pushing means transfer
commits from the local repository to a remote repository.
•After a local repository has been modified a push is executed to share the modifications with remote team
members.
•Syntax
$ git push
•If location of a repository is not specified, then it will push to default location at origin master.
Git Common Commands
Git Branch Command
This command lists all the branches available in the repository.
Syntax
$ git branch
Develop Branch
It is parallel to the master branch. This branch contains the latest delivered development changes for the next release. It has the final
source code for the release. It is also called as a "integration branch."
When the develop branch reaches a stable point and is ready to release, it should be merged with master and tagged with a release
version.
Supportive Branches
The development model needs a variety of supporting branches for the parallel development, tracking of features, assist in quick fixing
and release, and other problems. These branches have a limited lifetime and are removed after the uses.
The different types of supportive branches, we may use are as follows:
•Feature branches
•Release branches
•Hotfix branches
Each of these branches is made for a specific purpose and have some merge targets. These branches are significant for a technical
perspective.
Git Branches
Feature Branches
Feature branches can be considered as topic branches. It is used to develop a
new feature for the next version of the project. The existence of this branch is
limited; it is deleted after its feature has been merged with develop branch.
Git Branches
Release Branches
The release branch is created for the support of a new version release. Senior developers will create a release
branch. The release branch will contain the predetermined amount of the feature branch. The release branch should
be deployed to a staging server for testing.
Developers are allowed for minor bug fixing and preparing meta-data for a release on this branch. After all these
tasks, it can be merged with the develop branch.
When all the targeted features are created, then it can be merged with the develop branch. Some usual standard of
the release branch are as follows:
•Generally, senior developers will create a release branch.
•The release branch will contain the predetermined amount of the feature branch.
•The release branch should be deployed to a staging server for testing.
•Any bugs that need to be improved must be addressed at the release branch.
•The release branch must have to be merged back into developing as well as the master branch.
•After merging, the release branch with the develop branch must be tagged with a version number.
Git Branches
Hotfix Branches
Hotfix branches are like Release branches; both are created for
a new production release.
The hotfix branches arise due to immediate action on the
project. In case of a critical bug in a production version, a hotfix
branch may branch off in your project. After fixing the bug, this
branch can be merged with the master branch with a tag.
Jenkins is an open-source continuous integration tool.
Overview
plugins.
Jenkins runs these tasks each time a developer has changed the
source code, can detect any defects much faster meaning that you
maintain applications' quality and reduce time to market.
Jenkins has very large community that
contributes to it regularly.
Developer
Developer
Jenkins Installation
• Download Jenkins from [Link]
• Close pop up
Jenkins Management
• Click on the "Manage Jenkins" option from the left hand of the Jenkins Dashboard page
to manage Jenkins.
• Go to dashboard
More Jobs
• Similarly prepare 2 more jobs.
• Notice that executing only first job Buildjob1 will trigger the other two jobs TestJob1 and DeployJob1 automatically
one after other on their completion.
Verify Delivery Pipeline View
• Go to dashboard. Click on DeliveryPipeline1 tab.
Add More Features to Pipeline View
• Go to Dashboard. Click
DeliveryPipeline1 view. Click on
Edit View.
• Pipeline as Code allows to define the build and deployment processes as code, making it easier to version
control and manage. Instead of using the traditional Jenkins GUI to create jobs, one can write pipeline logic in
a text file.
• Pipeline as code is a way by which one can define software delivery pipelines as code, stored and versioned in
a source repository.
• Projects must contain a file named Jenkinsfile in the repository root, which contains a "Pipeline script.“
• Presence of the Jenkinsfile in the root of a repository makes it eligible for Jenkins to automatically manage and
execute jobs based on repository branches.
pipeline {
agent any
stages {
stage('Hello') {
steps { echo 'Hello World' }
}
}
}
• Enter Git.
• OR
• It performs compilation of Source Code, Running Tests (unit tests and functional tests), Packaging the results
into JAR’s,WAR’s,etc., Upload the packages to remote repo’s (Nexus, Artifactory).
• Some popular IDEs supporting development with Maven Framework like Eclipse, IntelliJ IDEA, Jbuilder,
Spring Tool Suite etc.
Maven Installation
• To install maven on windows,
Download maven from
[Link]
[Link]
and extract it.
Local Central
Repository Repository
It is a directory on the computer where Maven runs. It It refers to any other type of repository, accessed by a variety
caches remote downloads and contains temporary of protocols such as file:// and https:// present on a web
build artifacts that you have not yet released. server, which is used when Maven needs to download
dependencies. Whenever dependency is required from the
remote repository, it is first downloaded to the local
repository, and then used.
Local Repository
• Default local repository is created under %USER_HOME%/.m2 directory.
• There is a way to change the location of maven local repository. Update [Link] file located in
MAVEN_HOME/conf/[Link], for example: C:\apache-maven-3.8.6-bin\apache-maven-3.8.6\conf.
• There is a way to change the location of maven local repository. Update [Link] file located in
MAVEN_HOME/conf/[Link], for example: C:\apache-maven-3.8.6-bin\apache-maven-3.8.6\conf.
Central Repository
• Maven central repository is located on the web. It has been created by the apache maven community itself.
• When Maven does not find any dependency in local repository, it starts searching in central repository.
• The path of central repository is: [Link] It requires internet access to be searched.
• Sometimes, Maven does not find a mentioned dependency in central repository as well. It then stops the build
process and output error message to console. To prevent such situation, Maven provides concept of Remote
Repository, which is developer's own custom repository containing required libraries or other project jars.
• For example, using below mentioned [Link], Maven will download dependency (not available in central
repository) from Remote Repositories mentioned in the same [Link].
<repositories>
<repository>
<id>companyname.lib1</id>
<url>[Link]
</repository>
<repository>
</repositories>
Maven Build Life Cycle
Compile
• Compile the source code of the project.
Test-compile
• Compile the test source code into the test destination directory.
Test
• Run tests using a suitable unit testing framework (Junit is one).
Package
• Take the compiled code and package it in its distributable format, such as a JAR, WAR, or EAR file.
Integration-test
• Process and deploy the package, if necessary, into an environment where integration tests can be run.
Verify
• Run any check-ups to verify the package is valid and meets quality criteria.
Install
• Install the package into the local repository, which can be used as a dependency in other projects locally.
Deploy
• Copies the final package to the remote repository for sharing with other developers and projects.
Maven Project Structure
• Maven uses a convention for project folder structure. If we follow that, we need not describe in our configuration
setting, what is located where. Maven knows from where to pick the source files, test cases etc. Following is a
snapshot from a Maven project, and it shows the project structure,
• rootproj.
├── [Link]
└── src
├── main
│ └── java
│ └── com
│ └── ecom
│ └── [Link]
└── test
└── java
└── com
└── ecom
└── [Link]
9 directories, 3 files
Maven Project Object Model overview
• To configure the Maven, you need to use Project Object Model, which is stored in a [Link]-file
• POM stands for Project Object Model. It is fundamental unit of work in Maven. It is an XML file that resides in the
base directory of the project as [Link] And has all the configuration settings for the project build.
• Generally we define the project dependencies (Ex: dependent jar files for a project), maven plugins to execute and
project description /version etc.
POM File Elements
• Simplest [Link] should have 4 important information.
<project xmlns="[Link]
xmlns:xsi="[Link]
xsi:schemaLocation="[Link]
[Link]
<modelVersion>4.0.0</modelVersion>
<groupId>[Link]</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
</project>
• There is an element available for declaring dependencies in project [Link] This is used to
define the dependencies that will be used by the project. Maven will look for these dependencies
when executing in the local maven repository. If not found, then Maven will download those
dependencies from the remote repository and store it in the local maven repository. Example
declaring junit and log4j as project dependencies,
•<dependencies>
• <dependency>
Maven •
•
•
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
Dependen • <scope>test</scope>
• </dependency>
cy
• <dependency>
• <groupId>log4j</groupId>
• <artifactId>log4j</artifactId>
• <version>1.2.12</version>
• <scope>compile</scope>
• </dependency>
• </dependencies>
• An example for Maven plugin is ‘compiler’, it compiles the java source code. This compiler plugin has two goals
compiler:compile and compiler:testCompile.
Maven
webapp
structure,
run,
deploy
SonarQube
• SonarQube is an open-source platform developed by SonarSource for continuous inspection of code
quality to perform automatic reviews with static analysis of code to detect bugs and code smells.
• SonarQube is a Code Quality Assurance tool that collects and analyzes source code, and provides
reports for the code quality of a project.
• It offers reports on duplicated code, coding standards, unit tests, code coverage, code
complexity, comments, bugs, and security recommendations.
• It combines static and dynamic analysis tools and enables quality to be measured continually over
time.
SonarQube Installation
• Install sonarqube server from [Link]
• Type URL [Link] in the browser to launch SonarQube. Enter admin as both login and password.
Update password on first login. Let’s say sonar.
SonarQube Add User
1. Go to Administration click Security menu select 2. Click on create user button
Users from the drop down
3. Click on four
lines icon
present in
new added
user under
Tokens
column
SonarQube Token
• A token pop up screen opens. Provide a name and click on Generate button.
• squ_6e9ab0fe67804658a8f6282
9a4fb1a67bd2548da
SonarQube Webhook
• As Jenkins and SonarQube are running separately, we
need to create a Webhook at SonarQube Server so
that both can communicate with each other.
• Add below details under SonarQube servers section. Add SonarQube authentication token in the Server authentication
token drop down.
• Testing done using the Selenium testing tool is usually referred to as Selenium Testing.
Selenium Tools
• The list of tools
Benefits of Provides support for modern browsers like Chrome, Firefox, Opera,
Safari, and Internet Explorer.
Selenium
Selenium WebDriver completes the execution of test scripts faster
Webdriver when compared to other tools
More Concise API (Application Programming interface) than
Selenium RC’s
It also provides compatibility with iPhoneDriver, HtmlUnitDriver,
and AndroidDriver
Support for new browsers is not readily available when
compared to Selenium RC
Selenium
JSON
Language Browser Real
Wire
Bindings Driver Browser
Protocol
e.g. Java
Selenium Setup
• Pre-requisite : Install Java, Install Java IDE like eclipse, STS
• To check the Chrome browser version, click on the three dots on the
right top corner of the browser. Click on Help in the menu. Click on
About Google Chrome in the sub-menu. Click the "About Google
Chrome" option to get the Chrome version.
• Select all the JAR files inside and outside the “lib” folder.
• Select Apply and all Selenium libraries got imported into the java project.
Setup ChromeDriver on Windows
• To set up and configure the ChromeDriver with the Selenium, the ChromeDriver executable file should be
accessible in the test script.
• Add a single line of code to set up the system properties for the ChromeDriver.
on
•<input type="text" id="emailId" name="emailId" value="" />
•Now, to extract its value in Selenium based test case, findElement method is used
Webpage •[Link]([Link]("emailId"));
•The method findElement() takes one parameter which is a locator to the element. Different
locators like [Link](), [Link](), [Link](), [Link]() etc. locate the elements in the page
using their properties like“““ id, name or path, etc.
•<label id=“username”>User Name </label>
•For selecting the option in dropdown using visible text we use selectByVisibleText method.
This method accepts string value as a parameter. Here we need to pass visible text to this
method.
•Select select=new Select([Link]([Link]("country")));
Dropdown •[Link]("India");
Control on •For selecting the option in dropdown using its index we use selectByIndex method. This
method accepts integer value as a parameter. Here we need to pass option index to this
method.
•For selecting the option in dropdown using option value we use selectByValue method. This
method accepts string value as a parameter. Here we need to pass option value to this
method.
•Select select=new Select([Link]([Link]("country")));
•[Link]("Ind");
Intermediate Discussion of
Project and Assignment
Hypervisor
VMs have their own OS. Containers share the same OS that is the host OS.
Complete isolation from host OS. Less isolation from host OS.
Docker
Docker is an open-source centralized
platform designed to create, deploy, and
run applications. Docker uses container on
the host's operating system to run
applications. It allows applications to use
the same Linux kernel as a system on the
host computer, rather than creating a
whole virtual operating system. Containers
ensure that our application works in any
environment like development, test, or
production.
The docker container life cycle has five phases:
• Create phase
• Running phase
• Paused phase/unpaused phase
• Stopped phase
• Killed phase
Docker Paused
Life Cycle
d
deleted
create
Create Running Killed
restart stop
Stopped
Docker Installation & Setup
Setup
• Download Docker for windows [Link]
• When prompted, ensure the Use WSL 2 instead of Hyper-V option on the Configuration page is selected or not depending on your
choice of backend.
• If your system only supports one of the two options, you will not be able to select which backend to use.
• Follow the instructions on the installation wizard to authorize the installer and proceed with the install.
• When the installation is successful, click Close to complete the installation process.
• If your admin account is different to your user account, you must add the user to the docker-users group. Run Computer
Management as an administrator and navigate to Local Users and Groups > Groups > docker-users. Right-click to add the user to
the group. Log out and log back in for the changes to take effect.
Caching a cluster of containers
Better security, less access needed to work with the code running
inside containers, and fewer software dependencies
Docker Architecture
• Docker uses a Client-server
architecture.
• A command line interface (CLI) where CLIENT Docker HOST Docker Registry
we input docker commands is the
client. Docker Daemon
• Docker CLI will translate the
Docker Run
commands into REST API call, sends it
to docker daemon.
• Docker daemon then evaluates the
request and interacts with the Docker Build
underlying host machine. This docker Containers
daemon is a like server which is the Registry
main processor behind the whole Images
Docker Pull
operation.
• Most of the time docker CLI
interfaces with local docker daemon,
but it is possible you can connect a
Docker client to a remote Docker
daemon.
Docker Engine
• Docker Engine is an open-source containerization
technology for building and containerizing your
applications.
• Docker Engine acts as a client-server application. Docker CLI
• A server with a long-running daemon process dockerd.
• APIs which specify interfaces that programs can use to
talk to and instruct the Docker daemon.
• A command line interface (CLI) client docker.
REST API
Server
Docker Ecosystem
•Dockerfile : A Dockerfile is simply a plain text file that contains a set of user-defined commands, which when executed
by the docker image build Command to build the docker image. To build an image from an application a Dockerfile is
needed. The purpose of the Dockerfile is to automate the image building process, in which all the necessary
dependencies and libraries are installed.
•Dockerimage : Dockerimage is the immutable snapshot of the software with its runtime environment. This can be run
in container at any time later. Every image has a unique ID. Every image has base image, the base image does not have
any parent. Base Docker image represents an operating system, and in the case of Linux, the base image can be one of
its distributions, such as Debian, Alpine Linux. You can also download the Docker images that the other people have
already created and add additional modules to the base image deriving the various images that can exhibit the
preferred behavior.
•Docker layer : Images are typically of the read-only type. Each change that is made to the original image is stored in a
separate layer. The original image and each pre-existing layer remain unchanged. Each layer will get a unique ID.
Docker Ecosystem
•Docker container : Docker container is the top layer of image stack. This is the only top level layer which is read-
write layer. There could be several read-only images beneath the container layer. When this top level container
layer is started, Docker pulls the required image and its parent image. It continues to pull all the parent images until
it reaches the base image.
•Docker registry and repository : Docker repository is storage of docker registry. The registry is for registering the
Docker images, whereas the repository is for storing those registered Docker images in a publicly discoverable and
centralized place. A Docker Registry is a place where the Docker images can be stored in order to be publicly found,
accessed, and used by the. For example, think of this with Git and GitHub. Git is a repository and GitHub is a
registry. Git repository is storage of GitHub registry. You can also host Git repository in Bitbucket, Gitlab registries.
•Registry : A service responsible for hosting and distributing images. The default registry is the Docker Hub.
•Examples of docker registry: Docker Hub, Quay, Google Container Registry, AWS Container Registry
Docker Ecosystem
•Repository : Docker repository is a collection of different docker images with same name that have different tags.
Tag is alphanumeric identifier of the image within a repository.
•Docker Hub Registry : Docker Hub is the public default registry.
•docker pull command will download the images form Docker Hub registry.
•[Link] is the docker hub registry URL.
•This registry has images contributed by Docker community and third parties. If any image you want download form
other registry you should specify the registry URL in the pull command. Following is an example of pulling an image
from a third party repository hub:
• docker pull [Link]/myapp
•Docker daemon : A persistent background process that manages Docker images, containers, networks, and storage
volumes. The Docker daemon constantly listens for Docker API requests and processes them.
Docker Compose
Compose is a tool for defining Compose works in all Using Compose is basically a
and running multi-container environments: production, three-step process:
Docker applications. With staging, development, testing, • Define your app’s environment with a
Compose, you use a YAML file as well as CI workflows. Dockerfile so it can be reproduced
to configure your application’s anywhere.
services. Then, with a single
command, you create and start • Define the services that make up your app
all the services from your in [Link] so they can be run
configuration. together in an isolated environment.
• Run docker compose up and the Docker
compose command starts and runs the
entire app. You can alternatively run
docker-compose up using Compose
standalone(docker-compose binary).
•Docker Swarm is an orchestration management tool that runs
on Docker applications. It helps end-users in creating and
deploying a cluster of Docker nodes.
Swarm •We can use Docker Swarm to make Docker work across
multiple nodes, allowing them to share containers with each
other.
•If one of the containers fails, we can use the Swarm to correct
that failure.
Kubernetes servers.
Used For
Kubernetes
automates things
like:
Kubernetes Architecture
Kubernetes Components
A Kubernetes environment is termed a cluster. It includes one or more nodes. A node is simply a machine that will run
your containers. It could be physical hardware or a VM.
The cluster has nodes and a control plane. The control plane coordinates the entire cluster’s operations, schedules new
containers onto available nodes and provides the API server that you interact with.
kube-scheduler The scheduler assigns new Pods (containers) onto the nodes in your cluster. It establishes which nodes
can fulfill the Pod’s requirements, then selects the most optimal placement to maximize performance
and reliability.
kubelet Kubelet is a worker process that runs on each of your nodes. It maintains communication with the
Kubernetes control plane to receive its instructions. Kubelet is responsible for pulling container images
and starting containers in response to scheduling requests.
kube-proxy Proxy is another component found on individual nodes. It configures the host’s networking system so
traffic can reach the services in your cluster.
Kubernetes Basic Terms
Term Description
Node Nodes represent the physical machines that form Kubernetes cluster. They run the containers created. Kubernetes tracks
the status of nodes and exposes each one as an object.
Namespace Kubernetes namespaces isolate different groups of resources. They avoid name collisions by scoping the visibility of
resources. Creating two objects with the same name is forbidden within the same namespace. For example, one can’t
create two Pods that are both called database. Namespaces resolve this by providing logical separation of resources.
Replica Set Replica Sets are used to consistently replicate a Pod. They provide a guarantee that a set number of replicas will be
running at any time. If a node goes offline or a Pod becomes unhealthy, Kubernetes will automatically schedule a new
Pod instance to maintain the specified replica count.
Deployment Deployments wrap ReplicaSets with support for declarative updates and rollbacks. They’re a higher level of abstraction
that’s easier to control. A Deployment object lets you specify the desired state of a set of Pods. This includes the number
of replicas to run. Modifying the Deployment will automatically detect the required changes and scale the ReplicaSet as
required.
Services Kubernetes Services are used to expose Pods to the network. They allow defined access to Pods either within cluster or
externally. Kubernetes Services are resources that map network traffic to the Pods in cluster. You need to create a Service
each time you expose a set of Pods over the network, whether within your cluster or externally. Services sit in front of
your Pods to achieve this behavior. All network traffic flows into the Service before being redirected to one of the
available Pods.
Diagrams
Deployment
Namespace
Pod
• The pod is a collection of one or more containers with shared storage
• It is the smallest unit of the Kubernetes application
• Pods share the physical resources of the host machine in the form of CPU, RAM and storage
• Pod containers can contain multiple applications
NODE
POD POD
Container Container
Container Container
Puppet
s
services processes etc.
• Nagios has server-agent architecture.
NRPE
• AWS means Amazon Web Services.
• Amazon Web Services (AWS) is a highly available,
secure cloud services platform.
AWS
• AWS is a cloud platform that offers several on-
demand operations like compute power, database
storage, content delivery, etc.
• Providing a pay-as-you-go system.
AWS
• AWS is a very cost-effective service.
Advantages
• It offers billing and management for the centralized
sector, hybrid computing, and fast installation or
removal of your application in any location with few
clicks.
AWS
• AWS has supportive paid packages for intensive or
immediate response. Thus, users might need to pay
extra money for that.
Disadvanta
ges • From region to region, AWS sets some default
limitations on resources such as volumes, images,
or snapshots.
AWS EC2
• EC2 provides compute capacity in the cloud.
• This capacity is secure and resizable based on the
user’s requirements.
• EC2 can expand or shrink the resources provided,
depending on the load the organization is facing.
AWS • It allows you to pay only for compute time.
• No need for provisioning and managing servers.
Serverless Lambda executes code only when required, and
scales automatically.
Service - • It can handle a few requests a day, all the way to
thousands a second.
AWS Lambda
AWS S3
• S3 stands for Simple Storage Service.
• S3 is an object storage.
• It can store and retrieve data from
anywhere: websites, mobile apps, IoT
sensors, and so on.
AWS
• Amazon Glacier is a cloud storage
service that is used for archiving data
and long-term backup.
Glacier • The glacier is used for data archiving
and long-term backup.
AWS EBS
• EBS stands for Elastic Block Store.
• Amazon Elastic Block Store provides
block storage volumes for instances of
Amazon EC2.
• EBS is a reliable storage volume that
can be attached to any running
instance that is in the same availability
zone.
AWS EFS
• EFS stands for Elastic File Storage.
• Amazon EFS provides elastic file storage, which
can be used with AWS Cloud Services and
resources that are on-premises
• It is easy to use and offers a simple interface that
allows you to create and configure file systems
quickly and easily.
AWS RDS
• RDS stands for Relational Database
Service.
• Amazon RDS eases the process
involved in setting up, operating, and
scaling a relational database in the
cloud.
• It helps with tasks like hardware
provisioning, database setup, backup,
and so on.
• It frees us from managing the hardware
and enables us to focus on the
application.
• AWS CodePipeline is a fully managed continuous
delivery service that helps to automate the
release pipelines for fast and reliable application
AWS and infrastructure updates.
• CodePipeline automates the build, test, and
CodePipelin deploy phases of the release process every time
there is a code change, based on the release
e model.
• With AWS CodePipeline, you only pay for what
you use. There are no upfront fees or long-term
commitments.
CI/CD using AWS CodePipeline
Commit Events AWS Trigger AWS
AWS CloudWatch
CodeCommit CodePipeline
Events
Code Files
The typical AWS CodePipeline workflow includes the following stages: Trigger build
Action : Build AWS
Source Stage: This is where the code is stored. The source could be AWS CodeCommit, & Test CodeBuild
GitHub, or S3 where your source code resides. Whenever there is a change in the code,
the pipeline is triggered.
Build Stage: After the code is retrieved, the build process happens. This is done using Stores artefact
AWS CodeBuild or any custom build system. CodeBuild compiles the code, runs tests, Pass
and produces artifacts. AWS S3
Test Stage: This stage runs tests to ensure the build is successful and that no issues bucket
exist in the application.
Deploy Stage: The final step involves deploying the built application to the chosen
environment, such as AWS Elastic Beanstalk, EC2, Lambda, or even on-premises Trigger deploy
Action : AWS
servers.
Deploy in env CodeDeploy