SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
Google Cloud Platform
Kubernetes Workshop
www.zetaops.io
Simplicity is the ultimate sophistication
Leonardo da Vinci“
“
Sanallaştırma Temelleri
Sanallaştırma Temelleri - Types
● Full virtualization: running an unmodified OS,
Parallels, VirtualBox, XEN
● Paravirtualization: running a modified guest
system (kernel), XEN, QEMU, KVM
● OS-level virtualization: enables running an
isolated process (tree), OpenVZ, LXC,
BSD-jails, Linux-VServer, Solaris Zones
● Virtualized Containers, LXC, LXD, Docker
Sanallaştırma Temelleri
● Sanal makinalar stateful
● Büyük VM’ler: Depolama VM içinde,
tüm servisler aynı VM içinde,
kocaman vCPU ve vRAM
● Uygulama SLA kuralları VM hayatta
kalsın diye var.
● Dağıtıklık ve fail durumu için eldeki
HA teknolojisine bağlı
● VM’ler kurulumdan sonra CPU ve
RAM bakımından ölçeklenebilir.
● Uygulamalar VM’in crash olması
durumuna göre geliştirilmemiştir.
● Örnek:
Aynı VM üzerinde, database, web
server, frontend app birlikte çalışıyor.
● Uygulamalar dağıtık olmak
üzere tasarlanmıştır. VM’ler
stateless haldedir.
● VM’ler küçüktür.
● Uygulama SLA kuralları tüm
uygulama içindir. Bir VM için
değil.
● Uygulama çok sayıda
instance üzerinde
çalışmaktadır.
● Uygulamanın
ölçeklendirilmesi için anlık
olarak VM eklenebilir.
● Uygulamalar VM’lerin fail
olması durumuna göre
geliştirilmiştir.
PETS CATTLE
Sanallaştırma Temelleri
Kubernetes
Kubernetes
Kubernetes
Kubernetes
Kubernetes
Kubernetes
Kubernetes
Kubernetes
Kubernetes
Kubernetes
Kubernetes
Kubernetes
Kubernetes
Kubernetes
Hands on Kubernetes
Master: Kubernetes control panel or control plane.
This is where decisions are made about the cluster,
such as scheduling, and detecting/responding to
cluster events. The components of the master can
be run on any node in the cluster. Key components
of the master:
API Server — This is the only component of the
Kubernetes control panel with a user-accessible API and
the sole master component that you’ll interact with. The
API server exposes a restful Kubernetes API and
consumes JSON manifest files.
Cluster State&Data Store — Kubernetes uses “etcd.” This
is a strong consistent, and highly-available key value
store that Kubernetes uses for persistent storage of all
API objects. Think of it as the “source of truth” for the
cluster.
Hands on Kubernetes
Hands on Kubernetes
Controller Manager — Known as the “kube-controller
manager,” this runs all the controllers that handle routine
tasks in the cluster. These include the Node Controller,
Replication Controller, Endpoints Controller, and Service
Account and Token Controllers. Each of these controllers
works separately to maintain the desired state.
Hands on Kubernetes
Scheduler — The scheduler watches for newly-created pods
(groups of one or more containers) and assigns them to
nodes.
Dashboard (optional) — Kubernetes web UI that simplifies
the Kubernetes cluster user’s interactions with the API
server.
Kubernetes Worker Nodes
Master handles and manages the cluster, worker nodes run
the containers and provide the Kubernetes runtime
environment. Worker nodes comprise a kubelet. This is the
primary node agent. It watches the API server for pods that
have been assigned to its node. Kubelet carries out tasks
and maintains a reporting backchannel of pod status to the
master node.
Hands on Kubernetes
Hands on Kubernetes
Inside each pod there are containers, kubelet runs these via
Docker (pulling images, starting and stopping containers,
etc.). It also periodically executes any requested container
liveness probes. In addition to Docker, RKT is also
supported and the community is actively working to support
OCI.
Another component of worker nodes is kube-proxy. This is
the network brain of the node, maintaining network rules on
the host and performing connection forwarding. It’s also
responsible for load balancing across all pods in the service.
Kubernetes Pods
A pod is a group of one or more containers (such as Docker
containers), with shared storage/network. Each pod
contains specific information on how the containers should
be run. Think of pods as a ring-fenced environment to run
containers.
Pods are also a unit for scaling. If you need to scale an app
component up or down, this can be achieved by adding or
removing pods.
Hands on Kubernetes
Hands on Kubernetes
It’s possible to run more than one container in a pod (where
each share the same IP address and mounted volumes), if
they’re tightly coupled.
Pods are deployed on a single node and have a definite
lifecycle. They can be pending, running, succeeding, or
failing, but once gone, they are never brought back to life. If
a pod dies, a replication controller or other controller must
be used to create a new one.
Pods — A description of a set of containers that need to run
together.
Services — An object that describes a set of pods that
provide a useful service. Services are typically used to
define clusters of uniform pods.
Persistent Volumes — A Kubernetes abstraction for
persistent storage. Kubernetes supports many types of
volumes, such as NFS, Ceph, GlusterFS, local directory, etc.
Hands on Kubernetes
Namespaces — This is a tool used to group, separate, and
isolate groups of objects. Namespaces are used for access
control, network access control, resource management, and
quoting.
Ingress rules — These specify how incoming network traffic
should be routed to services and pods.
Network policies — This defines the network access rules
between pods inside the cluster.
Hands on Kubernetes
ConfigMaps and Secrets — Used to separate configuration
information from application definition.
Controllers — These implement different policies for
automatic pod management. There are three main types:
1. Deployment — Responsible for maintaining a set of running pods of the
same type.
2. DaemonSet — Runs a specific type of pod on each node based on a
condition.
3. StatefulSet — Used when several pods of the same type are needed to run
in parallel, but each of the pods is required to have a specific identity.
Hands on Kubernetes
Hands on Kubernetes
● Kubernetes simultaneously runs and controls a set of
nodes on virtual or physical machines.
● This is achieved by running agents on each node.
● The agent talks to the master via the same API used to
send the blueprint to Kubernetes.
● The agent registers itself in the master, providing
Kubernetes with information about the nodes.
● Reading through the API, the agent determines which
containers are required to run on the corresponding node
and how they are to be configured.
Hands on Kubernetes
● The master node runs several Kubernetes components.
● Together, these make all control decisions about which
container needs to be started on which node and how it
should be configured.
● In addition, the master and agent may interact with a
cloud provider and manage additional cloud resources
such as load balancers, persistent volumes, persistent
block storage, network configuration, and number of
instances.
Hands on Kubernetes
● The master can be a single instance running Kubernetes
components or a set of instances to ensure high
availability.
● A master can also serve (in certain configurations) as a
node to run containers, although this is not
recommended for production.
★ Don’t run heavy duty databases in Kubernetes
★ Choose wisely your load balancer.
Minikube
Download the kubectl command-line tool:
● Linux (amd64):
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s
https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linu
x/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
● OSX (amd64):
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s
https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/dar
win/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
● Verify that kubectl is installed and working:
$ kubectl version
Minikube
Use native virtualization, or install VirtualBox
Download minikube and add it to your $PATH
● Linux:
curl -Lo minikube
https://storage.googleapis.com/minikube/releases/v0.17.1/minikube-linux-amd
64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
● OS X:
curl -Lo minikube
https://storage.googleapis.com/minikube/releases/v0.17.1/minikube-darwin-a
md64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
● Run a basic test of the system:
$ minikube start
$ kubectl get nodes
Minikube
Clean up your minikube environment
Stop the current minikube VM:
$ minikube stop
Delete the VM:
$ minikube delete
Hands on Kubernetes
$ kubectl config use-context minikube #Use multiple kubernetes clusters.
$ kubectl config get-contexts #Check the contexts
$ kubectl config set-context your_cluster_address #set kubi cluster
$ kubectl get secrets #get secrets
$ kubectl run -i --tty ubuntu --image=ubuntu:16.04 --restart=Never #start
container
$ kubectl get pod python-worker --watch #see the container
$ kubectl exec -it python-worker -- /bin/bash #login to this container
Helm
Helm
$ helm init #install tiller to kubi cluster
$ helm init --upgrade #upgrade helm
$ helm search #search charts
$ helm repo update #update chart repos
$ helm install stable/spark #install chart
Hands on Kubernetes
Q: If Pods are ephemeral how can I persist my container data across container
restarts?
A: Kubernetes supports the concept of Volumes so you can use a Volume type
that is persistent.
Q: Do I create Pods manually, what if I want to create a few copies of the same
container do I have to create each one individually?
A: Replication Controller to rollout multiple copies using a Pod template
Q: If Pods are ephemeral and their IP address might change if they get restarted
how can I reliability reference my backend container from a frontend container?
A: Use a Service
Soru, cevap
● http://www.dummies.com/programming/networking/basics-of-network-virtualization/
● https://12factor.net/
● https://medium.com/jeroen-rosenberg/from-monolith-to-microservice-architecture-on-kubernetes-part-1-the-api-gateway-eb82f8c2d10c
● https://daemonza.github.io/2017/02/20/using-helm-to-deploy-to-kubernetes/
● https://dzone.com/articles/microservices-with-kubernetes-and-docker
● https://medium.com/jeroen-rosenberg/from-monolith-to-microservice-architecture-on-kubernetes-part-1-the-api-gateway-eb82f8c2d10c
● https://techbeacon.com/one-year-using-kubernetes-production-lessons-learned
● https://github.com/wsargent/docker-cheat-sheet#dockerfile
● http://blog.kubernetes.io/2015/06/the-distributed-system-toolkit-patterns.html
● http://blog.flux7.com/blogs/docker/docker-tutorial-series-part-3-automation-is-the-word-using-dockerfile
● https://developers.google.com/apis-explorer/#search/compute/clouduseraccounts/alpha/
● https://console.cloud.google.com/cloud-resource-manager
● https://alpinelinux.org/downloads/
● http://phusion.github.io/baseimage-docker/
● https://www.slideshare.net/randybias/the-history-of-pets-vs-cattle-and-using-it-properly
● http://cloudscaling.com/blog/cloud-computing/the-history-of-pets-vs-cattle/
● https://www.discogs.com/Captain-Hook-And-His-Crew-Ship-Ahoy/release/5674030
● http://thesecretlivesofdata.com/raft/
● http://www.yamllint.com/
● http://static.brandonpotter.com/kubernetes/DeploymentBuilder.html
● http://omerio.com/2015/12/18/learn-the-kubernetes-key-concepts-in-10-minutes/
● https://youtu.be/9Wzw84Q-8yc
● https://kubernetes.io/docs/user-guide/kubectl-cheatsheet/
● https://cloud.google.com/solutions/automated-build-images-with-jenkins-kubernetes
● https://cloud.google.com/container-builder/docs/quickstart-docker
● https://www.youtube.com/watch?v=xhwNywVYBk4
● https://github.com/bitnami/charts
Resources
Resources
● http://yaml.org/
● https://github.com/JuggleClouds/Cloud-practice/tree/master/k8s-helm-exampleapp
● https://kubernetes.io/docs/tasks/configure-pod-container/configmap/
● https://deis.com/blog/2016/getting-started-authoring-helm-charts/
● https://docs.helm.sh/using_helm/#quickstart
● https://docs.helm.sh/using_helm/#installing-helm
● https://cloud.google.com/compute/docs/disks/add-persistent-disk#formatting
● https://kubernetes.io/docs/tasks/configure-pod-container/configure-volume-storage/
● https://kubernetes.io/docs/concepts/storage/volumes/#background
●

Weitere ähnliche Inhalte

Was ist angesagt?

Are you ready to be edgy? Bringing applications to the edge of the network
Are you ready to be edgy? Bringing applications to the edge of the networkAre you ready to be edgy? Bringing applications to the edge of the network
Are you ready to be edgy? Bringing applications to the edge of the network
Megan O'Keefe
 

Was ist angesagt? (20)

Kubernetes: https://youtu.be/KnjnQj-FvfQ
Kubernetes: https://youtu.be/KnjnQj-FvfQKubernetes: https://youtu.be/KnjnQj-FvfQ
Kubernetes: https://youtu.be/KnjnQj-FvfQ
 
Nugwc k8s session-16-march-2021
Nugwc k8s session-16-march-2021Nugwc k8s session-16-march-2021
Nugwc k8s session-16-march-2021
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Why kubernetes for Serverless (FaaS)
Why kubernetes for Serverless (FaaS)Why kubernetes for Serverless (FaaS)
Why kubernetes for Serverless (FaaS)
 
Mesos and Kubernetes ecosystem overview
Mesos and Kubernetes ecosystem overviewMesos and Kubernetes ecosystem overview
Mesos and Kubernetes ecosystem overview
 
Deploying your first application with Kubernetes
Deploying your first application with KubernetesDeploying your first application with Kubernetes
Deploying your first application with Kubernetes
 
Kubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory GuideKubernetes for Beginners: An Introductory Guide
Kubernetes for Beginners: An Introductory Guide
 
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
 
Kubernetes Requests and Limits
Kubernetes Requests and LimitsKubernetes Requests and Limits
Kubernetes Requests and Limits
 
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
 
LISA2017 Kubernetes: Hit the Ground Running
LISA2017 Kubernetes: Hit the Ground RunningLISA2017 Kubernetes: Hit the Ground Running
LISA2017 Kubernetes: Hit the Ground Running
 
Musings on Mesos: Docker, Kubernetes, and Beyond.
Musings on Mesos: Docker, Kubernetes, and Beyond.Musings on Mesos: Docker, Kubernetes, and Beyond.
Musings on Mesos: Docker, Kubernetes, and Beyond.
 
DevJam 2019 - Introduction to Kubernetes
DevJam 2019 - Introduction to KubernetesDevJam 2019 - Introduction to Kubernetes
DevJam 2019 - Introduction to Kubernetes
 
Getting started with google kubernetes engine
Getting started with google kubernetes engineGetting started with google kubernetes engine
Getting started with google kubernetes engine
 
Kubernetes - A Short Ride Throught the project and its ecosystem
Kubernetes - A Short Ride Throught the project and its ecosystemKubernetes - A Short Ride Throught the project and its ecosystem
Kubernetes - A Short Ride Throught the project and its ecosystem
 
