SlideShare une entreprise Scribd logo
1  sur  40
Télécharger pour lire hors ligne
KubernetesKubernetes
Sailing a Sea of ContainersSailing a Sea of Containers
Kel Cecil - @praisechaos
What is Kubernetes?What is Kubernetes?
Container Orchestration Toolset
Originated at Google (Borg)
Now a Cloud Native Computing Foundation project
Used in commercial and open source projects
Tectonic (CoreOS)
Meteor Galaxy (MeteorJS)
OpenShift 3 (Red Hat)
Kubernetes Scheduler for Deis (Engine Yard)
Why Kubernetes?Why Kubernetes?
Deploying one single container app is easy
Deploying a complex app is more difficult
One or more containers
Replicas of containers
Data volumes for persistent storage
Deploying lots of complex apps can be a challenge
FeaturesFeatures
Services for load balancing
Resource-based scheduling
Robust API
Great CLI tooling via kubectl
Container-spec agnostic
What does a simple Kubernetes cluster look like?
Master
Node Node Node
NodeNode
Physical or virtual machine on which containers can be
scheduled
What unit runs on the nodes?What unit runs on the nodes?
PodPod
A colocated set of application containers and shared data
volumes.
Smallest unit that can be scheduled.
Pod
container 1 container n
AWS EBS Volume GCE Volume
NFS Share Git Commit
Containers
Data Volumes
And more...
How can we organize podsHow can we organize pods
(or any other Kubernetes resource)?
LabelsLabels
Key-value pairs used to organize resources.
important-microservice
docker.io/kelcecil/app:latest
env=production
server=nginx
important-microservice
docker.io/kelcecil/app:feature
env=qa
server=nginx
Pods Nodes
172.17.8.102
hostname=172.17.8.102
rack=tatooine
172.17.8.103
hostname=172.17.8.103
rack=tatooine
172.17.8.104
hostname=172.17.8.104
rack=alderaan
Let's have replicas of pods...Let's have replicas of pods...
(There's a Kubernetes resource for that.)
Replication ControllerReplication Controller
Manages the lifecycle of pods by ensuring a desired
number of pods exist.
Replication Controller
replicas=2
selector: app=user-service
Pod
labels: app=user-service
Pod
labels: app=user-service
Pod
labels: app=user-service
How can we direct traffic to pods?How can we direct traffic to pods?
ServiceService
Provides a single, stable endpoint for a set of pods.
Very much like a round-robin load balancer
user-microservice
app=user-service
user-microservice
app=user-service
Client
Service
name: user-microservice
port: 31335
selector: app=user-service
Pods
What components make up Kubernetes?
Master
Node
kube-apiserver
kube-scheduler
kube-controller-manager
kubelet
kube-proxy
Master
kube-apiserver
Validates and sets data for resources
Services REST operations
Provides the interface from which
components interact
Master
kube-scheduler
Performs scheduling of pods
Considers many factors when deciding
where to schedule
Resource requirements
Data locality
Process affinity and anti-affinity
Master
kube-controller-manager
Watches the state of the cluster through the API
Makes changes to make actual state of pods
match the desired state of pods
Node
kubelet
Ensures that pod specifications are met on a
node
Performs garbage collection on containers
Ensures that containers are healthy
Node
kube-proxy
Network proxy that forwards traffic to proper
container
Configured using Kubernetes service
Can forward TCP and UDP steams or round-
robin TCP and UDP forwarding
important-microservice
app=user-service
important-microservice
app=user-service
Client
Service
name: user-microservice
port: 31335
selector: app=user-service
Pods
kube-proxy
DemonstrationDemonstration
Let's deploy something!Let's deploy something!
Thanks for coming!
Questions?
kelcecil@praisechaos.com
Email:
Twitter:
@praisechaos
Website:
http://kelcecil.com
If you see this and following slides during the
talk, then my demo was a bust. These slides
are plan B. Sorry about that.
If you're browsing my slides after the talk,
then this is what I demonstrated live.
https://github.com/pires/kubernetes-vagrant-coreos-cluster​
Follow along with this simple Kubernetes vagrant setup.
apiVersion: v1
kind: ReplicationController
# Metadata about the controller
metadata:
name: blog-controller
labels:
name: blog-controller
spec:
replicas: 2
# The labels of pods to be monitored
selector:
name: blog-pod
# Template newly created pods follow
template:
metadata:
# Match the controller selector at minimum
labels:
name: blog-pod
spec:
containers:
- name: blog-container
image: quay.io/kelcecil/kelcecil-com:latest
# containerPort is port in use inside container
ports:
- containerPort: 80
Create a new replication controller
blog.yaml
Create a new replication controller (2/2)
# Set your KUBERNETES_MASTER to your API Server
# Alternatively, use the -s flag with kubectl
export KUBERNETES_MASTER="http://127.0.0.1:8080"
kubectl create -f blog.yaml
In your terminal...
Get a list of replication controllers and pods
kelcecil@Kels-MBP ~/c/kube-talk> kubectl get rc
CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLIC
blog-controller blog-container quay.io/kelcecil/kelcecil-com:latest name=blog-pod 2
kelcecil@Kels-MBP ~/c/kube-talk> kubectl get pods
NAME READY STATUS RESTARTS AGE
blog-controller-0g7ng 1/1 Running 0 1m
blog-controller-a6729 1/1 Running 0 1m
# You can use kubectl get with any Kubernetes resource
# kubectl get <resource>
# kubectl get nodes
# kubectl get services
kelcecil@Kels-MBP ~/c/kube-talk> kubectl describe pod blog-controller-0g7ng
Name: blog-controller-0g7ng
Namespace: default
Image(s): quay.io/kelcecil/kelcecil-com:latest
Node: 172.17.8.102/172.17.8.102
Labels: name=blog-pod
Status: Running
Reason:
Message:
IP: 10.244.35.4
Replication Controllers: blog-controller (2/2 replicas created)
Containers:
blog-container:
Image: quay.io/kelcecil/kelcecil-com:latest
State: Running
Started: Tue, 29 Sep 2015 20:44:37 -0400
Ready: True
Restart Count: 0
......
......
......
Get information about a particular pod
kubectl describe also works for any Kubernetes resource
kelcecil@Kels-MBP ~/c/kube-talk> kubectl describe node 172.17.8.102
Name: 172.17.8.102
Labels: kubernetes.io/hostname=172.17.8.102
CreationTimestamp: Sun, 13 Sep 2015 15:53:52 -0400
Conditions:
Type Status LastHeartbeatTime LastTransitionTime
Ready True Sun, 13 Sep 2015 16:55:16 -0400 Sun, 13 Sep 2015 15:53:52 -0400
Addresses: 172.17.8.102
Capacity:
memory: 2053532Ki
pods: 40
cpu: 1
Version:
Kernel Version: 4.1.6-coreos-r2
OS Image: CoreOS 801.0.0
Container Runtime Version: docker://1.8.1
Kubelet Version: v1.0.3
Kube-Proxy Version: v1.0.3
ExternalID: 172.17.8.102
Pods: (1 in total)
Namespace Name
default blog-lmj3c
No events.
Get system information about a node
kelcecil@Kels-MBP ~/c/kube-talk> kubectl get nodes
NAME LABELS STATUS
172.17.8.102 kubernetes.io/hostname=172.17.8.102 Ready
172.17.8.103 kubernetes.io/hostname=172.17.8.103 Ready
Create a label
kelcecil@Kels-MBP ~/c/kube-talk> kubectl label node 172.17.8.102 region=us-east-1
NAME LABELS STATUS
172.17.8.102 kubernetes.io/hostname=172.17.8.102,region=us-east-1 Ready
kelcecil@Kels-MBP ~/c/kube-talk> kubectl get nodes
NAME LABELS STATUS
172.17.8.102 kubernetes.io/hostname=172.17.8.102,region=us-east-1 Ready
172.17.8.103 kubernetes.io/hostname=172.17.8.103 Ready
kelcecil@Kels-MBP ~/c/kube-talk> kubectl get -l region=us-east-1 nodes
NAME LABELS STATUS
172.17.8.102 kubernetes.io/hostname=172.17.8.102,region=us-east-1 Ready
Filter resources by label
Remove a label
kelcecil@Kels-MBP ~/c/kube-talk> kubectl label node 172.17.8.102 region-
NAME LABELS STATUS
172.17.8.102 kubernetes.io/hostname=172.17.8.102 Ready
Scale a Replication Controller to 3 Replicas
kelcecil@Kels-MBP ~/c/kube-talk> kubectl get pods
NAME READY STATUS RESTARTS AGE
blog-controller-0g7ng 1/1 Running 0 3m
blog-controller-a6729 1/1 Running 0 3m
kelcecil@Kels-MBP ~/c/kube-talk> kubectl scale --replicas=3 rc blog-controller
scaled
kelcecil@Kels-MBP ~/c/kube-talk> kubectl get pods
NAME READY STATUS RESTARTS AGE
blog-controller-0g7ng 1/1 Running 0 3m
blog-controller-a6729 1/1 Running 0 3m
blog-controller-sems7 1/1 Running 0 18s
Get logs from a pod
> kubectl logs blog-controller-0g7ng
2015/09/14 03:07:32 [notice] 12#0: using the "epoll" event method
2015/09/14 03:07:32 [notice] 12#0: nginx/1.8.0
2015/09/14 03:07:32 [notice] 12#0: OS: Linux 4.1.6-coreos-r2
2015/09/14 03:07:32 [notice] 12#0: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2015/09/14 03:07:32 [notice] 12#0: start worker processes
2015/09/14 03:07:32 [notice] 12#0: start worker process 13
Executing a command inside a pod/container
> kubectl exec blog-controller-0g7ng "ps"
PID USER TIME COMMAND
1 root 0:00 /bin/sh -c nginx
12 root 0:00 nginx: master process nginx
13 nginx 0:00 nginx: worker process
82 root 0:00 ps
Interact with a shell inside a container
> kubectl exec -it blog-controller-0g7ng "sh"
/ # ps ax
PID USER TIME COMMAND
1 root 0:00 /bin/sh -c nginx
12 root 0:00 nginx: master process nginx
13 nginx 0:00 nginx: worker process
98 root 0:00 sh
103 root 0:00 ps ax
/ # exit
apiVersion: v1
kind: Service
# Metadata about the service
metadata:
name: blog-service
labels:
name: blog-service
spec:
# Open a port on nodes using kube-proxy
type: NodePort
ports:
# the port the container serves on
- port: 80
# Match the labels for pods to be served
selector:
name: blog-pod
Create a new service
blog-service.yaml
# Set your KUBERNETES_MASTER to your API Server
export KUBERNETES_MASTER="http://127.0.0.1:8080"
kubectl create -f blog-service.yaml
In your terminal...
Perform a rolling update on a container
> kubectl rolling-update --image=quay.io/kelcecil/kelcecil-com:talks blog-controller
Creating blog-controller-676be42f24a573bf0ee7733377bd5ea8
At beginning of loop: blog-controller replicas: 1, blog-controller-676be42f24a573bf0ee7733377bd5ea
Updating blog-controller replicas: 1, blog-controller-676be42f24a573bf0ee7733377bd5ea8 replicas: 1
At end of loop: blog-controller replicas: 1, blog-controller-676be42f24a573bf0ee7733377bd5ea8 repl
At beginning of loop: blog-controller replicas: 0, blog-controller-676be42f24a573bf0ee7733377bd5ea
Updating blog-controller replicas: 0, blog-controller-676be42f24a573bf0ee7733377bd5ea8 replicas: 2
At end of loop: blog-controller replicas: 0, blog-controller-676be42f24a573bf0ee7733377bd5ea8 repl
Update succeeded. Deleting old controller: blog-controller
Renaming blog-controller-676be42f24a573bf0ee7733377bd5ea8 to blog-controller
blog-controller

Contenu connexe

Tendances

DockerCon EU 2015: The Latest in Docker Engine
DockerCon EU 2015: The Latest in Docker EngineDockerCon EU 2015: The Latest in Docker Engine
DockerCon EU 2015: The Latest in Docker EngineDocker, Inc.
 
A brief study on Kubernetes and its components
A brief study on Kubernetes and its componentsA brief study on Kubernetes and its components
A brief study on Kubernetes and its componentsRamit Surana
 
Scaling Docker with Kubernetes
Scaling Docker with KubernetesScaling Docker with Kubernetes
Scaling Docker with KubernetesCarlos Sanchez
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windowsDocker, Inc.
 
Secrets in Kubernetes
Secrets in KubernetesSecrets in Kubernetes
Secrets in KubernetesJerry Jalava
 
Package your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and KubernetesPackage your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and KubernetesArun Gupta
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionStefan Schimanski
 
Zero downtime-java-deployments-with-docker-and-kubernetes
Zero downtime-java-deployments-with-docker-and-kubernetesZero downtime-java-deployments-with-docker-and-kubernetes
Zero downtime-java-deployments-with-docker-and-kubernetesArjan Schaaf
 
Docker container basics and efficiency of Kubernetes
Docker container basics and efficiency of KubernetesDocker container basics and efficiency of Kubernetes
Docker container basics and efficiency of KubernetesAkhter Al Amin
 
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...Brian Grant
 
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...Windows Server and Docker - The Internals Behind Bringing Docker and Containe...
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...Docker, Inc.
 
Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1Hao H. Zhang
 
Highly Available Persistent Applications in Containers by Kendrick Coleman, E...
Highly Available Persistent Applications in Containers by Kendrick Coleman, E...Highly Available Persistent Applications in Containers by Kendrick Coleman, E...
Highly Available Persistent Applications in Containers by Kendrick Coleman, E...Docker, Inc.
 
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart Docker, Inc.
 
What's new in Kubernetes
What's new in KubernetesWhat's new in Kubernetes
What's new in KubernetesDaniel Smith
 
Building Clustered Applications with Kubernetes and Docker
Building Clustered Applications with Kubernetes and DockerBuilding Clustered Applications with Kubernetes and Docker
Building Clustered Applications with Kubernetes and DockerSteve Watt
 
Cloning Running Servers with Docker and CRIU by Ross Boucher
Cloning Running Servers with Docker and CRIU by Ross BoucherCloning Running Servers with Docker and CRIU by Ross Boucher
Cloning Running Servers with Docker and CRIU by Ross BoucherDocker, Inc.
 
Kubernetes Architecture - beyond a black box - Part 2
Kubernetes Architecture - beyond a black box - Part 2Kubernetes Architecture - beyond a black box - Part 2
Kubernetes Architecture - beyond a black box - Part 2Hao H. Zhang
 
Docker and Microsoft - Windows Server 2016 Technical Deep Dive
Docker and Microsoft - Windows Server 2016 Technical Deep DiveDocker and Microsoft - Windows Server 2016 Technical Deep Dive
Docker and Microsoft - Windows Server 2016 Technical Deep DiveDocker, Inc.
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerAditya Konarde
 

Tendances (20)

DockerCon EU 2015: The Latest in Docker Engine
DockerCon EU 2015: The Latest in Docker EngineDockerCon EU 2015: The Latest in Docker Engine
DockerCon EU 2015: The Latest in Docker Engine
 
A brief study on Kubernetes and its components
A brief study on Kubernetes and its componentsA brief study on Kubernetes and its components
A brief study on Kubernetes and its components
 
Scaling Docker with Kubernetes
Scaling Docker with KubernetesScaling Docker with Kubernetes
Scaling Docker with Kubernetes
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windows
 
Secrets in Kubernetes
Secrets in KubernetesSecrets in Kubernetes
Secrets in Kubernetes
 
Package your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and KubernetesPackage your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and Kubernetes
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and Introduction
 
Zero downtime-java-deployments-with-docker-and-kubernetes
Zero downtime-java-deployments-with-docker-and-kubernetesZero downtime-java-deployments-with-docker-and-kubernetes
Zero downtime-java-deployments-with-docker-and-kubernetes
 
Docker container basics and efficiency of Kubernetes
Docker container basics and efficiency of KubernetesDocker container basics and efficiency of Kubernetes
Docker container basics and efficiency of Kubernetes
 
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
 
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...Windows Server and Docker - The Internals Behind Bringing Docker and Containe...
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...
 
Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1Kubernetes Architecture - beyond a black box - Part 1
Kubernetes Architecture - beyond a black box - Part 1
 
Highly Available Persistent Applications in Containers by Kendrick Coleman, E...
Highly Available Persistent Applications in Containers by Kendrick Coleman, E...Highly Available Persistent Applications in Containers by Kendrick Coleman, E...
Highly Available Persistent Applications in Containers by Kendrick Coleman, E...
 
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
 
What's new in Kubernetes
What's new in KubernetesWhat's new in Kubernetes
What's new in Kubernetes
 
Building Clustered Applications with Kubernetes and Docker
Building Clustered Applications with Kubernetes and DockerBuilding Clustered Applications with Kubernetes and Docker
Building Clustered Applications with Kubernetes and Docker
 
Cloning Running Servers with Docker and CRIU by Ross Boucher
Cloning Running Servers with Docker and CRIU by Ross BoucherCloning Running Servers with Docker and CRIU by Ross Boucher
Cloning Running Servers with Docker and CRIU by Ross Boucher
 
Kubernetes Architecture - beyond a black box - Part 2
Kubernetes Architecture - beyond a black box - Part 2Kubernetes Architecture - beyond a black box - Part 2
Kubernetes Architecture - beyond a black box - Part 2
 
Docker and Microsoft - Windows Server 2016 Technical Deep Dive
Docker and Microsoft - Windows Server 2016 Technical Deep DiveDocker and Microsoft - Windows Server 2016 Technical Deep Dive
Docker and Microsoft - Windows Server 2016 Technical Deep Dive
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 

Similaire à Kubernetes - Sailing a Sea of Containers

Learn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLearn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLarry Cai
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Ryan Jarvinen
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibilityDocker, Inc.
 
Lifecycle of a pod
Lifecycle of a podLifecycle of a pod
Lifecycle of a podHarshal Shah
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingPiotr Perzyna
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)HungWei Chiu
 
