0% found this document useful (2 votes)
581 views106 pages

Kubernetes in 30 Minutes20170310 170313090249

Kubernetes is 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 called pods. Kubernetes serves pods via services which provide a single IP address. Deployments define and update pod replicas while managing rolling updates.

Uploaded by

Ajay Yeruva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (2 votes)
581 views106 pages

Kubernetes in 30 Minutes20170310 170313090249

Kubernetes is 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 called pods. Kubernetes serves pods via services which provide a single IP address. Deployments define and update pod replicas while managing rolling updates.

Uploaded by

Ajay Yeruva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 106

Kubernetes in

30 minutes
Mar 10, 2017

Daisuke Maki @lestrrat


Netscape Navigator
Netscape Navigator
Kubernetes
κυβερνήτης
k8s
“Something to do with
containers…?
Assumptions
•You know about containers
•You know about orchestration
•You know about the painful art of
deploying stuff
Docker
“Random containers doing their own sh*t”
Compose
“Foreman on Acid”
Swarm
“Clustering and Discovery”
(hey, we’re getting somewhere!)
=
“Batteries Included”
K8s on GCP

GKE GCE Networking

…and others
Basic Concepts
Node
Hosts running
k8s daemons
Master
API
Scheduler
etc..

Node Node Node


kubelet kubelet kubelet
Pod
基本
Basic unit of
deployment in k8s
Group of Containers
Container configurations
Shared storage
Pod
container
Pod
container

container
Pod
container

container

container
Pod
e.g.

container nginx

container app

container redis/cache
Scheduled together
(“co-scheduled”)
Guaranteed to be
on the same node
(“co-located”)
Node Node Node
Node Node Node

Depends on each node’s resource availability


and each pod’s resource requirements
Node Node

container

container

container
Node Node

container

This will NEVER happen


container

container
Miscellaneous

• Each pod has its own IP address


• Pods are expected to be stateless
Replica Set
Keeps track of
Pod replicas
Replica Set
replicas: 3

template:
Replica Set
replicas: 3

template:

A
Replica Set
replicas: 3

template:

A B
Replica Set
replicas: 3

template:

A B C
Replica Set
replicas: 3

template:

A B C
Replica Set
replicas: 3

template:

A B
Replica Set
replicas: 3

template:

A B D
Deployment
Manages Replica Set
state transitions
Deployment
replicas: 3

template:
Deployment
replicas: 3

template:

Replica Set A

replicas: 3

template:
Deployment
replicas: 3

Change some settings, template:
please!

Replica Set A

replicas: 3

template:
Deployment
replicas: 23

Change some settings, template:
please!

Replica Set A

replicas: 3

template:
Deployment
replicas: 23

Change some settings, template:
please!

Replica Set A Replica Set B

replicas: 3
 replicas: 2

template: template:
Deployment
replicas: 23

Change some settings, template:
please!

Replica Set A Replica Set B

replicas: 3
 replicas: 2

template: template:
Deployment
replicas: 23

Change some settings, template:
please!

Replica Set B

replicas: 2

template:
Keeps track of
state change history
Deployment
replicas: 3

template:
Deployment
replicas: 3

template:

A
replicas: 3

template:
Deployment
replicas: 3

Change some settings, template:
please!

A
replicas: 3

template:
Deployment
replicas: 23

Change some settings, template:
please!

A
replicas: 3

template:
Deployment
replicas: 23

Change some settings, template:
please!

A B
replicas: 3
 replicas: 2

template: template:
Deployment
replicas: 23

Change some settings, template:
please!

A B
replicas: 3
 replicas: 2

template: template:
Deployment
replicas: 23

Change some settings, template:
please!

B
replicas: 2

template:
Deployment
replicas: 23

Oh wait, I actually template:
didn’t want to do that…

B
replicas: 2

template:
Deployment
replicas: 323

Oh wait, I actually template:
didn’t want to do that…

B
replicas: 2

template:
Deployment
replicas: 323

Oh wait, I actually template:
didn’t want to do that…

B
rollback replicas: 2

template:
Deployment
replicas: 323

Oh wait, I actually template:
didn’t want to do that…

A B
replicas: 3
 rollback replicas: 2

template: template:
Deployment
replicas: 323

Oh wait, I actually template:
didn’t want to do that…

A B
replicas: 3
 rollback replicas: 2

template: template:
Deployment
replicas: 323

Oh wait, I actually template:
didn’t want to do that…

A
replicas: 3

template:
Services
Logical set of Pods
(and ways to access them)
Raw Pod Access

Pod 10.0.96.2

Pod 10.0.96.3

Pod 10.0.96.3
Raw Pod Access

Pod 10.0.96.2

Pod 10.0.96.3

Pod 10.0.96.3
Raw Pod Access

Pod 10.0.96.2

Pod 10.0.96.3

Pod 10.0.96.3
Raw Pod Access

Pod 10.0.96.2

Pod 10.0.96.3
Raw Pod Access

Pod 10.0.96.2

Pod 10.0.96.3
Access Via Service

Pod 10.0.96.2

role=web

Service Pod 10.0.96.3

match role=web role=web

Pod 10.0.96.4

role=web

Pod 10.0.96.5

role=db
Access Via Service

Pod 10.0.96.2

role=web

Service Pod 10.0.96.3

match role=web role=web

Pod 10.0.96.4

role=web

Pod 10.0.96.5

role=db
Access Via Service

Pod 10.0.96.2

role=web

Service Pod 10.0.96.3

match role=web role=web

Pod 10.0.96.4

role=web

Pod 10.0.96.5

role=db
Access Via Service

Pod 10.0.96.2

role=web

Service Pod 10.0.96.3

match role=web role=web

Pod 10.0.96.4

role=web

Pod 10.0.96.5

role=db
Access Via Service

Pod 10.0.96.2

role=web

Service
match role=web

Pod 10.0.96.4

role=web

Pod 10.0.96.5

role=db
Access Via Service

Pod 10.0.96.2

role=web

Service
match role=web

Pod 10.0.96.4

role=web

Pod 10.0.96.5

role=db
Access Via Service

Pod 10.0.96.2

role=web

Service Pod 10.0.96.6

match role=web role=web

Pod 10.0.96.4

role=web

Pod 10.0.96.5

role=db
Access Via Service

Pod 10.0.96.2

role=web

Service Pod 10.0.96.6

match role=web role=web

Pod 10.0.96.4

role=web

Pod 10.0.96.5

role=db
Secrets
Store pieces of
data in k8s
e.g. Identity Information
(securely)
(…in the future)
Secret
key1 → base64 value

key2 → base64 value

key3 → base64 value


Pod
container:

volumeMounts:
- name: certificates
container mountPath: /etc/ssl/certs

volumes:
volumes - name: certificates
secret:
secretName: ca-certificates
Pod
env:
container - name: foo-secret
valueFrom:
secretKeyRef:
name: foo
volumes value: secret-value
ConfigMaps
Same as Secrets
(Unprotected)
Ingress
Services are for within the
cluster only
(external IPs allowed, but don’ use that to serve
external requests)
Inbound connections to
internal cluster services
(New since 1.2)
Please checkout my presentation
https://docs.google.com/presentation/d/
11ZN6qgiuZZfVyhBK2hjp1vhp_5N0DOGnAmhPreS3L5A/pub?
start=false&loop=false&delayms=3000
DaemonSets
Ensure nodes run a copy of a Pod
Node Node Node

prometheus-exporter prometheus-exporter prometheus-exporter


PetSets
PetSets
StatefulSets
Use only when *really* needed
Keeps unique IDs in replicas
(x-0, x-1, x-2,…)
Questions?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy