Top Banner
@wattsteve Building Clustered Applications with Kubernetes and Docker Steve Watt Red Hat Emerging Technologies
13

Building Clustered Applications with Kubernetes and Docker · @wattsteve Building Clustered Applications with Kubernetes and Docker Steve Watt Red Hat Emerging Technologies

Sep 13, 2018

Download

Documents

ngonguyet
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Building Clustered Applications with Kubernetes and Docker · @wattsteve Building Clustered Applications with Kubernetes and Docker Steve Watt Red Hat Emerging Technologies

@wattsteve

Building Clustered Applications with Kubernetes and Docker Steve Watt Red Hat Emerging Technologies

Page 2: Building Clustered Applications with Kubernetes and Docker · @wattsteve Building Clustered Applications with Kubernetes and Docker Steve Watt Red Hat Emerging Technologies

@wattsteve

Why Docker?

CC flickr bibbit

Page 3: Building Clustered Applications with Kubernetes and Docker · @wattsteve Building Clustered Applications with Kubernetes and Docker Steve Watt Red Hat Emerging Technologies

@wattsteve

Why Kubernetes?

Page 4: Building Clustered Applications with Kubernetes and Docker · @wattsteve Building Clustered Applications with Kubernetes and Docker Steve Watt Red Hat Emerging Technologies

@wattsteve

Kubernetes Cluster

Kubernetes Architectural Overview

Kubernetes Master Server(s)

Linux Server(s)

etcd API Server

Controller Manager

Kubernetes Node

Linux Server

Kubelet Docker

Kubernetes Proxy

Kubernetes Node

Linux Server

Kubelet Docker

Kubernetes Proxy

Kubernetes Node

Linux Server

Kubelet Docker

Kubernetes Proxy

Scheduler

Page 5: Building Clustered Applications with Kubernetes and Docker · @wattsteve Building Clustered Applications with Kubernetes and Docker Steve Watt Red Hat Emerging Technologies

@wattsteve

Installing Kubernetes

•  Hosted Services: Google Compute Engine •  Support for a wide variety of Infrastructure (Azure,

Rackspace, vSphere, AWS) •  Support for several OS’ (RHEL, CentOS, Fedora,

Debian, Ubuntu, Atomic, CoreOS) •  Local but automated (Vagrant/Ansible) * Magic * •  Local but manual (Fedora) * What I use *

https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/getting-started-guides/fedora/fedora_manual_config.md

Page 6: Building Clustered Applications with Kubernetes and Docker · @wattsteve Building Clustered Applications with Kubernetes and Docker Steve Watt Red Hat Emerging Technologies

@wattsteve

CC flickr kk

Awesome! Now, lets build an application

Page 7: Building Clustered Applications with Kubernetes and Docker · @wattsteve Building Clustered Applications with Kubernetes and Docker Steve Watt Red Hat Emerging Technologies

@wattsteve

Kubernetes Master

Kubernetes Node 1

Kubernetes Cluster

NGINX Pod

NGINX Container

Browser Request

Kubernetes Node 2 Other Pods

Other Containers

We’ll start by Defining and Deploying a Pod

Page 8: Building Clustered Applications with Kubernetes and Docker · @wattsteve Building Clustered Applications with Kubernetes and Docker Steve Watt Red Hat Emerging Technologies

@wattsteve

Kubernetes Master

Kubernetes Node 1

Kubernetes Cluster

NGINX Pod

NGINX Container

Browser Request

Kubernetes Node 2 NGINX Pod

NGINX Pod ReplicationController

NGINX Container Browser Request

You might also want to add a ReplicationController

Page 9: Building Clustered Applications with Kubernetes and Docker · @wattsteve Building Clustered Applications with Kubernetes and Docker Steve Watt Red Hat Emerging Technologies

@wattsteve

Kubernetes Master

Kubernetes Node 1

Kubernetes Cluster

NGINX Pod

NGINX Container

Browser Request

Kubernetes Node 2 NGINX Pod

NGINX Pod ReplicationController

NGINX Container

NGINX Master Service

And add a Service to Proxy in front of it

Page 10: Building Clustered Applications with Kubernetes and Docker · @wattsteve Building Clustered Applications with Kubernetes and Docker Steve Watt Red Hat Emerging Technologies

@wattsteve

What about Persistence? Lets try out Volumes

Volumes are specified in a Pod and mounted onto a specified path within a container. There are several kinds of Volumes: •  hostPath (mount a persistent directory provided by host)

•  NFS (mount NFS share provided by a 3rd Party)

Ephemeral

•  emptyDir (mount an ephemeral directory provided by host)

File

•  GlusterFS Distributed File System (mount an adjacent GlusterFS volume)

•  Ceph Distributed File System (mount an adjacent CephFS volume)

Block

•  GCEPersistentDisk (mount a GCE Block Device when in GCE)

•  Ceph Block (mount an adjacent Ceph Block Device)

•  ISCSI Block Devices (mount an adjacent ISCSI Block Device)

Page 11: Building Clustered Applications with Kubernetes and Docker · @wattsteve Building Clustered Applications with Kubernetes and Docker Steve Watt Red Hat Emerging Technologies

@wattsteve

Kubernetes Master

Kubernetes Node 1

Kubernetes Cluster

NGINX Pod

NGINX Container

Browser Request

Kubernetes Node 2 NGINX Pod

NGINX Pod ReplicationController

NGINX Container

NGINX Master Service GlusterFS

Volume

For this example, we’re going to use GlusterFS

Page 12: Building Clustered Applications with Kubernetes and Docker · @wattsteve Building Clustered Applications with Kubernetes and Docker Steve Watt Red Hat Emerging Technologies

@wattsteve

Debugging

Page 13: Building Clustered Applications with Kubernetes and Docker · @wattsteve Building Clustered Applications with Kubernetes and Docker Steve Watt Red Hat Emerging Technologies

@wattsteve

Thanks for Attending

Interested in following up? Steve Watt

[email protected]

Examples: https://github.com/wattsteve/kubernetes/