Social Connections 14 - Kubernetes Basics for Connections Admins
Social Connections 14 - Kubernetes Basics for Connections AdminsSocial Connections 14 - Kubernetes Basics for Connections Admins
Social Connections 14 - Kubernetes Basics for Connections Adminspanagenda
 
Kubernetes Basics for Connections Admins
Kubernetes Basics for Connections AdminsKubernetes Basics for Connections Admins
Kubernetes Basics for Connections AdminsLetsConnect
 
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...Codemotion
 
OSS Japan 2019 service mesh bridging Kubernetes and legacy
OSS Japan 2019 service mesh bridging Kubernetes and legacyOSS Japan 2019 service mesh bridging Kubernetes and legacy
OSS Japan 2019 service mesh bridging Kubernetes and legacySteve Wong
 
Using kubernetes to lose your fear of using containers
Using kubernetes to lose your fear of using containersUsing kubernetes to lose your fear of using containers
Using kubernetes to lose your fear of using containersjosfuecas
 
Kubernetes Architecture with Components
 Kubernetes Architecture with Components Kubernetes Architecture with Components
Kubernetes Architecture with ComponentsAjeet Singh
 
Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple Wojciech Barczyński
 
Data weekender deploying prod grade sql 2019 big data clusters
Data weekender deploying prod grade sql 2019 big data clustersData weekender deploying prod grade sql 2019 big data clusters
Data weekender deploying prod grade sql 2019 big data clustersChris Adkin
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes IntroductionEric Gustafson
 
DCEU 18: Docker Container Networking
DCEU 18: Docker Container NetworkingDCEU 18: Docker Container Networking
DCEU 18: Docker Container NetworkingDocker, Inc.
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMwareVMUG IT
 

Similaire à Kubernetes - Sailing a Sea of Containers (20)

Learn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLearn kubernetes in 90 minutes
Learn kubernetes in 90 minutes
 
Kubernetes Node Deep Dive
Kubernetes Node Deep DiveKubernetes Node Deep Dive
Kubernetes Node Deep Dive
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
Kubernetes extensibility
Kubernetes extensibilityKubernetes extensibility
Kubernetes extensibility
 
Lifecycle of a pod
Lifecycle of a podLifecycle of a pod
Lifecycle of a pod
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals Training
 
Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)
 
Social Connections 14 - Kubernetes Basics for Connections Admins
Social Connections 14 - Kubernetes Basics for Connections AdminsSocial Connections 14 - Kubernetes Basics for Connections Admins
Social Connections 14 - Kubernetes Basics for Connections Admins
 
Kubernetes Basics for Connections Admins
Kubernetes Basics for Connections AdminsKubernetes Basics for Connections Admins
Kubernetes Basics for Connections Admins
 
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
OSS Japan 2019 service mesh bridging Kubernetes and legacy
OSS Japan 2019 service mesh bridging Kubernetes and legacyOSS Japan 2019 service mesh bridging Kubernetes and legacy
OSS Japan 2019 service mesh bridging Kubernetes and legacy
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Using kubernetes to lose your fear of using containers
Using kubernetes to lose your fear of using containersUsing kubernetes to lose your fear of using containers
Using kubernetes to lose your fear of using containers
 
