KEMBAR78
GCP-DevOps-projectintroduxtionfir devopsproject.pdf
© Copyright KodeKloud
© Copyright KodeKloud
© Copyright KodeKloud
© Copyright KodeKloud
Creating a new GitHub repo
© Copyright KodeKloud
Setting up the repo according to
the company's best practices
© Copyright KodeKloud
Coding
Writing a code for a simple
docker image
© Copyright KodeKloud
Testing the code locally
© Copyright KodeKloud
Pushing the code to the
GitHub repo
© Copyright KodeKloud
GitHub Docker
© Copyright KodeKloud
Task 1
Creating a GitHub Repo
© Copyright KodeKloud
Creating a GitHub
Repository
© Copyright KodeKloud
Task 2
Cloning the repo and setting up our editor
© Copyright KodeKloud
© Copyright KodeKloud
© Copyright KodeKloud
Summary
Clone Setup Change Code
© Copyright KodeKloud
Task 3
Setting up GitHub repo according to
DevOps best practices
© Copyright KodeKloud
© Copyright KodeKloud
How to set up the GitHub repo?
© Copyright KodeKloud
GitHub Main Clone Make a
change
© Copyright KodeKloud
What is the Problem with this approach?
© Copyright KodeKloud
GitHub Main Clone Make a
change
© Copyright KodeKloud
GitHub Main Clone Make a
change
Conflict
© Copyright KodeKloud
How to improve?
© Copyright KodeKloud
Branch Protection
© Copyright KodeKloud
GitHub Main Clone Make a
change
Pool Request
© Copyright KodeKloud
GitHub Main Clone Feature
Branch
(task)
Pool Request
Engineer
Reviewed
© Copyright KodeKloud
How to enable Branch Protection?
© Copyright KodeKloud
Task 4
Coding for our application locally
© Copyright KodeKloud
Develop code locally
and test it.
© Copyright KodeKloud
VS Code Editor
© Copyright KodeKloud
Demo
Testing, Debugging our code locally
© Copyright KodeKloud
Sprint-01
Review
© Copyright KodeKloud
Sprint Review in Organizations
Creating a new GitHub repo
Setting up the repo according to the company's best practices
Coding: Writing a code for a simple docker image
Testing the code locally
Pushing the code to the GitHub repo
© Copyright KodeKloud
© Copyright KodeKloud
Sprint-02
© Copyright KodeKloud
© Copyright KodeKloud
Creating a GCP account
© Copyright KodeKloud
Understanding the
fundamentals of GKE in GCP
© Copyright KodeKloud
Setting up a GKE cluster
© Copyright KodeKloud
Sprint Goals
Creating a GCP account
Understanding the fundamentals of GKE in GCP
Setting up a GKE cluster
© Copyright KodeKloud
Kubernetes Refresher
© Copyright KodeKloud
© Copyright KodeKloud
Definition of Kubernetes
Kubernetes, also known as K8s, is an open-
source system for automating the
,
and
of containerized applications.
© Copyright KodeKloud
How do we create it?
© Copyright KodeKloud
© Copyright KodeKloud
Deploy it
Scale it
Manage it
© Copyright KodeKloud
© Copyright KodeKloud
Kubernetes Features
Automated Rollouts and Rollbacks
Docker Image Version Production Pod
Version Production Pod
Achieving this
task is known
as
Pug
© Copyright KodeKloud
Kubernetes Features
Self - Healing
Service Discovery and Load Balancing
Security and Configuration Management
© Copyright KodeKloud
Where do we deploy the Kubernetes?
© Copyright KodeKloud
Cloud Options
AWS GCP Microsoft Azure
© Copyright KodeKloud
Own Datacentres
© Copyright KodeKloud
Pros & Cons
Organization
Cost
Big Team
© Copyright KodeKloud
How to setup the Kubernetes cluster in GCP?
© Copyright KodeKloud
Sprint-02 review
© Copyright KodeKloud
Sprint Review
Creating a GCP account
Understanding the fundamentals of GKE in GCP
Setting up a GKE cluster
© Copyright KodeKloud
© Copyright KodeKloud
Sprint-03
© Copyright KodeKloud
Design Discussion on CI/CD
CI CD
© Copyright KodeKloud
What is Design Discussion?
© Copyright KodeKloud
© Copyright KodeKloud
Google Cloud Platform
GKE
© Copyright KodeKloud
What is the next step?
© Copyright KodeKloud
© Copyright KodeKloud
How do we achieve this?
© Copyright KodeKloud
CI/CD
© Copyright KodeKloud
What are the steps required?
© Copyright KodeKloud
Design Discussion
CI CD
© Copyright KodeKloud
CI/CD Design Discussion
© Copyright KodeKloud
© Copyright KodeKloud
What are the steps required?
© Copyright KodeKloud
GitHub GKE
Automated way to build the docker
image.
© Copyright KodeKloud
GitHub GKE
We have to store the Docker image
in an artifactory.
© Copyright KodeKloud
Where do we store Docker image?
© Copyright KodeKloud
© Copyright KodeKloud
GitHub GKE
We have to write a deployment /
service YAML files for K8 deployment.
© Copyright KodeKloud
Horizontal Pot
Autoscaling
Ingress Deployment
YAML
Service YAML
© Copyright KodeKloud
GitHub GKE
We have to setup CD to deploy this
code to GKE using the docker image
stored in artifactory.
© Copyright KodeKloud
GitHub GKE
Automated way to build the docker image.
We have to store the Docker image in an
artifactory.
We have to write a deployment/service
yaml files for K8 deployment.
We have to setup CD to deploy this code to
GKE using the docker image stored in
artifactory.
© Copyright KodeKloud
How do you research?
© Copyright KodeKloud
GCP Documentation
CI/CD Tool
Deploy GitHub Repository YAML Files
YAML
Answer
Research Open Source Read Code
© Copyright KodeKloud
GitHub GKE
Automated way to build the docker image.
We have to store the Docker image in an
artifactory.
We have to write a deployment/service
yaml files for K8 deployment.
We have to setup CD to deploy this code to
GKE using the docker image stored in
artifactory.
© Copyright KodeKloud
What tools in GCP can
help us achieve this ?
© Copyright KodeKloud
GitHub GKE
Automated way to build the docker image.
We have to store the Docker image in an
artifactory.
We have to write a deployment/service
yaml files for K8 deployment.
We have to setup CD to deploy this code to
GKE using the docker image stored in
artifactory.
© Copyright KodeKloud
© Copyright KodeKloud
Automated way to
build the docker image. CD tool in GCP
Use it to build docker Image
© Copyright KodeKloud
We have to store the
Docker image in an
artifactory.
Store Docker Image
© Copyright KodeKloud
We have to write a
deployment/service
yaml files for K8
deployment.
Use it to deploy our
image to GKE cluster.
© Copyright KodeKloud
We have to setup CD to
deploy this code to
GKE using the docker
image stored in
artifactory.
Use it to deploy our
image to GKE cluster.
© Copyright KodeKloud
How does Cloud Build work?
© Copyright KodeKloud
How does GCP Artifactory work?
© Copyright KodeKloud
Services in GCP
Cloud Build
GCP Artifact Registry
© Copyright KodeKloud
Cloud
Build
GCP
Artifact
Registry
GitHub GKE
Cloud
Build
1
2
2
2
Build and store Docker Image
1 Deploy Docker Image to GKE
2
1
© Copyright KodeKloud
Sprint-03 review
© Copyright KodeKloud
Design Discussion on CI/CD
CI CD
© Copyright KodeKloud
What is Cloud Build in GCP?
© Copyright KodeKloud
What is GCP Artifact Registry?
© Copyright KodeKloud
What is GCP Artifact Registry?
© Copyright KodeKloud
Cloud
Build
GCP
Artifact
Registry
© Copyright KodeKloud
© Copyright KodeKloud
Sprint-04
© Copyright KodeKloud
Cloud Build
© Copyright KodeKloud
What are the features of Cloud Build?
© Copyright KodeKloud
?
Cloud Build GitHub Repository
© Copyright KodeKloud
Automate Docker Image
Build Process
GCP Artifact Registry
© Copyright KodeKloud
Sprint Goals
Understanding Cloud Build in details
How to connect Cloud Build to GitHub Repository?
Automate Docker Image build process
© Copyright KodeKloud
Cloud Build in detail
© Copyright KodeKloud
© Copyright KodeKloud
What are the features of Cloud Build?
© Copyright KodeKloud
What are the driving factors?
© Copyright KodeKloud
CICD
CICD
CICD
CICD
CICD
© Copyright KodeKloud
Build software quickly across all programming
languages, including Java, Go, Node.js and more.
© Copyright KodeKloud
Choose from 15 machine types and run hundreds
of concurrent builds per pool.
© Copyright KodeKloud
Deploy across multiple environments such as
VMs, serverless, Kubernetes, or Firebase.
© Copyright KodeKloud
Access cloud-hosted, fully managed CI/CD
workflows within your private network.
CI CD
© Copyright KodeKloud
Keep your data at rest within a geographical
region or specific location with data residency.
© Copyright KodeKloud
Takeaways
YAML
It is a complete serverless CI/CD platform
No Infrastructure to maintain
Pricing: E2 – Medium serverless $0.003 per build/minute
Code: Written in YAML file
© Copyright KodeKloud
YAML
© Copyright KodeKloud
?
Cloud Build
GitHub Repository
© Copyright KodeKloud
When is Cloud Build triggered?
© Copyright KodeKloud
Cloud Build trigger
© Copyright KodeKloud
When is Cloud Build triggered?
© Copyright KodeKloud
Jenkins Webhooks GitHub
© Copyright KodeKloud
What events to be used to trigger?
© Copyright KodeKloud
How to trigger the Cloud Build?
© Copyright KodeKloud
GitHub Cloud Build
Cloud Build Trigger
© Copyright KodeKloud
What is the trigger?
© Copyright KodeKloud
© Copyright KodeKloud
© Copyright KodeKloud
Any push on the
main/master branch will
trigger our Cloud Build
© Copyright KodeKloud
Cloudbuild.yaml file shall contain
the CD code
© Copyright KodeKloud
Quick walkthrough
© Copyright KodeKloud
Recap
Make code changes
Commit the changes to GitHub
Open a pull request (PR)
Merge the PR to the main/master repo
Cloud Build is triggered
Cloud Build will store the Docker image
to the Artifact Registry
Cloud
Build
GCP
Artifact
Registry
GitHub
© Copyright KodeKloud
Sprint-04 review
© Copyright KodeKloud
Sprint Goals
Understand Cloud Build in detail
Learn to connect Cloud Build to GitHub repo
Automate Docker image build process
© Copyright KodeKloud
© Copyright KodeKloud
Sprint-05
© Copyright KodeKloud
Extending the CI/CD process to deploy our Docker image on a GKE cluster
CI/CD Docker Image GKE
© Copyright KodeKloud
When will it be completed?
© Copyright KodeKloud
© Copyright KodeKloud
Why is it so?
© Copyright KodeKloud
CI/CD Docker Image GKE
© Copyright KodeKloud
© Copyright KodeKloud
How to break the task?
© Copyright KodeKloud
© Copyright KodeKloud
© Copyright KodeKloud
Creating a namespace in our GKE cluster
© Copyright KodeKloud
Creating a deployment file
© Copyright KodeKloud
Updating the Cloud Build code for deployment
© Copyright KodeKloud
Validating the deployment
© Copyright KodeKloud
Creating a namespace in our GKE cluster
Creating a deployment file
Updating the Cloud Build code for deployment
Validating the deployment
© Copyright KodeKloud
Sprint-05 review
© Copyright KodeKloud
Extending the CI/CD process to deploy our Docker image on a GKE cluster
CI/CD Docker Image GKE
© Copyright KodeKloud
Sprint Goals
Creating a namespace in our GKE cluster
Creating a deployment file
Updating the Cloud Build code for deployment
Validating the deployment
© Copyright KodeKloud
© Copyright KodeKloud
Sprint-06
© Copyright KodeKloud
YAML
Extending our gke.yaml file to also include
code to expose our application via an endpoint
© Copyright KodeKloud
What is this service called?
© Copyright KodeKloud
How to expose our application?
© Copyright KodeKloud
Sprint-06 review
© Copyright KodeKloud
YAML
Extending our gke.yaml file to also include code to expose our application via an endpoint
© Copyright KodeKloud
© Copyright KodeKloud
Sprint-07
© Copyright KodeKloud
© Copyright KodeKloud
!
© Copyright KodeKloud
© Copyright KodeKloud
We are requested to setup a
development environment
© Copyright KodeKloud
How do we do that?
© Copyright KodeKloud
What is a development environment?
© Copyright KodeKloud
Application Development Development
Environment
Main Branch
© Copyright KodeKloud
How do we set it up?
© Copyright KodeKloud
Upgrade replicas
using the new flow
© Copyright KodeKloud
© Copyright KodeKloud
Deployment process using the Development Environment
© Copyright KodeKloud
Deployment process using the Development Environment
Application Production
Production
Environment
© Copyright KodeKloud
Sprint-07 review
© Copyright KodeKloud
Dev Ops
Deploy the changes to production
using the right DevOps lifecycle
Develop Test Deploy
© Copyright KodeKloud

GCP-DevOps-projectintroduxtionfir devopsproject.pdf