DevOps Openhouse III slides. Kubernetes using YAML
Slides from the event
22 October 2020
Mentor Prashant Beniwal
Brought to you by Agile Testing Alliance and DevOps++ Alliance
#CPDOF - #1 Global Practical DevOps Certification Program
3. Prashant Beniwal
• 20 Years experience in IT Telecom Industry in variety of roles including
Development, Support and Quality Assurance.
• Extremely conversant with Telecom Domain and keen interest in multiple tools
technologies
• Certified DevOps Trainer and Coach.
• AI and Machine Learning Enthusiast
• Micro Services using Cloud, Docker and Kubernetes
• Training Assignments: India – Amdocs, Cyprus –Amdocs, Ireland – BriteBill,
Spain – BriteBill, India – Qualitest, Edureka – Devops, StarAgile, Vinsys, Excendo
• Avid Public Speaker at multiple conferences
• Visiting faculty at various universities
www.linkedin.com/in/prashant-beniwal+91-9850979757
pbeniwal@yahoo.com
4. Last Open house we saw the
DevOps Pipeline in action.
Lets quickly see it running once
again..
8. About GKE
• Google Kubernetes Engine is a managed, production-ready environment for
deploying containerized applications
• Kubernetes Engine allows you to get up and running with Kubernetes in no
time, by completely eliminating the need to install, manage, and operate
your own Kubernetes clusters.
• Managed Kubernetes Engine feature allows you to handle increased user
demand for your services, keeping them available when it matters most
Ref:
https://cloud.google.co
m/kubernetes-engine/
9. 1. Package your app into a Docker image
2. Upload the image to a registry
3. Deploy your app to the cluster
4. Expose your app to the Internet
5. Deploy a new version of your app
To package and deploy your application on GKE:
10. Flow of Demo on GKE:
Load BalancerChrome
External Load balancer Service
Deployment
Replica Set
POD
Container
Control Node
Worker Node
12. Imperative vs Declarative
Declarative
• Describe what you want to have
• e.g. I would like a cup of coffee
• Writing Manifest file for performing operation in Kubernetes
• Follows principle of Infrastructure as Code (IaC)
Imperative
• Tell me what to do
• e.g. Boil water, Pour it in a pot, Put coffee powder ...
• In Kubernetest giving kubectl command from Command line
14. Basics of YAML
• YAML is serialization language
• Human readable and intuitive
• Key Value Pair using syntax:
• <key>: <value>
• Indentation and line seperation denotes
the structure
• Members of List begin with –
• Used by popular tools like:
• Docker
• Kubernetes
• Ansible
• Prometheus
Service:
- app: my-web
port: 9090
version: 1.0 <Services>
<Service>
<app>my-web</app>
<port> 9090</port>
<version>1.0 </version>
</Service>
</Services>
YAML
XML
{
Services: [
{
app: “my-web”
port: 9090
version: “1.0”
}
]
}
JSON
15. Sample POD YAML Manifest file
• Main four sections
• apiVersion
• kind
• metadata
• spec
• apiVersion is as per Kubernetes API
version
• Kind could have values like Pod,
Deployment, Services etc. which are
Kubernetes Objects
• Metadata is informaiton about the
Kubernetes objects
• Spec is all details about specification of
Kubernetes object
apiVersion:
kind:
metadata:
spec:
YAML
apiVersion: v1
kind:
metadata:
spec:
apiVersion: v1
kind: Pod
metadata:
spec:
apiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
containers:
- name: web
image: tomcat
apiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
kubectl run my-pod --image=tomcat
Imperative