Kubecon seattle 2018 recap - Application Deployment aspects
Kubecon seattle 2018 recap - Application Deployment aspectsKubecon seattle 2018 recap - Application Deployment aspects
Kubecon seattle 2018 recap - Application Deployment aspects
 
OpenStack Icehouse Overview
OpenStack Icehouse OverviewOpenStack Icehouse Overview
OpenStack Icehouse Overview
 
Cloud Native Applications on Kubernetes: a DevOps Approach
Cloud Native Applications on Kubernetes: a DevOps ApproachCloud Native Applications on Kubernetes: a DevOps Approach
Cloud Native Applications on Kubernetes: a DevOps Approach
 
Are you ready to be edgy? Bringing applications to the edge of the network
Are you ready to be edgy? Bringing applications to the edge of the networkAre you ready to be edgy? Bringing applications to the edge of the network
Are you ready to be edgy? Bringing applications to the edge of the network
 
HA Kubernetes on Mesos / Marathon
HA Kubernetes on Mesos / MarathonHA Kubernetes on Mesos / Marathon
HA Kubernetes on Mesos / Marathon
 

Ähnlich wie Gdg izmir kubernetes

aks_training_document_Azure_kuberne.pptx
aks_training_document_Azure_kuberne.pptxaks_training_document_Azure_kuberne.pptx
aks_training_document_Azure_kuberne.pptx
WaseemShare
 

Ähnlich wie Gdg izmir kubernetes (20)

Kubernetes overview and Exploitation
Kubernetes overview and ExploitationKubernetes overview and Exploitation
Kubernetes overview and Exploitation
 
Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...
Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...
Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...
 
Container Orchestration using kubernetes
Container Orchestration using kubernetesContainer Orchestration using kubernetes
Container Orchestration using kubernetes
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
 
Kubernetes presentation
Kubernetes presentationKubernetes presentation
Kubernetes presentation
 
Kubernetes-introduction to kubernetes for beginers.pptx
Kubernetes-introduction to kubernetes for beginers.pptxKubernetes-introduction to kubernetes for beginers.pptx
Kubernetes-introduction to kubernetes for beginers.pptx
 
Intro to Kubernetes
Intro to KubernetesIntro to Kubernetes
Intro to Kubernetes
 
Kubernetes 101 for Beginners
Kubernetes 101 for BeginnersKubernetes 101 for Beginners
Kubernetes 101 for Beginners
 
Kubernetes From Scratch .pdf
Kubernetes From Scratch .pdfKubernetes From Scratch .pdf
Kubernetes From Scratch .pdf
 
01. Kubernetes-PPT.pptx
01. Kubernetes-PPT.pptx01. Kubernetes-PPT.pptx
01. Kubernetes-PPT.pptx
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Kubernetes and CoreOS @ Athens Docker meetup
Kubernetes and CoreOS @ Athens Docker meetupKubernetes and CoreOS @ Athens Docker meetup
Kubernetes and CoreOS @ Athens Docker meetup
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
 
Container Orchestration with Docker Swarm and Kubernetes
Container Orchestration with Docker Swarm and KubernetesContainer Orchestration with Docker Swarm and Kubernetes
Container Orchestration with Docker Swarm and Kubernetes
 
Kubernetes Immersion
Kubernetes ImmersionKubernetes Immersion
Kubernetes Immersion
 
CNCF Rajkot group- Know the magic of kubernetes with AWS EKS
CNCF Rajkot group- Know the magic of kubernetes with AWS EKSCNCF Rajkot group- Know the magic of kubernetes with AWS EKS
CNCF Rajkot group- Know the magic of kubernetes with AWS EKS
 
KubernetesPPT.pptx
KubernetesPPT.pptxKubernetesPPT.pptx
KubernetesPPT.pptx
 
aks_training_document_Azure_kuberne.pptx
aks_training_document_Azure_kuberne.pptxaks_training_document_Azure_kuberne.pptx
aks_training_document_Azure_kuberne.pptx
 
