Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
K8s
Intermediate
Kubernetes a clustered container orchestration Software
an open-source system for automating deployment, scaling, and
management of containerized applications.
It groups containers that make up an application into logical units for easy management and discovery. Kubernetes builds upon 15
years of experience of running production workloads at Google, combined with best-of-breed ideas and practices from the
community.
Now maintained by CNCF a non profit organization sponsored by the largest companies in tech like
google,amazon,microsoft , redhat …...
CNCF PROJECTS
Kubernetes is not the only project maintained by cncf
Kubernetes Basic resources
● K8s Master
● K8s Nodes
● Deployment
● Service
● Pod
● Statefulsets
● Daemonset
● Secrets
● Persistent Volumes
● Persistent Volumes Claim
● Storage Class
● Replicasets ……..

Recommended for you

Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility

Kubernetes is designed to be an extensible system. But what is the vision for Kubernetes Extensibility? Do you know the difference between webhooks and cloud providers, or between CRI, CSI, and CNI? In this talk we will explore what extension points exist, how they have evolved, and how to use them to make the system do new and interesting things. We’ll give our vision for how they will probably evolve in the future, and talk about the sorts of things we expect the broader Kubernetes ecosystem to build with them.

black belt trackdockercon 2018dockercon
ZCloud Consensus on Hardware for Distributed Systems
ZCloud Consensus on Hardware for Distributed SystemsZCloud Consensus on Hardware for Distributed Systems
ZCloud Consensus on Hardware for Distributed Systems

3rd Workshop on Dependability, May 8, Monday 2017, İYTE, https://goo.gl/fSVnZy http://dcs.iyte.edu.tr/ws/ppt/10/presentation.pdf In distributed applications where the number of members in the cluster increases, the separation of the consensus related operations at the hardware level is essential for the following reasons: 1. At the operating system level, messages broadcast on the protocol stack cause latency. 2. It is necessary to increase the number of completed transactions in the communication of distributed system components and on the network unit (throughput). 3. For devices with limited storage and CPU computing facilities that use embedded operating systems such as IOT devices, it is also necessary to reduce the processing burden due to "consensus" operations. 4. A common consensus communication model is needed for different applications that need to work together in (BFT) distributed systems.

distributedbftiot
Using Deep Learning Toolkits with Kubernetes clusters
Using Deep Learning Toolkits with Kubernetes clustersUsing Deep Learning Toolkits with Kubernetes clusters
Using Deep Learning Toolkits with Kubernetes clusters

Slides for the talk at the O'Reilly AI Conference San Francisco 2017 - https://conferences.oreilly.com/artificial-intelligence/ai-ca/public/schedule/detail/59613

deep learningkubernetestensorflow
Desired State And the Declarative Model
In k8s we use the declarative model instead of the procedural model .
In the the declarative model we define the desired state of our object .
unlike the procedural model where we define steps and execute them.
In k8s every configuration is made using the declarative model where
we describe the target status of our object
So in the procedural model we would run a container like this : Docker run nginx
Desired State And the Declarative Model
In the declarative model it would be:
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
– name: nginx
image: nginx
Basics - POD
Pod
Kubernetes targets the management of elastic applications that consist of multiple
microservices communicating with each other. Often those microservices are
tightly coupled forming a group of containers that would typically, in a
non-containerized setup run together on one server. This group, the smallest unit
that can be scheduled to be deployed through K8s is called a pod.
Basics - POD
This group of containers would share storage, Linux namespaces, cgroups, IP
addresses. These are co-located, hence share resources and are always
scheduled together.
Pods are not intended to live long. They are created, destroyed and re-created on
demand, based on the state of the server and the service itself.

Recommended for you

Container World 2017!
Container World 2017!Container World 2017!
Container World 2017!

Driving Business and Technical Agility in the Enterprise! Container World 2017 is the only independent conference offering an exploration of the entire container ecosystem. Over 3 days, you’ll hear from the innovative enterprises, tech giants and startups who are transforming enterprise IT and driving business innovation on such topics as: Containers and legacy infrastructure Operations/DevOps Orchestration & Workloads Security Storage/Persistent storage Standardization and Certification Emerging technology like serverless, unikernel and beyond View the brochure for more information: https://goo.gl/OpnoEr

dockercloud containerkubernetes
Kubernetes Interview Questions And Answers | Kubernetes Tutorial | Kubernetes...
Kubernetes Interview Questions And Answers | Kubernetes Tutorial | Kubernetes...Kubernetes Interview Questions And Answers | Kubernetes Tutorial | Kubernetes...
Kubernetes Interview Questions And Answers | Kubernetes Tutorial | Kubernetes...

