DevOps Lab Manual - IOT - 8th Sem (IS-804)
DevOps Lab Manual - IOT - 8th Sem (IS-804)
S. Name of Experiment
Date Sign
No.
1
Exploring Git Commands through Collaborative Coding.
2
Implement GitHub Operations
3
Implement GitLab Operations
4
Implement BitBucket Operations
5
Applying CI/CD Principles to Web Development Using
Jenkins, Git, and Local HTTP Server
6
Exploring Containerization and Application Deployment
with Docker
7
Applying CI/CD Principles to Web Development Using
Jenkins, Git, using Docker Containers
8
Demonstrate Maven Build Life Cycle
9
Demonstrate Container Orchestration using Kubernets.
10
Create the GitHub Account to demonstrate CI/CD pipeline
using Cloud Platform.
Experiments 1:- Exploring Git Commands through Collaborative
Coding.
Objective:
The objective of this experiment is to familiarise participants with essential Git concepts and
commands, enabling them to effectively use Git for version control and collaboration.
Introduction:
Git is a distributed version control system (VCS) that helps developers track changes in their
codebase, collaborate with others, and manage different versions of their projects efficiently. It
was created by Linus Torvalds in 2005 to address the shortcomings of existing version control
systems.
Unlike traditional centralised VCS, where all changes are stored on a central server, Git follows
a distributed model. Each developer has a complete copy of the repository on their local
machine, including the entire history of the project. This decentralisation offers numerous
advantages, such as offline work, faster operations, and enhanced collaboration.
Git is a widely used version control system that allows developers to collaborate on projects,
track changes, and manage codebase history efficiently. This experiment aims to provide a
hands-on introduction to Git and explore various fundamental Git commands. Participants will
learn how to set up a Git repository, commit changes, manage branches, and collaborate with
others using Git.
Key Concepts:
● Repository: A Git repository is a collection of files, folders, and their historical versions. It contains all
the information about the project's history, branches, and commits.
● Commit: A commit is a snapshot of the changes made to the files in the repository at a specific point in
time. It includes a unique identifier (SHA-1 hash), a message describing the changes, and a reference to
its parent commit(s).
● Branch: A branch is a separate line of development within a repository. It allows developers to work on
new features or bug fixes without affecting the main codebase. Branches can be merged back into the
main branch when the changes are ready.
● Merge: Merging is the process of combining changes from one branch into another. It integrates the
changes made in a feature branch into the main branch or any other target branch.
● Pull Request: In Git hosting platforms like GitHub, a pull request is a feature that allows developers to
propose changes from one branch to another. It provides a platform for code review and collaboration
before merging.
● Remote Repository: A remote repository is a copy of the Git repository stored on a server, enabling
collaboration among multiple developers. It can be hosted on platforms like GitHub, GitLab, or Bitbucket.
Materials:
● Computer with Git installed (https://git-scm.com/downloads)
● Command-line interface (Terminal, Command Prompt, or Git Bash)
Experiment Steps:
git init
● This initialises a new Git repository in the current directory.
git status
● This command shows the status of your working directory, highlighting untracked files.
git add example.txt
● This stages the changes of the "example.txt" file for commit.
git status
● Notice the modified file is shown as "modified."
git diff
● This displays the differences between the working directory and the last commit.
git log
● This displays a chronological history of commits.
● Merge the changes from the "feature" branch into the "master" branch:
git merge feature
Objective:
The objective of this experiment is to guide you through the process of using Git commands
to interact with GitHub, from cloning a repository to collaborating with others through pull
requests.
Introduction:
GitHub is a web-based platform that offers version control and collaboration services for
software development projects. It provides a way for developers to work together, manage
code, track changes, and collaborate on projects efficiently. GitHub is built on top of the Git
version control system, which allows for distributed and decentralised development.
Materials:
● Computer with Git installed (https://git-scm.com/downloads)
● GitHub account (https://github.com/)
● Internet connection
Experiment Steps:
cd <repository_name>
● Create a new text file named "example.txt" using a text editor.
● Add some content to the "example.txt" file.
● Save the file and return to the command line.
● Check the status of the repository:
git status
● Stage the changes for commit:
git add example.txt
Conclusion:
This experiment provided you with practical experience in performing GitHub operations
using Git commands. You learned how to clone repositories, make changes, create branches,
push changes to GitHub, collaborate through pull requests, and synchronise changes with
remote repositories. These skills are essential for effective collaboration and version control
in software development projects using Git and GitHub.
Experiment 3. Implement GitLab Operations using Git.
Objective:
The objective of this experiment is to guide you through the process of using Git commands
to interact with GitLab, from creating a repository to collaborating with others through merge
requests.
Introduction:
GitLab is a web-based platform that offers a complete DevOps lifecycle toolset, including
version control, continuous integration/continuous deployment (CI/CD), project
management, code review, and collaboration features. It provides a centralized place for
software development teams to work together efficiently and manage the entire development
process in a single platform.
● Version Control: GitLab provides version control capabilities using Git, allowing developers
to track changes to source code over time. This enables collaboration, change tracking, and
code history maintenance.
● Repositories: Repositories on GitLab are collections of files, code, documentation, and
assets related to a project. Each repository can have multiple branches and tags, allowing
developers to work on different features simultaneously.
● Continuous Integration/Continuous Deployment (CI/CD): GitLab offers robust CI/CD
capabilities. It automates the building, testing, and deployment of code changes, ensuring that
software is delivered rapidly and reliably.
● Merge Requests: Merge requests in GitLab are similar to pull requests in other platforms.
They enable developers to propose code changes, collaborate, and get code reviewed before
merging it into the main codebase.
● Issues and Project Management: GitLab includes tools for managing project tasks, bugs,
and enhancements. Issues can be assigned, labeled, and tracked, while project boards help
visualize and manage work.
● Container Registry: GitLab includes a container registry that allows users to store and
manage Docker images for applications.
● Code Review and Collaboration: Built-in code review tools facilitate collaboration among
team members. Inline comments, code discussions, and code snippets are integral parts of this
process.
● Wiki and Documentation: GitLab provides a space for creating project wikis and
documentation, ensuring that project information is easily accessible and well-documented.
● Security and Compliance: GitLab offers security scanning, code analysis, and compliance
features to help identify and address security vulnerabilities and ensure code meets
compliance standards.
● GitLab Pages: Similar to GitHub Pages, GitLab Pages lets users publish static websites
directly from a GitLab repository.
Benefits of Using GitLab:
● End-to-End DevOps: GitLab offers an integrated platform for the entire software
development and delivery process, from code writing to deployment.
● Simplicity: GitLab provides a unified interface for version control, CI/CD, and project
management, reducing the need to use multiple tools.
● Customizability: GitLab can be self-hosted on-premises or used through GitLab's cloud
service. This flexibility allows organizations to choose the hosting option that best suits their
needs.
● Security: GitLab places a strong emphasis on security, with features like role-based access
control (RBAC), security scanning, and compliance checks.
● Open Source and Enterprise Versions: GitLab offers both a free, open-source Community
Edition and a paid, feature-rich Enterprise Edition, making it suitable for individual
developers and large enterprises alike.
Materials:
● Computer with Git installed (https://git-scm.com/downloads)
● GitLab account (https://gitlab.com/)
● Internet connection
Experiment Steps:
Conclusion:
This experiment provided you with practical experience in performing GitLab operations
using Git commands. You learned how to create repositories, clone them to your local
machine, make changes, create branches, push changes to GitLab, collaborate through merge
requests, and synchronise changes with remote repositories. These skills are crucial for
effective collaboration and version control in software development projects using GitLab
and Git.
Experiment No. 4 Implement BitBucket Operations
Objective:
The objective of this experiment is to guide you through the process of using Git commands
to interact with Bitbucket, from creating a repository to collaborating with others through
pull requests.
Introduction:
Bitbucket is a web-based platform designed to provide version control, source code
management, and collaboration tools for software development projects. It is widely used by
teams and individuals to track changes in code, collaborate on projects, and streamline the
development process. Bitbucket offers Git and Mercurial as version control systems and
provides features to support code collaboration, continuous integration/continuous
deployment (CI/CD), and project management.
● Version Control: Bitbucket supports both Git and Mercurial version control systems, allowing
developers to track changes, manage code history, and work collaboratively on projects.
● Repositories: In Bitbucket, a repository is a container for code, documentation, and other
project assets. It houses different branches, tags, and commits that represent different versions
of the project.
● Collaboration: Bitbucket enables team collaboration through features like pull requests, code
reviews, inline commenting, and team permissions. These tools help streamline the process of
merging code changes.
● Pull Requests: Pull requests in Bitbucket allow developers to propose and review code
changes before they are merged into the main codebase. This process helps ensure code
quality and encourages collaboration.
● Code Review: Bitbucket provides tools for efficient code review, allowing team members to
comment on specific lines of code and discuss changes within the context of the code itself.
● Continuous Integration/Continuous Deployment (CI/CD): Bitbucket integrates with CI/CD
pipelines, automating processes such as building, testing, and deploying code changes to
various environments.
● Project Management: Bitbucket offers project boards and issue tracking to help manage tasks,
track progress, and plan project milestones effectively.
● Bitbucket Pipelines: This feature allows teams to define and automate CI/CD pipelines
directly within Bitbucket, ensuring code quality and rapid delivery.
● Access Control and Permissions: Bitbucket allows administrators to define user roles,
permissions, and access control settings to ensure the security of repositories and project
assets.
Materials:
● Computer with Git installed (https://git-scm.com/downloads)
● Bitbucket account (https://bitbucket.org/)
● Internet connection
Experiment Steps:
git status
● Stage the changes for commit:
git add example.txt
Objective:
The objective of this experiment is to set up a CI/CD pipeline for a web development project
using Jenkins, Git, and webhooks, without the need for a Jenkinsfile. You will learn how to
automatically build and deploy a web application to a local HTTP server whenever changes
are pushed to the Git repository, using Jenkins' "Execute Shell" build step.
Introduction:
Continuous Integration and Continuous Deployment (CI/CD) is a critical practice in modern
software development, allowing teams to automate the building, testing, and deployment of
applications. This process ensures that software updates are consistently and reliably
delivered to end-users, leading to improved development efficiency and product quality.
In this context, this introduction sets the stage for an exploration of how to apply CI/CD
principles specifically to web development using Jenkins, Git, and a local HTTP server. We
will discuss the key components and concepts involved in this process.
Key Components:
● Jenkins: Jenkins is a widely used open-source automation server that helps automate various
aspects of the software development process. It is known for its flexibility and extensibility
and can be employed to create CI/CD pipelines.
● Git: Git is a distributed version control system used to manage and track changes in source
code. It plays a crucial role in CI/CD by allowing developers to collaborate, track changes,
and trigger automation processes when code changes are pushed to a repository.
● Local HTTP Server: A local HTTP server is used to host and serve web applications during
development. It is where your web application can be tested before being deployed to
production servers.
CI/CD Principles:
● Code Changes: Developers make changes to the web application's source code locally.
● Git Repository: Developers push their code changes to a Git repository, such as GitHub
or Bitbucket.
● Webhook: A webhook is configured in the Git repository to notify Jenkins whenever
changes are pushed.
● Jenkins Job: Jenkins is set up to listen for webhook triggers. When a trigger occurs, Jenkins
initiates a CI/CD pipeline.
● Build and Test: Jenkins executes a series of predefined steps, which may include building
the application, running tests, and generating artifacts.
● Deployment: If all previous steps are successful, Jenkins deploys the application to a local
HTTP server for testing.
● Verification: The deployed application is tested locally to ensure it functions as
expected.
● Optional Staging: For more complex setups, there might be a staging environment where
the application undergoes further testing before reaching production.
● Production Deployment: If the application passes all tests, it can be deployed to the
production server.
Materials:
● A computer with administrative privileges
● Jenkins installed and running (https://www.jenkins.io/download/)
● Git installed (https://git-scm.com/downloads)
● A local HTTP server for hosting web content (e.g., Apache, Nginx)
● A Git repository (e.g., on GitHub or Bitbucket)
Experiment Steps:
● Create a simple web application or use an existing one. Ensure it can be hosted by a local
HTTP server.
● Set up a local HTTP server (e.g., Apache or Nginx) to serve the web application. Ensure
it's configured correctly and running.
●
Step 2: Set Up a Git Repository
Create a Git repository for your web application. Initialize it with the following commands:
git init
git add .
git commit -m "Initial commit"
● Create a remote Git repository (e.g., on GitHub or Bitbucket) to push your code to later.
● Download and install Jenkins following the instructions for your operating system
(https://www.jenkins.io/download/).
● Open Jenkins in your web browser (usually at http://localhost:8080) and complete the initial
setup.
● Install the necessary plugins for Git integration, job scheduling, and webhook support.
● Configure Jenkins to work with Git by setting up your Git credentials in the Jenkins
Credential Manager.
Visit the URL of your local HTTP server to verify that the web application has been updated
with the latest changes.
Conclusion:
This experiment demonstrates how to set up a CI/CD pipeline for web development using
Jenkins, Git, a local HTTP server, and webhooks, without the need for a Jenkinsfile. By
defining and executing the build and deployment steps using the "Execute Shell" build step,
you can automate your development workflow and ensure that your web application is
continuously updated with the latest changes.
Experiment No 6: Exploring Containerization and Application
Deployment with Docker
Objective:
The objective of this experiment is to provide hands-on experience with Docker
containerization and application deployment by deploying an Apache web server in a Docker
container. By the end of this experiment, you will understand the basics of Docker, how to
create Docker containers, and how to deploy a simple web server application.
Introduction
Containerization is a technology that has revolutionised the way applications are developed,
deployed, and managed in the modern IT landscape. It provides a standardised and efficient
way to package, distribute, and run software applications and their dependencies in isolated
environments called containers.
Containerization technology has gained immense popularity, with Docker being one of the
most well-known containerization platforms. This introduction explores the fundamental
concepts of containerization, its benefits, and how it differs from traditional approaches to
application deployment.
Benefits of Containerization:
● Consistency: Containers ensure that applications run consistently across different
environments, reducing the "it works on my machine" problem.
● Portability: Containers are portable and can be easily moved between different host
machines and cloud providers.
● Resource Efficiency: Containers share the host operating system's kernel, which makes
them lightweight and efficient in terms of resource utilization.
● Scalability: Containers can be quickly scaled up or down to meet changing application
demands, making them ideal for microservices architectures.
● Version Control: Container images are versioned, enabling easy rollback to previous
application states if issues arise.
● DevOps and CI/CD: Containerization is a fundamental technology in DevOps and CI/CD
pipelines, allowing for automated testing, integration, and deployment.
Materials:
● A computer with Docker installed (https://docs.docker.com/get-docker/)
● A code editor
● Basic knowledge of Apache web server
Experiment Steps:
Step 1: Install Docker
● If you haven't already, install Docker on your computer by following the instructions
provided on the Docker website (https://docs.docker.com/get-docker/).
Step 2: Create a Simple HTML Page
● Create a directory for your web server project.
● Inside this directory, create a file named index.html with a simple "Hello, Docker!"
message. This will be the content served by your Apache web server.
Dockerfile
# Copy your custom HTML page to the web server's document root COPY
index.html /usr/local/apache2/htdocs/
Step 7: Cleanup
Stop the running Docker container:
Conclusion:
In this experiment, you explored containerization and application deployment with Docker by
deploying an Apache web server in a Docker container. You learned how to create a
Dockerfile, build a Docker image, run a Docker container, and access your web server
application from your host machine. Docker's containerization capabilities make it a valuable
tool for packaging and deploying applications consistently across different environments.
Experiment No. 7 : Applying CI/CD Principles to
Web Development Using Jenkins, Git, using Docker
Containers
Objective:
The objective of this experiment is to set up a CI/CD pipeline for a web application using Jenkins,
Git, Docker containers, and GitHub webhooks. The pipeline will automatically build, test, and
deploy the web application whenever changes are pushed to the Git repository, without the need
for a pipeline script.
Introduction:
Continuous Integration and Continuous Deployment (CI/CD) principles are integral to modern
web development practices, allowing for the automation of code integration, testing, and
deployment. This experiment demonstrates how to implement CI/CD for web development using
Jenkins, Git, Docker containers, and GitHub webhooks without a pipeline script. Instead, we'll
utilize Jenkins' "GitHub hook trigger for GITScm polling" feature.
In the fast-paced world of modern web development, the ability to deliver high-quality software
efficiently and reliably is paramount. Continuous Integration and Continuous Deployment
(CI/CD) are integral principles and practices that have revolutionized the way software is
developed, tested, and deployed. These practices bring automation, consistency, and speed to the
software development lifecycle, enabling development teams to deliver code changes to
production with confidence.
CD is the natural extension of CI. It is the practice of automatically and continuously deploying
code changes to production or staging environments after successful integration and testing. Key
aspects of CD include:
● Automation: CD pipelines automate the deployment process, reducing the risk of
human error and ensuring consistent deployments.
● Deployment to Staging: Code changes are deployed first to a staging environment
where further testing and validation occur.
● Deployment to Production: After passing all tests in the staging environment, code
changes are automatically deployed to the production environment, often with zero
downtime.
● Rollbacks: In case of issues, CD pipelines provide the ability to rollback to a previous
version quickly.
Materials:
● A computer with Docker installed (https://docs.docker.com/get-docker/)
● Jenkins installed and configured (https://www.jenkins.io/download/)
● A web application code repository hosted on GitHub
Experiment Steps:
Step 1: Set Up the Web Application and Git Repository
● Create a simple web application or use an existing one. Ensure it can be hosted
in a Docker container.
● Initialise a Git repository for your web application and push it to GitHub.
● These commands remove the existing container (if any), build a Docker image
named "nginx-image1," and run a Docker container named "container1" on port
8081.
Conclusion:
This experiment demonstrates how to apply CI/CD principles to web development using Jenkins,
Git, Docker containers, and GitHub webhooks. By configuring Jenkins to listen for GitHub
webhook triggers and executing Docker commands in response to code changes, you can
automate the build and deployment of your web application, ensuring a more efficient and reliable
development workflow.
Experiment No. 8 Demonstrate Maven Build Life Cycle
Objective:
The objective of this experiment is to gain hands-on experience with the Maven build
lifecycle by creating a simple Java project and executing various Maven build phases.
Introduction:
Maven is a widely-used build automation and project management tool in the Java
ecosystem. It provides a clear and standardised build lifecycle for Java projects, allowing
developers to perform various tasks such as compiling code, running tests, packaging
applications, and deploying artefacts. This experiment aims to demonstrate the Maven build
lifecycle and its different phases.
● Project Object Model (POM): The POM is an XML file named pom.xml that defines a
project's configuration, dependencies, plugins, and goals. It serves as the project's blueprint
and is at the core of Maven's functionality.
● Build Lifecycle: Maven follows a predefined sequence of phases and goals organized into
build lifecycles. These lifecycles include clean, validate, compile, test, package, install, and
deploy, among others.
● Plugin: Plugins are extensions that provide specific functionality to Maven. They enable tasks
like compiling code, running tests, packaging artifacts, and deploying applications.
● Dependency Management: Maven simplifies dependency management by allowing
developers to declare project dependencies in the POM file. Maven downloads these
dependencies from repositories like Maven Central.
● Repository: A repository is a collection of artifacts (compiled libraries, JARs, etc.) that
Maven uses to manage dependencies. Maven Central is a popular public repository, and
organisations often maintain private repositories.
Clean Lifecycle:
● clean: Deletes the target directory, removing all build artifacts.
Default Lifecycle:
● validate: Validates the project's structure.
● compile: Compiles the project's source code.
● test: Runs tests using a suitable testing framework.
● package: Packages the compiled code into a distributable format (e.g., JAR, WAR).
● verify: Runs checks on the package to verify its correctness.
● install: Installs the package to the local repository.
● deploy: Copies the final package to a remote repository for sharing.
Site Lifecycle:
● site: Generates project documentation.
Each phase within a lifecycle is executed in sequence, and the build progresses from one
phase to the next. Developers can customise build behaviour by configuring plugins and
goals in the POM file.
Materials:
● A computer with Maven installed (https://maven.apache.org/download.cgi)
● A code editor (e.g., Visual Studio Code, IntelliJ IDEA)
● Java Development Kit (JDK) installed
(https://www.oracle.com/java/technologies/javase-downloads.html)
Experiment Steps:
● Ensure that you have Maven and JDK installed on your system. You can verify their
installations by running the following commands:
mvn -v
java -version
Create a pom.xml file (Maven Project Object Model) in the project directory. This file
defines project metadata, dependencies, and build configurations. Here's a minimal example:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>MavenDemo</artifactId>
<version>1.0-SNAPSHOT</version>
</project>
● Install Phase: To install the project artifacts (e.g., JAR) into your local Maven repository,
run:
mvn install
Conclusion:
This experiment demonstrates the Maven build lifecycle by creating a simple Java project
and executing various Maven build phases. Maven simplifies the build process by providing
a standardized way to manage dependencies, compile code, run tests, and package
applications. Understanding these build phases is essential for Java developers using Maven
in their projects.
Experiment No 9 Demonstrating Container Orchestration
using Kubernetes
Objective:
The objective of this experiment is to introduce students to container orchestration using
Kubernetes and demonstrate how to deploy a containerized web application. By the end of this
experiment, students will have a basic understanding of Kubernetes concepts and how to use
Kubernetes to manage containers.
Introduction:
Container orchestration is a critical component in modern application deployment, allowing you to
manage, scale, and maintain containerized applications efficiently. Kubernetes is a popular
container orchestration platform that automates many tasks associated with deploying, scaling,
and managing containerized applications. This experiment will demonstrate basic container
orchestration using Kubernetes by deploying a simple web application.
Materials:
● A computer with Kubernetes installed (https://kubernetes.io/docs/setup/)
● Docker installed (https://docs.docker.com/get-docker/)
Experiment Steps:
Step 1: Create a Dockerized Web Application
● Create a simple web application (e.g., a static HTML page) or use an existing one.
● Create a Dockerfile to package the web application into a Docker container. Here's an
example Dockerfile for a simple web server:
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-web-app-deployment spec:
replicas: 3 # Number of pods to create
selector:
matchLabels:
app: my-web-app # Label to match pods
template:
metadata:
labels:
app: my-web-app # Label assigned to pods
spec:
containers:
- name: my-web-app-container
image: my-web-app:latest # Docker image to use
ports:
- containerPort: 80 # Port to expose
Explanation of web-app-deployment.yaml:
● apiVersion: Specifies the Kubernetes API version being used (apps/v1 for
Deployments).
● kind: Defines the type of resource we're creating (a Deployment in this case).
● metadata: Contains metadata for the Deployment, including its name.
● spec: Defines the desired state of the Deployment.
● replicas: Specifies the desired number of identical pods to run. In this example, we
want three replicas of our web application.
● selector: Specifies how to select which pods are part of this Deployment. Pods
with the label app: my-web-app will be managed by this Deployment.
● template: Defines the pod template for the Deployment.
● metadata: Contains metadata for the pods created by this template.
● labels: Assigns the label app: my-web-app to the pods created by this template.
● spec: Specifies the configuration of the pods.
● containers: Defines the containers to run within the pods. In this case, we have one
container named my-web-app-container using the my-web-app:latest Docker image.
● ports: Specifies the ports to expose within the container. Here, we're exposing port
80.
Conclusion:
In this experiment, you learned how to create a Kubernetes Deployment for container
orchestration. The web-app-deployment.yaml file defines the desired state of the application,
including the number of replicas, labels, and the Docker image to use. Kubernetes automates the
deployment and scaling of the application, making it a powerful tool for managing containerized
workloads.
Questions/Exercises:
1. Explain the core concepts of Kubernetes, including pods, nodes, clusters, and
deployments. How do these concepts work together to manage containerized
applications?
2. Discuss the advantages of containerization and how Kubernetes enhances the
orchestration and management of containers in modern application development.
3. What is a Kubernetes Deployment, and how does it ensure high availability and
scalability of applications? Provide an example of deploying a simple application
using a Kubernetes Deployment.
4. Explain the purpose and benefits of Kubernetes Services. How do Kubernetes
Services facilitate load balancing and service discovery within a cluster?
5. Describe how Kubernetes achieves self-healing for applications running in pods.
What mechanisms does it use to detect and recover from pod failures?
6. How does Kubernetes handle rolling updates and rollbacks of applications without
causing downtime? Provide steps to perform a rolling update of a Kubernetes
application.
7. Discuss the concept of Kubernetes namespaces and their use cases. How can
namespaces be used to isolate and organize resources within a cluster?
8. Explain the role of Kubernetes ConfigMaps and Secrets in managing application
configurations. Provide examples of when and how to use them.
9. What is the role of storage orchestration in Kubernetes, and how does it enable data
persistence and sharing for containerized applications?
10.Explore the extensibility of Kubernetes. Describe Helm charts and custom resources,
and explain how they can be used to customize and extend Kubernetes functionality.
Experiment No 10 Create the GitHub Account to
demonstrate CI/CD pipeline using Cloud Platform.
Objective:
The objective of this experiment is to help you create a GitHub account and set up a basic
CI/CD pipeline on GCP. You will learn how to connect your GitHub repository to GCP,
configure CI/CD using Cloud Build, and automatically deploy web pages to an Apache web
server when code is pushed to your repository.
Introduction:
Continuous Integration and Continuous Deployment (CI/CD) pipelines are essential for
automating the deployment of web applications. In this experiment, we will guide you
through creating a GitHub account and setting up a basic CI/CD pipeline using Google Cloud
Platform (GCP) to copy web pages for an Apache HTTP web application.
Key Components:
● GitHub: GitHub is a web-based platform for version control and collaboration. It allows
developers to host and manage their source code repositories, track changes, collaborate with
others, and automate workflows.
● Google Cloud Platform (GCP): GCP is a cloud computing platform that provides a wide
range of cloud services, including computing, storage, databases, machine learning, and more.
It can be used to host applications and services.
● Amazon Web Services (AWS): AWS is another cloud computing platform that offers a
comprehensive set of cloud services. It is often used for hosting infrastructure, containers,
databases, and more.
A basic CI/CD workflow using GitHub, GCP, and AWS typically includes the following steps:
1. Code Development: Developers work on code changes and commit them to a GitHub
repository.
2. Continuous Integration (CI):
a. GitHub Actions or a CI tool like Jenkins is used to automatically build, test, and
package the application whenever code changes are pushed to the repository.
b. Automated tests are executed to ensure code quality.
3. Continuous Deployment (CD):
a. Once code changes pass CI, the application can be automatically deployed to a
staging environment.
b. Integration and acceptance tests are performed in the staging environment.
4. Deployment to Production:
a. If all tests in the staging environment pass, the application can be automatically
deployed to the production environment in GCP or AWS.
5. Monitoring and Logging:
a. Monitoring tools are used to track the application's performance and detect issues.
b. Logging and analytics tools are used to gain insights into application behavior.
6. Feedback Loop:
a. Any issues or failures detected in production are reported back to the development
team for further improvements.
b. The cycle repeats as new code changes are developed and deployed.
Materials:
● A computer with internet access
● A Google Cloud Platform account (https://cloud.google.com/)
● A GitHub account (https://github.com/)
Experiment Steps:
Step 1: Create a GitHub Account
● Visit the GitHub website (https://github.com/).
● Click on the "Sign Up" button and follow the instructions to create your GitHub
account.
Conclusion:
In this experiment, you created a GitHub account, set up a basic CI/CD pipeline on Google
Cloud Platform, and deployed web pages to an Apache web server. This demonstrates how
CI/CD can automate the deployment of web content, making it easier to manage and update
web applications efficiently.