(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview
 

Mehr von Gokhan Boranalp

Mehr von Gokhan Boranalp (15)

Zkernel
ZkernelZkernel
Zkernel
 
Zetaops ZOPS presentation
Zetaops ZOPS presentationZetaops ZOPS presentation
Zetaops ZOPS presentation
 
Zops intelligent platform
Zops intelligent platformZops intelligent platform
Zops intelligent platform
 
Siz değil iş sizi nasıl bulur? GDG İzmir
Siz değil iş sizi nasıl bulur? GDG İzmir Siz değil iş sizi nasıl bulur? GDG İzmir
Siz değil iş sizi nasıl bulur? GDG İzmir
 
Kak depolama stratejiniz nasıl olmalı?
Kak depolama stratejiniz nasıl olmalı?Kak depolama stratejiniz nasıl olmalı?
Kak depolama stratejiniz nasıl olmalı?
 
Açık kaynak iş modeli nedir?
Açık kaynak iş modeli nedir?Açık kaynak iş modeli nedir?
Açık kaynak iş modeli nedir?
 
Buluta Ilk Adım Analizi
Buluta Ilk Adım AnaliziBuluta Ilk Adım Analizi
Buluta Ilk Adım Analizi
 
Acik Kaynak Kodlu Kurumsal Eposta Sistemleri
Acik Kaynak Kodlu Kurumsal Eposta SistemleriAcik Kaynak Kodlu Kurumsal Eposta Sistemleri
Acik Kaynak Kodlu Kurumsal Eposta Sistemleri
 
Kurumlar icin openstack rehberi
Kurumlar icin openstack rehberi Kurumlar icin openstack rehberi
Kurumlar icin openstack rehberi
 
Riak ve RiakCS
Riak ve RiakCSRiak ve RiakCS
Riak ve RiakCS
 
erlang 101
erlang 101erlang 101
erlang 101
 
Git 101
Git 101Git 101
Git 101
 
Scrum ve Redmine ile yazılım projesi yönetimi
Scrum ve Redmine ile yazılım projesi yönetimiScrum ve Redmine ile yazılım projesi yönetimi
Scrum ve Redmine ile yazılım projesi yönetimi
 
Nosql veritabanlari
Nosql veritabanlariNosql veritabanlari
Nosql veritabanlari
 
Erlang web-frameworks
Erlang web-frameworksErlang web-frameworks
Erlang web-frameworks
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Kürzlich hochgeladen (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Gdg izmir kubernetes

  • 1. Google Cloud Platform Kubernetes Workshop www.zetaops.io Simplicity is the ultimate sophistication Leonardo da Vinci“ “
  • 3. Sanallaştırma Temelleri - Types ● Full virtualization: running an unmodified OS, Parallels, VirtualBox, XEN ● Paravirtualization: running a modified guest system (kernel), XEN, QEMU, KVM ● OS-level virtualization: enables running an isolated process (tree), OpenVZ, LXC, BSD-jails, Linux-VServer, Solaris Zones ● Virtualized Containers, LXC, LXD, Docker
  • 4. Sanallaştırma Temelleri ● Sanal makinalar stateful ● Büyük VM’ler: Depolama VM içinde, tüm servisler aynı VM içinde, kocaman vCPU ve vRAM ● Uygulama SLA kuralları VM hayatta kalsın diye var. ● Dağıtıklık ve fail durumu için eldeki HA teknolojisine bağlı ● VM’ler kurulumdan sonra CPU ve RAM bakımından ölçeklenebilir. ● Uygulamalar VM’in crash olması durumuna göre geliştirilmemiştir. ● Örnek: Aynı VM üzerinde, database, web server, frontend app birlikte çalışıyor. ● Uygulamalar dağıtık olmak üzere tasarlanmıştır. VM’ler stateless haldedir. ● VM’ler küçüktür. ● Uygulama SLA kuralları tüm uygulama içindir. Bir VM için değil. ● Uygulama çok sayıda instance üzerinde çalışmaktadır. ● Uygulamanın ölçeklendirilmesi için anlık olarak VM eklenebilir. ● Uygulamalar VM’lerin fail olması durumuna göre geliştirilmiştir. PETS CATTLE
  • 20. Hands on Kubernetes Master: Kubernetes control panel or control plane. This is where decisions are made about the cluster, such as scheduling, and detecting/responding to cluster events. The components of the master can be run on any node in the cluster. Key components of the master:
  • 21. API Server — This is the only component of the Kubernetes control panel with a user-accessible API and the sole master component that you’ll interact with. The API server exposes a restful Kubernetes API and consumes JSON manifest files. Cluster State&Data Store — Kubernetes uses “etcd.” This is a strong consistent, and highly-available key value store that Kubernetes uses for persistent storage of all API objects. Think of it as the “source of truth” for the cluster. Hands on Kubernetes
  • 22. Hands on Kubernetes Controller Manager — Known as the “kube-controller manager,” this runs all the controllers that handle routine tasks in the cluster. These include the Node Controller, Replication Controller, Endpoints Controller, and Service Account and Token Controllers. Each of these controllers works separately to maintain the desired state.
  • 23. Hands on Kubernetes Scheduler — The scheduler watches for newly-created pods (groups of one or more containers) and assigns them to nodes. Dashboard (optional) — Kubernetes web UI that simplifies the Kubernetes cluster user’s interactions with the API server.
  • 24. Kubernetes Worker Nodes Master handles and manages the cluster, worker nodes run the containers and provide the Kubernetes runtime environment. Worker nodes comprise a kubelet. This is the primary node agent. It watches the API server for pods that have been assigned to its node. Kubelet carries out tasks and maintains a reporting backchannel of pod status to the master node. Hands on Kubernetes
  • 25. Hands on Kubernetes Inside each pod there are containers, kubelet runs these via Docker (pulling images, starting and stopping containers, etc.). It also periodically executes any requested container liveness probes. In addition to Docker, RKT is also supported and the community is actively working to support OCI. Another component of worker nodes is kube-proxy. This is the network brain of the node, maintaining network rules on the host and performing connection forwarding. It’s also responsible for load balancing across all pods in the service.
  • 26. Kubernetes Pods A pod is a group of one or more containers (such as Docker containers), with shared storage/network. Each pod contains specific information on how the containers should be run. Think of pods as a ring-fenced environment to run containers. Pods are also a unit for scaling. If you need to scale an app component up or down, this can be achieved by adding or removing pods. Hands on Kubernetes
  • 27. Hands on Kubernetes It’s possible to run more than one container in a pod (where each share the same IP address and mounted volumes), if they’re tightly coupled. Pods are deployed on a single node and have a definite lifecycle. They can be pending, running, succeeding, or failing, but once gone, they are never brought back to life. If a pod dies, a replication controller or other controller must be used to create a new one.
  • 28. Pods — A description of a set of containers that need to run together. Services — An object that describes a set of pods that provide a useful service. Services are typically used to define clusters of uniform pods. Persistent Volumes — A Kubernetes abstraction for persistent storage. Kubernetes supports many types of volumes, such as NFS, Ceph, GlusterFS, local directory, etc. Hands on Kubernetes
  • 29. Namespaces — This is a tool used to group, separate, and isolate groups of objects. Namespaces are used for access control, network access control, resource management, and quoting. Ingress rules — These specify how incoming network traffic should be routed to services and pods. Network policies — This defines the network access rules between pods inside the cluster. Hands on Kubernetes
  • 30. ConfigMaps and Secrets — Used to separate configuration information from application definition. Controllers — These implement different policies for automatic pod management. There are three main types: 1. Deployment — Responsible for maintaining a set of running pods of the same type. 2. DaemonSet — Runs a specific type of pod on each node based on a condition. 3. StatefulSet — Used when several pods of the same type are needed to run in parallel, but each of the pods is required to have a specific identity. Hands on Kubernetes
  • 31. Hands on Kubernetes ● Kubernetes simultaneously runs and controls a set of nodes on virtual or physical machines. ● This is achieved by running agents on each node. ● The agent talks to the master via the same API used to send the blueprint to Kubernetes. ● The agent registers itself in the master, providing Kubernetes with information about the nodes. ● Reading through the API, the agent determines which containers are required to run on the corresponding node and how they are to be configured.
  • 32. Hands on Kubernetes ● The master node runs several Kubernetes components. ● Together, these make all control decisions about which container needs to be started on which node and how it should be configured. ● In addition, the master and agent may interact with a cloud provider and manage additional cloud resources such as load balancers, persistent volumes, persistent block storage, network configuration, and number of instances.
  • 33. Hands on Kubernetes ● The master can be a single instance running Kubernetes components or a set of instances to ensure high availability. ● A master can also serve (in certain configurations) as a node to run containers, although this is not recommended for production. ★ Don’t run heavy duty databases in Kubernetes ★ Choose wisely your load balancer.
  • 34. Minikube Download the kubectl command-line tool: ● Linux (amd64): curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linu x/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/ ● OSX (amd64): curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/dar win/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/ ● Verify that kubectl is installed and working: $ kubectl version
  • 35. Minikube Use native virtualization, or install VirtualBox Download minikube and add it to your $PATH ● Linux: curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.17.1/minikube-linux-amd 64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ ● OS X: curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.17.1/minikube-darwin-a md64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ ● Run a basic test of the system: $ minikube start $ kubectl get nodes
  • 36. Minikube Clean up your minikube environment Stop the current minikube VM: $ minikube stop Delete the VM: $ minikube delete
  • 37. Hands on Kubernetes $ kubectl config use-context minikube #Use multiple kubernetes clusters. $ kubectl config get-contexts #Check the contexts $ kubectl config set-context your_cluster_address #set kubi cluster $ kubectl get secrets #get secrets $ kubectl run -i --tty ubuntu --image=ubuntu:16.04 --restart=Never #start container $ kubectl get pod python-worker --watch #see the container $ kubectl exec -it python-worker -- /bin/bash #login to this container
  • 38. Helm
  • 39. Helm $ helm init #install tiller to kubi cluster $ helm init --upgrade #upgrade helm $ helm search #search charts $ helm repo update #update chart repos $ helm install stable/spark #install chart
  • 40. Hands on Kubernetes Q: If Pods are ephemeral how can I persist my container data across container restarts? A: Kubernetes supports the concept of Volumes so you can use a Volume type that is persistent. Q: Do I create Pods manually, what if I want to create a few copies of the same container do I have to create each one individually? A: Replication Controller to rollout multiple copies using a Pod template Q: If Pods are ephemeral and their IP address might change if they get restarted how can I reliability reference my backend container from a frontend container? A: Use a Service
  • 42. ● http://www.dummies.com/programming/networking/basics-of-network-virtualization/ ● https://12factor.net/ ● https://medium.com/jeroen-rosenberg/from-monolith-to-microservice-architecture-on-kubernetes-part-1-the-api-gateway-eb82f8c2d10c ● https://daemonza.github.io/2017/02/20/using-helm-to-deploy-to-kubernetes/ ● https://dzone.com/articles/microservices-with-kubernetes-and-docker ● https://medium.com/jeroen-rosenberg/from-monolith-to-microservice-architecture-on-kubernetes-part-1-the-api-gateway-eb82f8c2d10c ● https://techbeacon.com/one-year-using-kubernetes-production-lessons-learned ● https://github.com/wsargent/docker-cheat-sheet#dockerfile ● http://blog.kubernetes.io/2015/06/the-distributed-system-toolkit-patterns.html ● http://blog.flux7.com/blogs/docker/docker-tutorial-series-part-3-automation-is-the-word-using-dockerfile ● https://developers.google.com/apis-explorer/#search/compute/clouduseraccounts/alpha/ ● https://console.cloud.google.com/cloud-resource-manager ● https://alpinelinux.org/downloads/ ● http://phusion.github.io/baseimage-docker/ ● https://www.slideshare.net/randybias/the-history-of-pets-vs-cattle-and-using-it-properly ● http://cloudscaling.com/blog/cloud-computing/the-history-of-pets-vs-cattle/ ● https://www.discogs.com/Captain-Hook-And-His-Crew-Ship-Ahoy/release/5674030 ● http://thesecretlivesofdata.com/raft/ ● http://www.yamllint.com/ ● http://static.brandonpotter.com/kubernetes/DeploymentBuilder.html ● http://omerio.com/2015/12/18/learn-the-kubernetes-key-concepts-in-10-minutes/ ● https://youtu.be/9Wzw84Q-8yc ● https://kubernetes.io/docs/user-guide/kubectl-cheatsheet/ ● https://cloud.google.com/solutions/automated-build-images-with-jenkins-kubernetes ● https://cloud.google.com/container-builder/docs/quickstart-docker ● https://www.youtube.com/watch?v=xhwNywVYBk4 ● https://github.com/bitnami/charts Resources
  • 43. Resources ● http://yaml.org/ ● https://github.com/JuggleClouds/Cloud-practice/tree/master/k8s-helm-exampleapp ● https://kubernetes.io/docs/tasks/configure-pod-container/configmap/ ● https://deis.com/blog/2016/getting-started-authoring-helm-charts/ ● https://docs.helm.sh/using_helm/#quickstart ● https://docs.helm.sh/using_helm/#installing-helm ● https://cloud.google.com/compute/docs/disks/add-persistent-disk#formatting ● https://kubernetes.io/docs/tasks/configure-pod-container/configure-volume-storage/ ● https://kubernetes.io/docs/concepts/storage/volumes/#background ●