( Kubernetes Certification Training: https://www.edureka.co/kubernetes-certification ) This Edureka tutorial on "Kubernetes Interview Questions" will help you crack interviews on various Kubernetes related roles in the industry. The different types of questions included in this session are: 1. Basic Kubernetes Interview Questions 2. Kubernetes Architecture-Based Interview Questions 3. Scenario-Based Interview Questions 4. Multiple Choice Questions DevOps Tutorial Blog Series: https://goo.gl/P0zAfF

kuberneteskubernetes edurekakubernetes training
Cluster management with Kubernetes
Cluster management with KubernetesCluster management with Kubernetes
Cluster management with Kubernetes

On Friday 5 June 2015 I gave a talk called Cluster Management with Kubernetes to a general audience at the University of Edinburgh. The talk includes an example of a music store system with a Kibana front end UI and an Elasticsearch based back end which helps to make concrete concepts like pods, replication controllers and services.

containersdockercloud computing
Basics - DEPLOYMENT
A Deployment controller provides declarative updates for Pods and
ReplicaSets.
You describe a desired state in a Deployment object, and the
Deployment controller changes the actual state to the desired
state at a controlled rate. You can define Deployments to create
new ReplicaSets, or to remove existing Deployments and adopt all
their resources with new Deployments.
Basics - SERVICE
As pods have a short lifetime, there is no guarantee about the IP address they are served on. This could make the communication of
microservices hard.
Imagine a typical Frontend communication with Backend services.
Hence K8s has introduced the concept of a service, which is an abstraction on top of a number of pods, typically requiring to run a
proxy on top, for other services to communicate with it via a Virtual IP address.
This is where you can configure load balancing for your numerous pods and expose them via a service.
Basics - SERVICE
We can create different types of services :
➜ Clusterip Create a clusterIP service.
➜ externalname Create an ExternalName service.
➜ Loadbalancer Create a LoadBalancer service.
➜ nodeport Create a NodePort service.
Basics - SERVICE Nodeport
Node port

Recommended for you

Kubernetes Immersion
Kubernetes ImmersionKubernetes Immersion
Kubernetes Immersion

Kubernetes seems to be the biggest buzz word currently in the DevOps world. The Google designed container orchestrator based in their 10+ years of experience running production applications using containers seems to have positioned as the market leader. Open source, available in both Google Cloud and Azure container platforms or as a custom installation, it is ready to receive production loads. During this talk we will discover how does Kubernetes works, its architecture, what components compose a Kubernetes cluster. We will also learn what objects can a developer use to deploy its applications on a Kubernetes cluster. We will see a live demo where we will deploy an application and then introduce changes to it without any downtime.

kubernetescontainerstechnology
Continuous deployment of polyglot microservices: A practical approach
Continuous deployment of polyglot microservices: A practical approachContinuous deployment of polyglot microservices: A practical approach
Continuous deployment of polyglot microservices: A practical approach

This document discusses a practical approach to continuous deployment of polyglot microservices. It introduces the author and describes how traditional companies are adopting DevOps practices. The approach focuses on being continuous, using multiple programming languages as needed, immutable infrastructure with containers, reliability through functional testing, automated deployments, and practical architecture. Kubernetes and OpenShift are discussed as platform options. Lessons learned include that Kubernetes alone often fits needs better than OpenShift, and external service discovery can replace ingress controllers when using an external router.

Introduction to containers, k8s, Microservices & Cloud Native
Introduction to containers, k8s, Microservices & Cloud NativeIntroduction to containers, k8s, Microservices & Cloud Native
Introduction to containers, k8s, Microservices & Cloud Native

Slides built to upskill and enable internal team and/or partners on foundational infra skills to work in a containerized world. Topics covered - Container / Containerization - Docker - k8s / container orchestration - Microservices - Service Mesh / Serverless - Cloud Native (apps & infra) - Relationship between Kubernetes and Runtime Fabric Audiences: MuleSoft internal technical team, partners, Runtime Fabric users.

Basics - Tying it all together
Networking
The Kubernetes networking model is based on a flat address space. All pods in a cluster can directly see each other. Each
pod has its own IP address. There is no need to configure any NAT. In addition, containers in the same pod share their pod's
IP address and can communicate with each other through localhost. This model is pretty opinionated, but once set up, it
simplifies life considerably both for developers and administrators. It makes it particularly easy to migrate traditional
network
applications to Kubernetes. A pod represents a traditional node and each container represents a traditional process.
Networking
Kubernetes use the CNI drivers model . where container networking is a driver in kubernetes and can be replaced
The major cni drivers are
Docker - Default network for single node ( minikube) uses macvlan network
Weave - an overlay network driver
Flannel - full subnet to every host backed by etcd to manage networks uses in kernel VXlAN
Calico - layer 3 kernel level implementation uses bgp for node communication does not need to use nat
Canal - a mix of both flannel and calico combines the best of bot
Networking
Kubernetes networking
Inter-pod communication (pod to pod)
Pods in Kubernetes are allocated a network-visible IP address (not private to the node). Pods can communicate directly without the aid
of network address translation, tunnels, proxies, or any other obfuscating layer. Well-known port
numbers can be used for a configuration-free communication scheme. The pod's internal IP address is the same as its external IP
address that other pods see (within the cluster network; not exposed to the outside world). That means that standard
naming and discovery mechanisms such as DNS work out of the box.
Pod to service communication
Pods can talk to each other directly using their IP addresses and well-known ports, but that requires the pods to know each other's IP
addresses. In a Kubernetes cluster, pods can be destroyed and created constantly. The service provides a layer of indirection that is
very useful because the service is stable even if the set of actual pods that respond to requests is ever-changing. In addition, you get
automatic, highly available load balancing because the Kube-proxy on each node takes care of redirecting traffic to the correct pod:

Recommended for you

Newesis - Introduction to Containers
Newesis -  Introduction to ContainersNewesis -  Introduction to Containers
Newesis - Introduction to Containers

This document provides an introduction to containers and container orchestration technologies. It discusses the evolution from virtual machines to containers and the benefits of containers. It then explains why an orchestrator tool is needed to manage containers at scale. The remainder of the document defines common container and orchestration concepts, including Docker, Kubernetes objects and components, Helm for package management, and Istio for traffic management and security.

kubernetesdockercontainers
Taking the Next Hot Mobile Game Live with Docker and IBM SoftLayer
Taking the Next Hot Mobile Game Live with Docker and IBM SoftLayerTaking the Next Hot Mobile Game Live with Docker and IBM SoftLayer
Taking the Next Hot Mobile Game Live with Docker and IBM SoftLayer

Presentation at the IBM InterConnect Conference in Las Vegas, Nevada on February 24, 2016. Mobile games are the fastest-growing sector of the $70 billion video game industry, far outpacing traditional consoles. But companies that aspire to create the next hot title have to account for more than just the app downloaded to a user device. They must prepare for huge spikes in game play with scalable backends to handle massive data and transactions behind socially linked user profiles and global leaderboards. This talk looks at how IBM successfully partnered with Firemonkeys, a major studio that had hit their vertical scaling limit, to design and deploy a new Docker-based architecture on SoftLayer. This scale-out architecture is able to handle an order of magnitude more customers for their next major release.

docker softlayer ibm firemonkeys videogames cloud
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 RaleighKube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh

This is my Introduction to Kubernetes and Overview of the Kubernetes Conformance Certification Program talk presented at OpenSource101 Raleigh on Feb 17, 2018

#kubernetes #conformance #overview #opensource101
Networking
Deployments
A Deployment controller provides declarative updates for Pods and ReplicaSets.
You describe a desired state in a Deployment object, and the Deployment controller changes the actual state to the
desired state at a controlled rate. You can define Deployments to create new ReplicaSets, or to remove existing
Deployments and adopt all their resources with new Deployments.
Deployments
The best practices for multi tier apps on k8s are standard we
will discuss a few points .
● differentiate between the backend and the frontend with
some logical api
● all logs should be printed to stdout of containers
● all apps should be stateless except for the storage points
which should have an external storage
Deployments
● all apps should be defined in k8s as deployments with :
○ replicas more than one
○ health check should be defined
○ resource requests and limit should be set to be able to
account for storage /cpu /memory starvation
○ versioning metadata should be defined .

Recommended for you

Cloud Foundry Diego: The New Cloud Runtime - CloudOpen Europe Talk 2015
Cloud Foundry Diego: The New Cloud Runtime - CloudOpen Europe Talk 2015Cloud Foundry Diego: The New Cloud Runtime - CloudOpen Europe Talk 2015
Cloud Foundry Diego: The New Cloud Runtime - CloudOpen Europe Talk 2015

The document describes Cloud Foundry Diego, a new container-based runtime for Cloud Foundry that supports running heterogeneous workloads like Docker containers, .NET applications, and tasks on different infrastructure environments. Some key points: - Diego is an extensible, distributed system that orchestrates and schedules containerized applications and tasks across Linux and Windows container execution nodes. - It introduces new abstractions like tasks for running single units of work, and long-running processes. These can be distributed across cells for high availability. - The runtime aims to support running Docker images, .NET applications natively on Windows cells, as well as traditional Cloud Foundry apps, through platform-neutral APIs. - Developers

cloudconferenceplatform
Java one kubernetes, jenkins and microservices
Java one   kubernetes, jenkins and microservicesJava one   kubernetes, jenkins and microservices
Java one kubernetes, jenkins and microservices

This document discusses microservices with Docker, Kubernetes and Jenkins. It provides an overview of Kubernetes concepts like pods, replication controllers, services and labels. It also discusses how Kubernetes can help manage containers across multiple hosts and address challenges of scaling, avoiding port conflicts and keeping containers running. The document promotes using Jenkins and Kubernetes for continuous integration and delivery of containerized microservices applications. It recommends Fabric8 as a tool that can help create and deploy microservices on Kubernetes.

ci/cddockermicroservices
Big data and Kubernetes
Big data and KubernetesBig data and Kubernetes
Big data and Kubernetes

High level overview of work performed around the Kubernetes ecosystem to enable big data applications and pipelines

bigdatakubernetesspark
Deployments
● when updating databases facing app:
○ have any update to be backward compatible or
○ every database should be wrapped with an api dal
○ in any case avoid multiple writers/readers to the same
DB at most try to keep one reader/writer
● plan for failure and at any time fails pods to test for system
stability (chaos monkey)
METADATA
Metadata in k8s has a very big role .
As k8s provides the ability to do service discovery . we need a way to describe our services and
application
And based on that discovery we do the internal data flow of our app .
To help us in achieving manageable application k8s adds a meta data to all our apps .
Based on that metadata we define and control the flow of data in our apps .
In each pod/deployment/service/replicaset we can add a label inside our metadata section .
That allows us to tag our resources with a simple key: value pair .
We can use that key value pair to then connect services to pod/deployments and play with the flow of our
apps .
Deployments yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app: nginx
version: v1
minReadySeconds: 35
template:
metadata:
labels:
app: nginx
version: v1
spec:
terminationGracePeriodSeconds: 60
containers:
- name: nginx
image: mikiha/nginx-server:1.4
resources:
requests:
memory: "1G"
cpu: "200m"
ports:
- containerPort: 80
livenessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 3
periodSeconds: 3
timeoutSeconds: 3
readinessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 30
periodSeconds: 3
timeoutSeconds: 3
volumeMounts:
- mountPath: /var/log
name: logs
volumes:
- name: logs
hostPath:
path: /LOGS/
Deployments methods
Canary Release is the technique that we use to “softly” deploy
a new version of an application into Production. It consists of
letting only a part of the audience get access to the new
version of the app, while the rest still access the “old” version
one. This is very useful when we want to be sure about
stability in case of any changes which may be breaking, and
have big side effects.

Recommended for you

Why kubernetes for Serverless (FaaS)
Why kubernetes for Serverless (FaaS)Why kubernetes for Serverless (FaaS)
Why kubernetes for Serverless (FaaS)

Kubernetes for FaaS (Function as a Service) - Serverless evolution, some basic constructs, kubenetes features, comparisons - from Serverless conference 2017 Bangalore.

kubernetes for faas (function as a service)kubernetes for serverlessopen source faas comparison
Intro to Kubernetes
Intro to KubernetesIntro to Kubernetes
Intro to Kubernetes

Introduction to Kubernetes presentation by Joonathan Mägi from Teleport delivered at Tallinn DevOps meetup.

containersdockercloud
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes

Soft Introduction to Google's framework for taming containers in the cloud. For devs and architects that they just enter the world of cloud, microservices and containers

containersdockerkubernetes
Deployments methods
The point is: canary release has never been easy to be put into practice.
Depending on the environment we have, it can take so long to be put in
place that we often prefer to leave this away.
However, with Docker containers and Kubernetes orchestration it is quite
friendly to do that.
Deployments methods
Blue-green deployment is a technique that reduces downtime and risk by
running two identical production environments called Blue and Green.
At any time, only one of the environments is accessable , with the live
environment serving all production traffic. For this example, Blue is
currently live and Green is idle.
Deployments methods
As you prepare a new version of your software, deployment and the final
stage of testing takes place in the environment that is not live: in this
example, Green. Once you have deployed and fully tested the software in
Green, you switch the router so all incoming requests now go to Green
instead of Blue. Green is now live, and Blue is idle.
This technique can eliminate downtime due to application deployment. In
addition, blue-green deployment reduces risk: if something unexpected
happens with your new version on Green, you can immediately roll back to
the last version by switching back to Blue.
Deployments methods
A/B testing (sometimes called split testing) is comparing
two versions of a web page to see which one performs
better.
You compare two web pages by showing the two variants
(let's call them A and B) to similar visitors at the same time.
The one that gives a better conversion rate, wins!

Recommended for you

Kubernetes From Scratch .pdf
Kubernetes From Scratch .pdfKubernetes From Scratch .pdf
Kubernetes From Scratch .pdf

Kubernetes is an open-source tool for managing containerized applications across clusters of nodes. It provides capabilities for deployment, maintenance, and scaling of applications. The document discusses Kubernetes concepts like pods, deployments, services, namespaces and components like the API server, scheduler and kubelet. It also covers Kubernetes commands and configuration using objects like config maps, secrets, volumes and labels.

Kubernetes
KubernetesKubernetes
Kubernetes

The document discusses various Kubernetes concepts including pods, deployments, services, ingress, labels, health checks, config maps, secrets, volumes, autoscaling, resource quotas, namespaces, Helm, and the Kubernetes Dashboard. Kubernetes is a container orchestration tool that manages container deployment, scaling, and networking. It uses pods to group containers, deployments to manage pods, and services for exposing applications.

kubernetesk8sdocker orchestration tools
KubernetesPPT.pptx
KubernetesPPT.pptxKubernetesPPT.pptx
KubernetesPPT.pptx

Container orchestration engine for automating deployment, scaling, and management of containerized applications. What are Microservices? What is container? What is Containerization? What is Docker?

Deployments methods
Rolling update
To update a service without an outage, kubectl supports what is called ‘rolling update’, which updates one pod at a time,
rather than taking down the entire service at the same time.
Rolling Update Deployment
The Deployment updates Pods in a rolling update fashion when .spec.strategy.type==RollingUpdate. You can specify
maxUnavailable and maxSurge to control the rolling update process.
Deployments Hands on
Login labs.play-with-k8s.com
clone : https://github.com/mikiha81/k8smeetup.git
On labs.play-with-k8s press the + button to add a node . and run the commands
1. kubeadm init --apiserver-advertise-address $(hostname -i)
2. kubectl apply -n kube-system -f
"https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 |tr -d
'n')"
Then press the + again and copy from the first node the kubeadm join command
and run it in the second node
Deployments Hands on
Deploy the yamls from nginx folder in the git project this is
the base line deploy .
Verify you can access it using curl run
Kubectl get svc and check the node port in the 3XXXX range
And from node 2 issue the command :
while true; do curl http://localhost:30938/version.html ; sleep
1 ; done
Deployments Hands on
Canray release :
In the canary-release folder print the yaml and look at the changes ….
apply the deployment yaml .
Run kubectl get pod verify the pod is up and ready .
Then go back to the 2nd node and look at the result of the curl .
Whats going on ?
Next delete the deployment for canary kubectl delete -f deployment.yaml

Recommended for you

Kubernetes Architecture with Components
 Kubernetes Architecture with Components Kubernetes Architecture with Components
Kubernetes Architecture with Components

This document provides an overview of Kubernetes architecture and components. It describes how to run a simple Kubernetes setup using a Docker container. The container launches all key Kubernetes components including the API server, scheduler, etcd and controller manager. Using kubectl, the document demonstrates deploying an nginx pod and exposing it as a service. This allows curling the nginx default page via the service IP to confirm the basic setup is functioning.

Google Cloud Platform Kubernetes Workshop IYTE
Google Cloud Platform Kubernetes Workshop IYTEGoogle Cloud Platform Kubernetes Workshop IYTE
Google Cloud Platform Kubernetes Workshop IYTE

Google Cloud Platform and Kubernetes all day workshop notes. Showing why we need Kubernetes and why we have to choose GCP as container engine.

kubernetesizmiriyte
Docker Application to Scientific Computing
Docker Application to Scientific ComputingDocker Application to Scientific Computing
Docker Application to Scientific Computing

Docker allows creating isolated environments called containers from images. Containers provide a standard way to develop, ship, and run applications. The document discusses how Docker can be used for scientific computing including running different versions of software, automating computations, sharing research environments and results, and providing isolated development environments for users through Docker IaaS tools. K-scope is a code analysis tool that previously required complex installation of its Omni XMP dependency, but could now be run as a containerized application to simplify deployment.

docker iaas toolsaicsriken
Deployments Hands on
Blue green deployment :
In the blue green deployment
First apply the service-2.0.yaml
Then apply the deployment.yaml
Wait for the container to become ready .
And apply the service.yaml …
Look the result of the curl .
What’s going on ?
Now delete the deployment .. and apply the service.yaml from the nginx folder .
Deployments Hands on
A/B TESTING :
How do you do it ?
Play with the deployment yaml and the service.yaml from the nginx folder and use
the v2.5 tag
Remember to reset deployment and service back to nginx default before moving
on
Deployments Hands on
Rolling update :
Because our default update policy is rolling update is
To do a rolling update ..
Run the command
kubectl set image deployment nginx nginx=mikiha/nginx:2.6
Run a kubectl get pod and look the pods replacing ope by one .
And go to the second node … look the curl log
K8s deployments limitations
deployments in kubernetes while being advanced still has some limitations
● no dependencies between different deployments
● no versioning of deployments
● somewhat limited variables declaration
● no flow control in descriptive
● no hooks when deploying and upgrading so /deploy/upgrade is linear
● no central repository for application deployment declaration

Recommended for you

A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to Kubernetes

This document provides an overview of Kubernetes and containerization concepts including Docker containers, container orchestration with Kubernetes, deploying and managing applications on Kubernetes, and using Helm to package and deploy applications to Kubernetes. Key terms like pods, deployments, services, configmaps and secrets are defined. Popular container registries, orchestrators and cloud offerings are also mentioned.

devopskubernetesdocker
Kubernetes: A Top Notch Automation Solution
Kubernetes: A Top Notch Automation SolutionKubernetes: A Top Notch Automation Solution
Kubernetes: A Top Notch Automation Solution

Kubernetes is a portable, extensible open-source platform that facilitates automated deployment, scaling, and management of Linux containerized applications. It was developed by Google, written using the GO language. It is a PaaS(Platform as a Service) when used on the cloud, whereas it is also flexible as an IaaS(Infrastructure as a Service) and SaaS(Software as a Service) by enabling portability, simplified scaling, and provision of robust software models.

digital finance transformationcloud migration consultingcloud migration tools
Sumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic Cert Jam - Advanced Metrics with KubernetesSumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic Cert Jam - Advanced Metrics with Kubernetes

This document outlines an agenda for a course to become certified as a Sumo Kubernetes Analyst. The course will provide an introduction to Kubernetes and Sumo Logic's monitoring capabilities, including four different views into Kubernetes systems. Attendees will participate in hands-on labs and have the opportunity to get certified through an online exam.

Deployment solution
The solution for our issues HELM
helm is maintained by the CNCF which also maintains k8s
helm uses go syntax for declarative language in deploying application to k8s
advantages of helm
● central repository
● full descriptive language with flow control
● full hooks for before and after deploying
● allows specifying of dependencies
● full versioning support
● full templating support
Helm - intro
Helm is a clients server solution made out of two apps .
Tiller thats the server that talks k8s and deploys the configuration to K8s.
Helm . the Client that does some of the heavy lifting and compiles the charts and
turns them into releases that deploys to tiller .
both tiller and helm are go binaries . (small and static)
as helm supports remote repositories helm know how to download charts from
remote repositories (like yum apt brew apk) . but helm does not provide a way to
upload a chart to a remote server .
Helm - intro continued
Helm deploys charts - those are the templates to create k8s deployments
services and most of the resources that k8s supports .
once a chart is “compiled “ and deploys to a k8s server it turn to a release .
to look for releases in a repo you can use helm search
to list charts and releases use helm ls
for instance :
helm ls
NAME REVISION UPDATED STATUS CHART NAMESPACE
miki-wordpress 1 Sun Apr 15 00:32:55 2018 DEPLOYED wordpress-1.0.0 default
viable-aardvark 1 Tue Apr 10 15:29:04 2018 DEPLOYED wordpress-1.0.0 default
Helm - intro continued
as you can see in this case we have two different releases for wordpress with the
same chart , this is done when using the helm install.
the first chart was installed with --name = RELEASE NAME flag , the second one
was just helm install wordpress .
also we can see the status, namespace and the revision , we can do rollback to
previous versions
helm ls
NAME REVISION UPDATED STATUS CHART
NAMESPACE
miki-wordpress 1 Sun Apr 15 00:32:55 2018 DEPLOYED wordpress-1.0.0 default
viable-aardvark 1 Tue Apr 10 15:29:04 2018 DEPLOYED wordpress-1.0.0 default

Recommended for you

Container Orchestration using kubernetes
Container Orchestration using kubernetesContainer Orchestration using kubernetes
Container Orchestration using kubernetes

This document provides an overview of Kubernetes concepts including: - Kubernetes architecture with masters running control plane components like the API server, scheduler, and controller manager, and nodes running pods and node agents. - Key Kubernetes objects like pods, services, deployments, statefulsets, jobs and cronjobs that define and manage workloads. - Networking concepts like services for service discovery, and ingress for external access. - Storage with volumes, persistentvolumes, persistentvolumeclaims and storageclasses. - Configuration with configmaps and secrets. - Authentication and authorization using roles, rolebindings and serviceaccounts. It also discusses Kubernetes installation with minikube, and common networking and deployment

stupid-simple-kubernetes-final.pdf
stupid-simple-kubernetes-final.pdfstupid-simple-kubernetes-final.pdf
stupid-simple-kubernetes-final.pdf

In the era of Microservices, Cloud Computing and Serverless architecture, it’s useful to understand Kubernetes and learn how to use it. However, the official Kubernetes documentation can be hard to decipher, especially for newcomers. In this book, I will present a simplified view of Kubernetes and give examples of how to use it for deploying microservices using different cloud providers, including Azure, Amazon, Google Cloud and even IBM.

Cloud technology with practical knowledge
Cloud technology with practical knowledgeCloud technology with practical knowledge
Cloud technology with practical knowledge

Docker uses a client-server architecture with a Docker client communicating with the Docker daemon. The daemon manages Docker objects like images, containers, networks and volumes. Kubernetes is an open-source system that automates deployment, scaling, and management of containerized applications. It ensures containers run as expected and acquires necessary resources. Key Kubernetes components include pods, deployments, services, nodes, and the control plane which manages the cluster.

Helm - intro
to create a chart we use the create command in helm once we do this we create a boilerplate folder with
the name of the chart we use so . .
helm create miki-small-app
this creates the files we need for our owne chart
Charts.yaml - contains the name,description,version of the chart
values.yaml - default values that we can modify and access from each template
templates folder - a template folder contains our resources templates, we will
we will modify them for our deployments as the
template files - this can al be yaml files we declare and container resources
they must not start with _
_helpers.tpl - template file for go definitions such as function or descriptive logic code
miki-small-app/
├── charts
├── Chart.yaml
├── templates
│ ├── deployment.yaml
│ ├── _helpers.tpl
│ ├── ingress.yaml
│ ├── NOTES.txt
│ └── service.yaml
└── values.yaml
Helm - intro
chart folder can container a number of other chart to install other charts manually
- an optional file is requirements.yaml in the that can link to dependent charts
and their versions like
also alias field can point
to a release name
and is optional
tags and condition is also
optional
condition can link to
a value that we can reference from our parent chart
miki-small-app/
├── charts
├── Chart.yaml
├── templates
│ ├── deployment.yaml
│ ├── _helpers.tpl
│ ├── ingress.yaml
│ ├── NOTES.txt
│ └── service.yaml
└── values.yaml
dependencies:
- name: subchart
repository: http://localhost:10191
version: 0.1.0
alias: new-subchart-1
tag:
- subchart1
condition: subchart1.enabled
Helm - intro
looking at out default deployment :
we see some default yaml we know and love from k8s
but there are some {{ }} code . this is a generated code
from the go engine of helm , we can use this to create
descriptive code we can access from other files .
so in the name field we have the {{template “chart.fullname”}}
this actually goes to our templates file and looks for the name
of the variables we define .
same as .Values.replicacount goes to our variable.yaml file .
and the .Release.Name goes to our Charts.yaml and takes our
release name .
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "miki-small-app.fullname" . }}
labels:
app: {{ template "miki-small-app.name" . }}
chart: {{ template "miki-small-app.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "miki-small-app.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "miki-small-app.name" . }}
release: {{ .Release.Name }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
Helm - intro
also in our code is a reference to toYaml
this is for cases when our code is already in yaml format
for this to Yaml solves our issue with importing code
also in case where our code cannot be indented in the source
file we need to match the it to the resulting generated
yaml file we can pipe to an indent functions like so |indent NUM
we can also include function from our _helpers file
so for instance we define a code block in our template :
{{- define "my_labels" }}
labels:
generator: helm
date: {{ now | htmlDate }}
{{- end }}
and access it in our resource.yaml file like so
{{ template "mychart_app" . }}
or use the include function in the template function the code is added as as and in include its proccesd
as a function .
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}

Recommended for you

Jenkins_K8s (2).pptx
Jenkins_K8s (2).pptxJenkins_K8s (2).pptx
Jenkins_K8s (2).pptx

This document provides an overview of Kubernetes and DevOps. It begins with an introduction to Kubernetes, explaining that it is a container orchestration system originally developed by Google to automate deployment, scaling, and management of containerized applications. It then describes the main components of Kubernetes, including Pods, Services, Deployments, and the control plane and node structure. The document also discusses concepts like continuous integration, containers, microservices applications, and DevOps practices like rolling updates that Kubernetes facilitates.

k8sjenkinspresentation
Docker Online Training | Kubernetes Training in Ameerpet
Docker Online Training | Kubernetes Training in AmeerpetDocker Online Training | Kubernetes Training in Ameerpet
Docker Online Training | Kubernetes Training in Ameerpet

Visualpath provides top-quality Certified Kubernetes Security Specialist Training Worldwide led by real-time instructors. We offer daily recordings and presentations for reference. Enroll for a Free Demo. Call +91-9989971070. Visit Blog: https://visualpathblogs.com/ WhatsApp: https://www.whatsapp.com/catalog/917032290546/ Visit: https://www.visualpath.in/DevOps-docker-kubernetes-training.html

dockeronlinetrainingckatrainingonlinekubernetesonlinetraining
Federated Kubernetes: As a Platform for Distributed Scientific Computing
Federated Kubernetes: As a Platform for Distributed Scientific ComputingFederated Kubernetes: As a Platform for Distributed Scientific Computing
Federated Kubernetes: As a Platform for Distributed Scientific Computing