Kubernetes Architecture with Components
 Kubernetes Architecture with Components Kubernetes Architecture with Components
Kubernetes Architecture with Components
 
Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple Effective Building your Platform with Kubernetes == Keep it Simple
Effective Building your Platform with Kubernetes == Keep it Simple
 
Data weekender deploying prod grade sql 2019 big data clusters
Data weekender deploying prod grade sql 2019 big data clustersData weekender deploying prod grade sql 2019 big data clusters
Data weekender deploying prod grade sql 2019 big data clusters
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
DCEU 18: Docker Container Networking
DCEU 18: Docker Container NetworkingDCEU 18: Docker Container Networking
DCEU 18: Docker Container Networking
 
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
 

Dernier

chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...tanu pandey
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 

Dernier (20)

chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 

Kubernetes - Sailing a Sea of Containers

  • 1. KubernetesKubernetes Sailing a Sea of ContainersSailing a Sea of Containers Kel Cecil - @praisechaos
  • 2. What is Kubernetes?What is Kubernetes? Container Orchestration Toolset Originated at Google (Borg) Now a Cloud Native Computing Foundation project Used in commercial and open source projects Tectonic (CoreOS) Meteor Galaxy (MeteorJS) OpenShift 3 (Red Hat) Kubernetes Scheduler for Deis (Engine Yard)
  • 3. Why Kubernetes?Why Kubernetes? Deploying one single container app is easy Deploying a complex app is more difficult One or more containers Replicas of containers Data volumes for persistent storage Deploying lots of complex apps can be a challenge
  • 4. FeaturesFeatures Services for load balancing Resource-based scheduling Robust API Great CLI tooling via kubectl Container-spec agnostic
  • 5. What does a simple Kubernetes cluster look like? Master Node Node Node
  • 6. NodeNode Physical or virtual machine on which containers can be scheduled
  • 7. What unit runs on the nodes?What unit runs on the nodes?
  • 8. PodPod A colocated set of application containers and shared data volumes. Smallest unit that can be scheduled.
  • 9. Pod container 1 container n AWS EBS Volume GCE Volume NFS Share Git Commit Containers Data Volumes And more...
  • 10. How can we organize podsHow can we organize pods (or any other Kubernetes resource)?
  • 11. LabelsLabels Key-value pairs used to organize resources.
  • 13. Let's have replicas of pods...Let's have replicas of pods... (There's a Kubernetes resource for that.)
  • 14. Replication ControllerReplication Controller Manages the lifecycle of pods by ensuring a desired number of pods exist.
  • 15. Replication Controller replicas=2 selector: app=user-service Pod labels: app=user-service Pod labels: app=user-service Pod labels: app=user-service
  • 16. How can we direct traffic to pods?How can we direct traffic to pods?
  • 17. ServiceService Provides a single, stable endpoint for a set of pods. Very much like a round-robin load balancer
  • 19. What components make up Kubernetes?
  • 21. Master kube-apiserver Validates and sets data for resources Services REST operations Provides the interface from which components interact
  • 22. Master kube-scheduler Performs scheduling of pods Considers many factors when deciding where to schedule Resource requirements Data locality Process affinity and anti-affinity
  • 23. Master kube-controller-manager Watches the state of the cluster through the API Makes changes to make actual state of pods match the desired state of pods
  • 24. Node kubelet Ensures that pod specifications are met on a node Performs garbage collection on containers Ensures that containers are healthy
  • 25. Node kube-proxy Network proxy that forwards traffic to proper container Configured using Kubernetes service Can forward TCP and UDP steams or round- robin TCP and UDP forwarding
  • 29. If you see this and following slides during the talk, then my demo was a bust. These slides are plan B. Sorry about that. If you're browsing my slides after the talk, then this is what I demonstrated live. https://github.com/pires/kubernetes-vagrant-coreos-cluster​ Follow along with this simple Kubernetes vagrant setup.
  • 30. apiVersion: v1 kind: ReplicationController # Metadata about the controller metadata: name: blog-controller labels: name: blog-controller spec: replicas: 2 # The labels of pods to be monitored selector: name: blog-pod # Template newly created pods follow template: metadata: # Match the controller selector at minimum labels: name: blog-pod spec: containers: - name: blog-container image: quay.io/kelcecil/kelcecil-com:latest # containerPort is port in use inside container ports: - containerPort: 80 Create a new replication controller blog.yaml
  • 31. Create a new replication controller (2/2) # Set your KUBERNETES_MASTER to your API Server # Alternatively, use the -s flag with kubectl export KUBERNETES_MASTER="http://127.0.0.1:8080" kubectl create -f blog.yaml In your terminal...
  • 32. Get a list of replication controllers and pods kelcecil@Kels-MBP ~/c/kube-talk> kubectl get rc CONTROLLER CONTAINER(S) IMAGE(S) SELECTOR REPLIC blog-controller blog-container quay.io/kelcecil/kelcecil-com:latest name=blog-pod 2 kelcecil@Kels-MBP ~/c/kube-talk> kubectl get pods NAME READY STATUS RESTARTS AGE blog-controller-0g7ng 1/1 Running 0 1m blog-controller-a6729 1/1 Running 0 1m # You can use kubectl get with any Kubernetes resource # kubectl get <resource> # kubectl get nodes # kubectl get services
  • 33. kelcecil@Kels-MBP ~/c/kube-talk> kubectl describe pod blog-controller-0g7ng Name: blog-controller-0g7ng Namespace: default Image(s): quay.io/kelcecil/kelcecil-com:latest Node: 172.17.8.102/172.17.8.102 Labels: name=blog-pod Status: Running Reason: Message: IP: 10.244.35.4 Replication Controllers: blog-controller (2/2 replicas created) Containers: blog-container: Image: quay.io/kelcecil/kelcecil-com:latest State: Running Started: Tue, 29 Sep 2015 20:44:37 -0400 Ready: True Restart Count: 0 ...... ...... ...... Get information about a particular pod kubectl describe also works for any Kubernetes resource
  • 34. kelcecil@Kels-MBP ~/c/kube-talk> kubectl describe node 172.17.8.102 Name: 172.17.8.102 Labels: kubernetes.io/hostname=172.17.8.102 CreationTimestamp: Sun, 13 Sep 2015 15:53:52 -0400 Conditions: Type Status LastHeartbeatTime LastTransitionTime Ready True Sun, 13 Sep 2015 16:55:16 -0400 Sun, 13 Sep 2015 15:53:52 -0400 Addresses: 172.17.8.102 Capacity: memory: 2053532Ki pods: 40 cpu: 1 Version: Kernel Version: 4.1.6-coreos-r2 OS Image: CoreOS 801.0.0 Container Runtime Version: docker://1.8.1 Kubelet Version: v1.0.3 Kube-Proxy Version: v1.0.3 ExternalID: 172.17.8.102 Pods: (1 in total) Namespace Name default blog-lmj3c No events. Get system information about a node kelcecil@Kels-MBP ~/c/kube-talk> kubectl get nodes NAME LABELS STATUS 172.17.8.102 kubernetes.io/hostname=172.17.8.102 Ready 172.17.8.103 kubernetes.io/hostname=172.17.8.103 Ready
  • 35. Create a label kelcecil@Kels-MBP ~/c/kube-talk> kubectl label node 172.17.8.102 region=us-east-1 NAME LABELS STATUS 172.17.8.102 kubernetes.io/hostname=172.17.8.102,region=us-east-1 Ready kelcecil@Kels-MBP ~/c/kube-talk> kubectl get nodes NAME LABELS STATUS 172.17.8.102 kubernetes.io/hostname=172.17.8.102,region=us-east-1 Ready 172.17.8.103 kubernetes.io/hostname=172.17.8.103 Ready kelcecil@Kels-MBP ~/c/kube-talk> kubectl get -l region=us-east-1 nodes NAME LABELS STATUS 172.17.8.102 kubernetes.io/hostname=172.17.8.102,region=us-east-1 Ready Filter resources by label Remove a label kelcecil@Kels-MBP ~/c/kube-talk> kubectl label node 172.17.8.102 region- NAME LABELS STATUS 172.17.8.102 kubernetes.io/hostname=172.17.8.102 Ready
  • 36. Scale a Replication Controller to 3 Replicas kelcecil@Kels-MBP ~/c/kube-talk> kubectl get pods NAME READY STATUS RESTARTS AGE blog-controller-0g7ng 1/1 Running 0 3m blog-controller-a6729 1/1 Running 0 3m kelcecil@Kels-MBP ~/c/kube-talk> kubectl scale --replicas=3 rc blog-controller scaled kelcecil@Kels-MBP ~/c/kube-talk> kubectl get pods NAME READY STATUS RESTARTS AGE blog-controller-0g7ng 1/1 Running 0 3m blog-controller-a6729 1/1 Running 0 3m blog-controller-sems7 1/1 Running 0 18s
  • 37. Get logs from a pod > kubectl logs blog-controller-0g7ng 2015/09/14 03:07:32 [notice] 12#0: using the "epoll" event method 2015/09/14 03:07:32 [notice] 12#0: nginx/1.8.0 2015/09/14 03:07:32 [notice] 12#0: OS: Linux 4.1.6-coreos-r2 2015/09/14 03:07:32 [notice] 12#0: getrlimit(RLIMIT_NOFILE): 1048576:1048576 2015/09/14 03:07:32 [notice] 12#0: start worker processes 2015/09/14 03:07:32 [notice] 12#0: start worker process 13
  • 38. Executing a command inside a pod/container > kubectl exec blog-controller-0g7ng "ps" PID USER TIME COMMAND 1 root 0:00 /bin/sh -c nginx 12 root 0:00 nginx: master process nginx 13 nginx 0:00 nginx: worker process 82 root 0:00 ps Interact with a shell inside a container > kubectl exec -it blog-controller-0g7ng "sh" / # ps ax PID USER TIME COMMAND 1 root 0:00 /bin/sh -c nginx 12 root 0:00 nginx: master process nginx 13 nginx 0:00 nginx: worker process 98 root 0:00 sh 103 root 0:00 ps ax / # exit
  • 39. apiVersion: v1 kind: Service # Metadata about the service metadata: name: blog-service labels: name: blog-service spec: # Open a port on nodes using kube-proxy type: NodePort ports: # the port the container serves on - port: 80 # Match the labels for pods to be served selector: name: blog-pod Create a new service blog-service.yaml # Set your KUBERNETES_MASTER to your API Server export KUBERNETES_MASTER="http://127.0.0.1:8080" kubectl create -f blog-service.yaml In your terminal...
  • 40. Perform a rolling update on a container > kubectl rolling-update --image=quay.io/kelcecil/kelcecil-com:talks blog-controller Creating blog-controller-676be42f24a573bf0ee7733377bd5ea8 At beginning of loop: blog-controller replicas: 1, blog-controller-676be42f24a573bf0ee7733377bd5ea Updating blog-controller replicas: 1, blog-controller-676be42f24a573bf0ee7733377bd5ea8 replicas: 1 At end of loop: blog-controller replicas: 1, blog-controller-676be42f24a573bf0ee7733377bd5ea8 repl At beginning of loop: blog-controller replicas: 0, blog-controller-676be42f24a573bf0ee7733377bd5ea Updating blog-controller replicas: 0, blog-controller-676be42f24a573bf0ee7733377bd5ea8 replicas: 2 At end of loop: blog-controller replicas: 0, blog-controller-676be42f24a573bf0ee7733377bd5ea8 repl Update succeeded. Deleting old controller: blog-controller Renaming blog-controller-676be42f24a573bf0ee7733377bd5ea8 to blog-controller blog-controller