A high level overview of Kubernetes Federation and the challenges encountered when building out a Platform for multi-institutional Research and Distributed Scientific Computing.

kubernetesfederationscientific computing
Helm- Lab
To install helm download the release from here
https://storage.googleapis.com/kubernetes-helm/helm-v2.9.1-linux-amd64.tar.gz
Unpack on node 1 and run helm init
Once it's done run helm install

More Related Content

What's hot

What is Kubernets
What is  KubernetsWhat is  Kubernets
What is Kubernets
Echelon Edge Pvt Ltd
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
Araf Karsh Hamid
 
Kubernetes 101 Workshop
Kubernetes 101 WorkshopKubernetes 101 Workshop
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility
Docker, Inc.
 
ZCloud Consensus on Hardware for Distributed Systems
ZCloud Consensus on Hardware for Distributed SystemsZCloud Consensus on Hardware for Distributed Systems
ZCloud Consensus on Hardware for Distributed Systems
Gokhan Boranalp
 
Using Deep Learning Toolkits with Kubernetes clusters
Using Deep Learning Toolkits with Kubernetes clustersUsing Deep Learning Toolkits with Kubernetes clusters
Using Deep Learning Toolkits with Kubernetes clusters
Joy Qiao
 
Container World 2017!
Container World 2017!Container World 2017!
Container World 2017!
kgraham32
 
Kubernetes Interview Questions And Answers | Kubernetes Tutorial | Kubernetes...
Kubernetes Interview Questions And Answers | Kubernetes Tutorial | Kubernetes...Kubernetes Interview Questions And Answers | Kubernetes Tutorial | Kubernetes...
Kubernetes Interview Questions And Answers | Kubernetes Tutorial | Kubernetes...
Edureka!
 
Cluster management with Kubernetes
Cluster management with KubernetesCluster management with Kubernetes
Cluster management with Kubernetes
Satnam Singh
 
Kubernetes Immersion
Kubernetes ImmersionKubernetes Immersion
Kubernetes Immersion
Juan Larriba
 
Continuous deployment of polyglot microservices: A practical approach
Continuous deployment of polyglot microservices: A practical approachContinuous deployment of polyglot microservices: A practical approach
Continuous deployment of polyglot microservices: A practical approach
Juan Larriba
 
Introduction to containers, k8s, Microservices & Cloud Native
Introduction to containers, k8s, Microservices & Cloud NativeIntroduction to containers, k8s, Microservices & Cloud Native
Introduction to containers, k8s, Microservices & Cloud Native
Terry Wang
 
Newesis - Introduction to Containers
Newesis -  Introduction to ContainersNewesis -  Introduction to Containers
Newesis - Introduction to Containers
Rauno De Pasquale
 
Taking the Next Hot Mobile Game Live with Docker and IBM SoftLayer
Taking the Next Hot Mobile Game Live with Docker and IBM SoftLayerTaking the Next Hot Mobile Game Live with Docker and IBM SoftLayer
Taking the Next Hot Mobile Game Live with Docker and IBM SoftLayer
Daniel Krook
 
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 RaleighKube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Brad Topol
 
Cloud Foundry Diego: The New Cloud Runtime - CloudOpen Europe Talk 2015
Cloud Foundry Diego: The New Cloud Runtime - CloudOpen Europe Talk 2015Cloud Foundry Diego: The New Cloud Runtime - CloudOpen Europe Talk 2015
Cloud Foundry Diego: The New Cloud Runtime - CloudOpen Europe Talk 2015
David Soul
 
Java one kubernetes, jenkins and microservices
Java one   kubernetes, jenkins and microservicesJava one   kubernetes, jenkins and microservices
Java one kubernetes, jenkins and microservices
Christian Posta
 
Big data and Kubernetes
Big data and KubernetesBig data and Kubernetes
Big data and Kubernetes
Anirudh Ramanathan
 
Why kubernetes for Serverless (FaaS)
Why kubernetes for Serverless (FaaS)Why kubernetes for Serverless (FaaS)
Why kubernetes for Serverless (FaaS)
Krishna-Kumar
 

What's hot (19)

What is Kubernets
What is  KubernetsWhat is  Kubernets
What is Kubernets
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
Kubernetes 101 Workshop
Kubernetes 101 WorkshopKubernetes 101 Workshop
Kubernetes 101 Workshop
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility
 
ZCloud Consensus on Hardware for Distributed Systems
ZCloud Consensus on Hardware for Distributed SystemsZCloud Consensus on Hardware for Distributed Systems
ZCloud Consensus on Hardware for Distributed Systems
 
Using Deep Learning Toolkits with Kubernetes clusters
Using Deep Learning Toolkits with Kubernetes clustersUsing Deep Learning Toolkits with Kubernetes clusters
Using Deep Learning Toolkits with Kubernetes clusters
 
Container World 2017!
Container World 2017!Container World 2017!
Container World 2017!
 
Kubernetes Interview Questions And Answers | Kubernetes Tutorial | Kubernetes...
Kubernetes Interview Questions And Answers | Kubernetes Tutorial | Kubernetes...Kubernetes Interview Questions And Answers | Kubernetes Tutorial | Kubernetes...
Kubernetes Interview Questions And Answers | Kubernetes Tutorial | Kubernetes...
 
Cluster management with Kubernetes
Cluster management with KubernetesCluster management with Kubernetes
Cluster management with Kubernetes
 
Kubernetes Immersion
Kubernetes ImmersionKubernetes Immersion
Kubernetes Immersion
 
Continuous deployment of polyglot microservices: A practical approach
Continuous deployment of polyglot microservices: A practical approachContinuous deployment of polyglot microservices: A practical approach
Continuous deployment of polyglot microservices: A practical approach
 
Introduction to containers, k8s, Microservices & Cloud Native
Introduction to containers, k8s, Microservices & Cloud NativeIntroduction to containers, k8s, Microservices & Cloud Native
Introduction to containers, k8s, Microservices & Cloud Native
 
Newesis - Introduction to Containers
Newesis -  Introduction to ContainersNewesis -  Introduction to Containers
Newesis - Introduction to Containers
 
Taking the Next Hot Mobile Game Live with Docker and IBM SoftLayer
Taking the Next Hot Mobile Game Live with Docker and IBM SoftLayerTaking the Next Hot Mobile Game Live with Docker and IBM SoftLayer
Taking the Next Hot Mobile Game Live with Docker and IBM SoftLayer
 
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 RaleighKube Overview and Kube Conformance Certification OpenSource101 Raleigh
Kube Overview and Kube Conformance Certification OpenSource101 Raleigh
 
Cloud Foundry Diego: The New Cloud Runtime - CloudOpen Europe Talk 2015
Cloud Foundry Diego: The New Cloud Runtime - CloudOpen Europe Talk 2015Cloud Foundry Diego: The New Cloud Runtime - CloudOpen Europe Talk 2015
Cloud Foundry Diego: The New Cloud Runtime - CloudOpen Europe Talk 2015
 
Java one kubernetes, jenkins and microservices
Java one   kubernetes, jenkins and microservicesJava one   kubernetes, jenkins and microservices
Java one kubernetes, jenkins and microservices
 
Big data and Kubernetes
Big data and KubernetesBig data and Kubernetes
Big data and Kubernetes
 
Why kubernetes for Serverless (FaaS)
Why kubernetes for Serverless (FaaS)Why kubernetes for Serverless (FaaS)
Why kubernetes for Serverless (FaaS)
 

Similar to prodops.io k8s presentation

Intro to Kubernetes
Intro to KubernetesIntro to Kubernetes
Intro to Kubernetes
Joonathan Mägi
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
Paris Apostolopoulos
 
Kubernetes From Scratch .pdf
Kubernetes From Scratch .pdfKubernetes From Scratch .pdf
Kubernetes From Scratch .pdf
ssuser9b44c7
 
Kubernetes
KubernetesKubernetes
Kubernetes
Lhouceine OUHAMZA
 
KubernetesPPT.pptx
KubernetesPPT.pptxKubernetesPPT.pptx
KubernetesPPT.pptx
Ryuzaki360
 
Kubernetes Architecture with Components
 Kubernetes Architecture with Components Kubernetes Architecture with Components
Kubernetes Architecture with Components
Ajeet Singh
 
Google Cloud Platform Kubernetes Workshop IYTE
Google Cloud Platform Kubernetes Workshop IYTEGoogle Cloud Platform Kubernetes Workshop IYTE
Google Cloud Platform Kubernetes Workshop IYTE
Gokhan Boranalp
 
Docker Application to Scientific Computing
Docker Application to Scientific ComputingDocker Application to Scientific Computing
Docker Application to Scientific Computing
Peter Bryzgalov
 
A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to Kubernetes
Paul Czarkowski
 
Kubernetes: A Top Notch Automation Solution
Kubernetes: A Top Notch Automation SolutionKubernetes: A Top Notch Automation Solution
Kubernetes: A Top Notch Automation Solution
Fibonalabs
 
Sumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic Cert Jam - Advanced Metrics with KubernetesSumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic
 
Container Orchestration using kubernetes
Container Orchestration using kubernetesContainer Orchestration using kubernetes
Container Orchestration using kubernetes
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
stupid-simple-kubernetes-final.pdf
stupid-simple-kubernetes-final.pdfstupid-simple-kubernetes-final.pdf
stupid-simple-kubernetes-final.pdf
DaniloQueirozMota
 
Cloud technology with practical knowledge
Cloud technology with practical knowledgeCloud technology with practical knowledge
Cloud technology with practical knowledge
AnshikaNigam8
 
Jenkins_K8s (2).pptx
Jenkins_K8s (2).pptxJenkins_K8s (2).pptx
Jenkins_K8s (2).pptx
khalil Ismail
 
Docker Online Training | Kubernetes Training in Ameerpet
Docker Online Training | Kubernetes Training in AmeerpetDocker Online Training | Kubernetes Training in Ameerpet
Docker Online Training | Kubernetes Training in Ameerpet
navyatejavisualpath
 
Federated Kubernetes: As a Platform for Distributed Scientific Computing
Federated Kubernetes: As a Platform for Distributed Scientific ComputingFederated Kubernetes: As a Platform for Distributed Scientific Computing
Federated Kubernetes: As a Platform for Distributed Scientific Computing
Bob Killen
 
DevJam 2019 - Introduction to Kubernetes
DevJam 2019 - Introduction to KubernetesDevJam 2019 - Introduction to Kubernetes
DevJam 2019 - Introduction to Kubernetes
Ronny Trommer
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
Vishal Biyani
 
modern-guide-to-container-monitoring-and-orchestration.pdf
modern-guide-to-container-monitoring-and-orchestration.pdfmodern-guide-to-container-monitoring-and-orchestration.pdf
modern-guide-to-container-monitoring-and-orchestration.pdf
Guillaume Kpotufe
 

Similar to prodops.io k8s presentation (20)

Intro to Kubernetes
Intro to KubernetesIntro to Kubernetes
Intro to Kubernetes
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Kubernetes From Scratch .pdf
Kubernetes From Scratch .pdfKubernetes From Scratch .pdf
Kubernetes From Scratch .pdf
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
KubernetesPPT.pptx
KubernetesPPT.pptxKubernetesPPT.pptx
KubernetesPPT.pptx
 
Kubernetes Architecture with Components
 Kubernetes Architecture with Components Kubernetes Architecture with Components
Kubernetes Architecture with Components
 
Google Cloud Platform Kubernetes Workshop IYTE
Google Cloud Platform Kubernetes Workshop IYTEGoogle Cloud Platform Kubernetes Workshop IYTE
Google Cloud Platform Kubernetes Workshop IYTE
 
Docker Application to Scientific Computing
Docker Application to Scientific ComputingDocker Application to Scientific Computing
Docker Application to Scientific Computing
 
A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to Kubernetes
 
Kubernetes: A Top Notch Automation Solution
Kubernetes: A Top Notch Automation SolutionKubernetes: A Top Notch Automation Solution
Kubernetes: A Top Notch Automation Solution
 
Sumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic Cert Jam - Advanced Metrics with KubernetesSumo Logic Cert Jam - Advanced Metrics with Kubernetes
Sumo Logic Cert Jam - Advanced Metrics with Kubernetes
 
Container Orchestration using kubernetes
Container Orchestration using kubernetesContainer Orchestration using kubernetes
Container Orchestration using kubernetes
 
stupid-simple-kubernetes-final.pdf
stupid-simple-kubernetes-final.pdfstupid-simple-kubernetes-final.pdf
stupid-simple-kubernetes-final.pdf
 
Cloud technology with practical knowledge
Cloud technology with practical knowledgeCloud technology with practical knowledge
Cloud technology with practical knowledge
 
Jenkins_K8s (2).pptx
Jenkins_K8s (2).pptxJenkins_K8s (2).pptx
Jenkins_K8s (2).pptx
 
Docker Online Training | Kubernetes Training in Ameerpet
Docker Online Training | Kubernetes Training in AmeerpetDocker Online Training | Kubernetes Training in Ameerpet
Docker Online Training | Kubernetes Training in Ameerpet
 
Federated Kubernetes: As a Platform for Distributed Scientific Computing
Federated Kubernetes: As a Platform for Distributed Scientific ComputingFederated Kubernetes: As a Platform for Distributed Scientific Computing
Federated Kubernetes: As a Platform for Distributed Scientific Computing
 
DevJam 2019 - Introduction to Kubernetes
DevJam 2019 - Introduction to KubernetesDevJam 2019 - Introduction to Kubernetes
DevJam 2019 - Introduction to Kubernetes
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
modern-guide-to-container-monitoring-and-orchestration.pdf
modern-guide-to-container-monitoring-and-orchestration.pdfmodern-guide-to-container-monitoring-and-orchestration.pdf
modern-guide-to-container-monitoring-and-orchestration.pdf
 

Recently uploaded

Performance Budgets for the Real World by Tammy Everts
Performance Budgets for the Real World by Tammy EvertsPerformance Budgets for the Real World by Tammy Everts
Performance Budgets for the Real World by Tammy Everts
ScyllaDB
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Chris Swan
 
HTTP Adaptive Streaming – Quo Vadis (2024)
HTTP Adaptive Streaming – Quo Vadis (2024)HTTP Adaptive Streaming – Quo Vadis (2024)
HTTP Adaptive Streaming – Quo Vadis (2024)
Alpen-Adria-Universität
 
@Call @Girls Thiruvananthapuram 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
@Call @Girls Thiruvananthapuram  🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...@Call @Girls Thiruvananthapuram  🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
@Call @Girls Thiruvananthapuram 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
kantakumariji156
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
Aurora Consulting
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
Verti - EMEA Insurer Innovation Award 2024
Verti - EMEA Insurer Innovation Award 2024Verti - EMEA Insurer Innovation Award 2024
Verti - EMEA Insurer Innovation Award 2024
The Digital Insurer
 
GDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
GDG Cloud Southlake #34: Neatsun Ziv: Automating AppsecGDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
GDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
James Anderson
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design ApproachesKnowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Earley Information Science
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
Why do You Have to Redesign?_Redesign Challenge Day 1
Why do You Have to Redesign?_Redesign Challenge Day 1Why do You Have to Redesign?_Redesign Challenge Day 1
Why do You Have to Redesign?_Redesign Challenge Day 1
FellyciaHikmahwarani
 
@Call @Girls Guwahati 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cute Girl any...
@Call @Girls Guwahati 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cute Girl any...@Call @Girls Guwahati 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cute Girl any...
@Call @Girls Guwahati 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cute Girl any...
kantakumariji156
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
Matthew Sinclair
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Erasmo Purificato
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
Liveplex
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
huseindihon
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 

Recently uploaded (20)

Performance Budgets for the Real World by Tammy Everts
Performance Budgets for the Real World by Tammy EvertsPerformance Budgets for the Real World by Tammy Everts
Performance Budgets for the Real World by Tammy Everts
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
 
HTTP Adaptive Streaming – Quo Vadis (2024)
HTTP Adaptive Streaming – Quo Vadis (2024)HTTP Adaptive Streaming – Quo Vadis (2024)
HTTP Adaptive Streaming – Quo Vadis (2024)
 
@Call @Girls Thiruvananthapuram 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
@Call @Girls Thiruvananthapuram  🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...@Call @Girls Thiruvananthapuram  🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
@Call @Girls Thiruvananthapuram 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
Verti - EMEA Insurer Innovation Award 2024
Verti - EMEA Insurer Innovation Award 2024Verti - EMEA Insurer Innovation Award 2024
Verti - EMEA Insurer Innovation Award 2024
 
GDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
GDG Cloud Southlake #34: Neatsun Ziv: Automating AppsecGDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
GDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design ApproachesKnowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
Why do You Have to Redesign?_Redesign Challenge Day 1
Why do You Have to Redesign?_Redesign Challenge Day 1Why do You Have to Redesign?_Redesign Challenge Day 1
Why do You Have to Redesign?_Redesign Challenge Day 1
 
@Call @Girls Guwahati 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cute Girl any...
@Call @Girls Guwahati 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cute Girl any...@Call @Girls Guwahati 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cute Girl any...
@Call @Girls Guwahati 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cute Girl any...
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
 
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 

prodops.io k8s presentation

  • 2. Kubernetes a clustered container orchestration Software an open-source system for automating deployment, scaling, and management of containerized applications. It groups containers that make up an application into logical units for easy management and discovery. Kubernetes builds upon 15 years of experience of running production workloads at Google, combined with best-of-breed ideas and practices from the community. Now maintained by CNCF a non profit organization sponsored by the largest companies in tech like google,amazon,microsoft , redhat …...
  • 3. CNCF PROJECTS Kubernetes is not the only project maintained by cncf
  • 4. Kubernetes Basic resources ● K8s Master ● K8s Nodes ● Deployment ● Service ● Pod ● Statefulsets ● Daemonset ● Secrets ● Persistent Volumes ● Persistent Volumes Claim ● Storage Class ● Replicasets ……..
  • 5. Desired State And the Declarative Model In k8s we use the declarative model instead of the procedural model . In the the declarative model we define the desired state of our object . unlike the procedural model where we define steps and execute them. In k8s every configuration is made using the declarative model where we describe the target status of our object So in the procedural model we would run a container like this : Docker run nginx
  • 6. Desired State And the Declarative Model In the declarative model it would be: apiVersion: v1 kind: Pod metadata: name: nginx spec: containers: – name: nginx image: nginx
  • 7. Basics - POD Pod Kubernetes targets the management of elastic applications that consist of multiple microservices communicating with each other. Often those microservices are tightly coupled forming a group of containers that would typically, in a non-containerized setup run together on one server. This group, the smallest unit that can be scheduled to be deployed through K8s is called a pod.
  • 8. Basics - POD This group of containers would share storage, Linux namespaces, cgroups, IP addresses. These are co-located, hence share resources and are always scheduled together. Pods are not intended to live long. They are created, destroyed and re-created on demand, based on the state of the server and the service itself.
  • 9. Basics - DEPLOYMENT A Deployment controller provides declarative updates for Pods and ReplicaSets. You describe a desired state in a Deployment object, and the Deployment controller changes the actual state to the desired state at a controlled rate. You can define Deployments to create new ReplicaSets, or to remove existing Deployments and adopt all their resources with new Deployments.
  • 10. Basics - SERVICE As pods have a short lifetime, there is no guarantee about the IP address they are served on. This could make the communication of microservices hard. Imagine a typical Frontend communication with Backend services. Hence K8s has introduced the concept of a service, which is an abstraction on top of a number of pods, typically requiring to run a proxy on top, for other services to communicate with it via a Virtual IP address. This is where you can configure load balancing for your numerous pods and expose them via a service.
  • 11. Basics - SERVICE We can create different types of services : ➜ Clusterip Create a clusterIP service. ➜ externalname Create an ExternalName service. ➜ Loadbalancer Create a LoadBalancer service. ➜ nodeport Create a NodePort service.
  • 12. Basics - SERVICE Nodeport Node port
  • 13. Basics - Tying it all together
  • 14. Networking The Kubernetes networking model is based on a flat address space. All pods in a cluster can directly see each other. Each pod has its own IP address. There is no need to configure any NAT. In addition, containers in the same pod share their pod's IP address and can communicate with each other through localhost. This model is pretty opinionated, but once set up, it simplifies life considerably both for developers and administrators. It makes it particularly easy to migrate traditional network applications to Kubernetes. A pod represents a traditional node and each container represents a traditional process.
  • 15. Networking Kubernetes use the CNI drivers model . where container networking is a driver in kubernetes and can be replaced The major cni drivers are Docker - Default network for single node ( minikube) uses macvlan network Weave - an overlay network driver Flannel - full subnet to every host backed by etcd to manage networks uses in kernel VXlAN Calico - layer 3 kernel level implementation uses bgp for node communication does not need to use nat Canal - a mix of both flannel and calico combines the best of bot
  • 16. Networking Kubernetes networking Inter-pod communication (pod to pod) Pods in Kubernetes are allocated a network-visible IP address (not private to the node). Pods can communicate directly without the aid of network address translation, tunnels, proxies, or any other obfuscating layer. Well-known port numbers can be used for a configuration-free communication scheme. The pod's internal IP address is the same as its external IP address that other pods see (within the cluster network; not exposed to the outside world). That means that standard naming and discovery mechanisms such as DNS work out of the box. Pod to service communication Pods can talk to each other directly using their IP addresses and well-known ports, but that requires the pods to know each other's IP addresses. In a Kubernetes cluster, pods can be destroyed and created constantly. The service provides a layer of indirection that is very useful because the service is stable even if the set of actual pods that respond to requests is ever-changing. In addition, you get automatic, highly available load balancing because the Kube-proxy on each node takes care of redirecting traffic to the correct pod:
  • 18. Deployments A Deployment controller provides declarative updates for Pods and ReplicaSets. You describe a desired state in a Deployment object, and the Deployment controller changes the actual state to the desired state at a controlled rate. You can define Deployments to create new ReplicaSets, or to remove existing Deployments and adopt all their resources with new Deployments.
  • 19. Deployments The best practices for multi tier apps on k8s are standard we will discuss a few points . ● differentiate between the backend and the frontend with some logical api ● all logs should be printed to stdout of containers ● all apps should be stateless except for the storage points which should have an external storage
  • 20. Deployments ● all apps should be defined in k8s as deployments with : ○ replicas more than one ○ health check should be defined ○ resource requests and limit should be set to be able to account for storage /cpu /memory starvation ○ versioning metadata should be defined .
  • 21. Deployments ● when updating databases facing app: ○ have any update to be backward compatible or ○ every database should be wrapped with an api dal ○ in any case avoid multiple writers/readers to the same DB at most try to keep one reader/writer ● plan for failure and at any time fails pods to test for system stability (chaos monkey)
  • 22. METADATA Metadata in k8s has a very big role . As k8s provides the ability to do service discovery . we need a way to describe our services and application And based on that discovery we do the internal data flow of our app . To help us in achieving manageable application k8s adds a meta data to all our apps . Based on that metadata we define and control the flow of data in our apps . In each pod/deployment/service/replicaset we can add a label inside our metadata section . That allows us to tag our resources with a simple key: value pair . We can use that key value pair to then connect services to pod/deployments and play with the flow of our apps .
  • 23. Deployments yaml apiVersion: extensions/v1beta1 kind: Deployment metadata: name: nginx spec: replicas: 1 strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 0 selector: matchLabels: app: nginx version: v1 minReadySeconds: 35 template: metadata: labels: app: nginx version: v1 spec: terminationGracePeriodSeconds: 60 containers: - name: nginx image: mikiha/nginx-server:1.4 resources: requests: memory: "1G" cpu: "200m" ports: - containerPort: 80 livenessProbe: httpGet: path: / port: 80 initialDelaySeconds: 3 periodSeconds: 3 timeoutSeconds: 3 readinessProbe: httpGet: path: / port: 80 initialDelaySeconds: 30 periodSeconds: 3 timeoutSeconds: 3 volumeMounts: - mountPath: /var/log name: logs volumes: - name: logs hostPath: path: /LOGS/
  • 24. Deployments methods Canary Release is the technique that we use to “softly” deploy a new version of an application into Production. It consists of letting only a part of the audience get access to the new version of the app, while the rest still access the “old” version one. This is very useful when we want to be sure about stability in case of any changes which may be breaking, and have big side effects.
  • 25. Deployments methods The point is: canary release has never been easy to be put into practice. Depending on the environment we have, it can take so long to be put in place that we often prefer to leave this away. However, with Docker containers and Kubernetes orchestration it is quite friendly to do that.
  • 26. Deployments methods Blue-green deployment is a technique that reduces downtime and risk by running two identical production environments called Blue and Green. At any time, only one of the environments is accessable , with the live environment serving all production traffic. For this example, Blue is currently live and Green is idle.
  • 27. Deployments methods As you prepare a new version of your software, deployment and the final stage of testing takes place in the environment that is not live: in this example, Green. Once you have deployed and fully tested the software in Green, you switch the router so all incoming requests now go to Green instead of Blue. Green is now live, and Blue is idle. This technique can eliminate downtime due to application deployment. In addition, blue-green deployment reduces risk: if something unexpected happens with your new version on Green, you can immediately roll back to the last version by switching back to Blue.
  • 28. Deployments methods A/B testing (sometimes called split testing) is comparing two versions of a web page to see which one performs better. You compare two web pages by showing the two variants (let's call them A and B) to similar visitors at the same time. The one that gives a better conversion rate, wins!
  • 29. Deployments methods Rolling update To update a service without an outage, kubectl supports what is called ‘rolling update’, which updates one pod at a time, rather than taking down the entire service at the same time. Rolling Update Deployment The Deployment updates Pods in a rolling update fashion when .spec.strategy.type==RollingUpdate. You can specify maxUnavailable and maxSurge to control the rolling update process.
  • 30. Deployments Hands on Login labs.play-with-k8s.com clone : https://github.com/mikiha81/k8smeetup.git On labs.play-with-k8s press the + button to add a node . and run the commands 1. kubeadm init --apiserver-advertise-address $(hostname -i) 2. kubectl apply -n kube-system -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 |tr -d 'n')" Then press the + again and copy from the first node the kubeadm join command and run it in the second node
  • 31. Deployments Hands on Deploy the yamls from nginx folder in the git project this is the base line deploy . Verify you can access it using curl run Kubectl get svc and check the node port in the 3XXXX range And from node 2 issue the command : while true; do curl http://localhost:30938/version.html ; sleep 1 ; done
  • 32. Deployments Hands on Canray release : In the canary-release folder print the yaml and look at the changes …. apply the deployment yaml . Run kubectl get pod verify the pod is up and ready . Then go back to the 2nd node and look at the result of the curl . Whats going on ? Next delete the deployment for canary kubectl delete -f deployment.yaml
  • 33. Deployments Hands on Blue green deployment : In the blue green deployment First apply the service-2.0.yaml Then apply the deployment.yaml Wait for the container to become ready . And apply the service.yaml … Look the result of the curl . What’s going on ? Now delete the deployment .. and apply the service.yaml from the nginx folder .
  • 34. Deployments Hands on A/B TESTING : How do you do it ? Play with the deployment yaml and the service.yaml from the nginx folder and use the v2.5 tag Remember to reset deployment and service back to nginx default before moving on
  • 35. Deployments Hands on Rolling update : Because our default update policy is rolling update is To do a rolling update .. Run the command kubectl set image deployment nginx nginx=mikiha/nginx:2.6 Run a kubectl get pod and look the pods replacing ope by one . And go to the second node … look the curl log
  • 36. K8s deployments limitations deployments in kubernetes while being advanced still has some limitations ● no dependencies between different deployments ● no versioning of deployments ● somewhat limited variables declaration ● no flow control in descriptive ● no hooks when deploying and upgrading so /deploy/upgrade is linear ● no central repository for application deployment declaration
  • 37. Deployment solution The solution for our issues HELM helm is maintained by the CNCF which also maintains k8s helm uses go syntax for declarative language in deploying application to k8s advantages of helm ● central repository ● full descriptive language with flow control ● full hooks for before and after deploying ● allows specifying of dependencies ● full versioning support ● full templating support
  • 38. Helm - intro Helm is a clients server solution made out of two apps . Tiller thats the server that talks k8s and deploys the configuration to K8s. Helm . the Client that does some of the heavy lifting and compiles the charts and turns them into releases that deploys to tiller . both tiller and helm are go binaries . (small and static) as helm supports remote repositories helm know how to download charts from remote repositories (like yum apt brew apk) . but helm does not provide a way to upload a chart to a remote server .
  • 39. Helm - intro continued Helm deploys charts - those are the templates to create k8s deployments services and most of the resources that k8s supports . once a chart is “compiled “ and deploys to a k8s server it turn to a release . to look for releases in a repo you can use helm search to list charts and releases use helm ls for instance : helm ls NAME REVISION UPDATED STATUS CHART NAMESPACE miki-wordpress 1 Sun Apr 15 00:32:55 2018 DEPLOYED wordpress-1.0.0 default viable-aardvark 1 Tue Apr 10 15:29:04 2018 DEPLOYED wordpress-1.0.0 default
  • 40. Helm - intro continued as you can see in this case we have two different releases for wordpress with the same chart , this is done when using the helm install. the first chart was installed with --name = RELEASE NAME flag , the second one was just helm install wordpress . also we can see the status, namespace and the revision , we can do rollback to previous versions helm ls NAME REVISION UPDATED STATUS CHART NAMESPACE miki-wordpress 1 Sun Apr 15 00:32:55 2018 DEPLOYED wordpress-1.0.0 default viable-aardvark 1 Tue Apr 10 15:29:04 2018 DEPLOYED wordpress-1.0.0 default
  • 41. Helm - intro to create a chart we use the create command in helm once we do this we create a boilerplate folder with the name of the chart we use so . . helm create miki-small-app this creates the files we need for our owne chart Charts.yaml - contains the name,description,version of the chart values.yaml - default values that we can modify and access from each template templates folder - a template folder contains our resources templates, we will we will modify them for our deployments as the template files - this can al be yaml files we declare and container resources they must not start with _ _helpers.tpl - template file for go definitions such as function or descriptive logic code miki-small-app/ ├── charts ├── Chart.yaml ├── templates │ ├── deployment.yaml │ ├── _helpers.tpl │ ├── ingress.yaml │ ├── NOTES.txt │ └── service.yaml └── values.yaml
  • 42. Helm - intro chart folder can container a number of other chart to install other charts manually - an optional file is requirements.yaml in the that can link to dependent charts and their versions like also alias field can point to a release name and is optional tags and condition is also optional condition can link to a value that we can reference from our parent chart miki-small-app/ ├── charts ├── Chart.yaml ├── templates │ ├── deployment.yaml │ ├── _helpers.tpl │ ├── ingress.yaml │ ├── NOTES.txt │ └── service.yaml └── values.yaml dependencies: - name: subchart repository: http://localhost:10191 version: 0.1.0 alias: new-subchart-1 tag: - subchart1 condition: subchart1.enabled
  • 43. Helm - intro looking at out default deployment : we see some default yaml we know and love from k8s but there are some {{ }} code . this is a generated code from the go engine of helm , we can use this to create descriptive code we can access from other files . so in the name field we have the {{template “chart.fullname”}} this actually goes to our templates file and looks for the name of the variables we define . same as .Values.replicacount goes to our variable.yaml file . and the .Release.Name goes to our Charts.yaml and takes our release name . apiVersion: apps/v1beta2 kind: Deployment metadata: name: {{ template "miki-small-app.fullname" . }} labels: app: {{ template "miki-small-app.name" . }} chart: {{ template "miki-small-app.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: app: {{ template "miki-small-app.name" . }} release: {{ .Release.Name }} template: metadata: labels: app: {{ template "miki-small-app.name" . }} release: {{ .Release.Name }} spec: containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }}
  • 44. Helm - intro also in our code is a reference to toYaml this is for cases when our code is already in yaml format for this to Yaml solves our issue with importing code also in case where our code cannot be indented in the source file we need to match the it to the resulting generated yaml file we can pipe to an indent functions like so |indent NUM we can also include function from our _helpers file so for instance we define a code block in our template : {{- define "my_labels" }} labels: generator: helm date: {{ now | htmlDate }} {{- end }} and access it in our resource.yaml file like so {{ template "mychart_app" . }} or use the include function in the template function the code is added as as and in include its proccesd as a function . {{ toYaml .Values.resources | indent 12 }} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{ toYaml . | indent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{ toYaml . | indent 8 }} {{- end }}
  • 45. Helm- Lab To install helm download the release from here https://storage.googleapis.com/kubernetes-helm/helm-v2.9.1-linux-amd64.tar.gz Unpack on node 1 and run helm init Once it's done run helm install