Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ChaDevOps: Deploying Self Healing Services with Kubernetes

ChaDevOps: Deploying Self Healing Services with Kubernetes

In this talk I tell the story of how Kubernetes kept Spire systems running through an AWS service disruption. From there I go through a demo showing just how simple it is to deploy self healing services with Kubernetes. You'll learn how to avoid some common problems, and should leave this talk with everything you need to get started with Kubernetes.

Related to this Presentation:

GitHub (https://github.com/robscott/self-healing-k8s-demo)

Further Reading:

The Children's Illustrated Guide to Kubernetes (https://deis.com/blog/2016/kubernetes-illustrated-guide/)

Quickstart for Google Container Engine (https://cloud.google.com/container-engine/docs/quickstart)

Setting up an HA Kubernetes Cluster in AWS with private topology with Kops 1.5.1 (https://www.nivenly.com/kops-1-5-1/)

KubeCon Videos (https://www.youtube.com/playlist?list=PLj6h78yzYM2PAavlbv0iZkod4IVh_iGqV)

Rob Scott

June 21, 2017
Tweet

More Decks by Rob Scott

Other Decks in Technology

Transcript

  1. The core services powering Spire Website API Scheduler HTTP Services

    Background Services Background Processing Notifications Management Portal
  2. Node 1 Notifications Background Processing API Management Portal What it

    all looks like in Kubernetes API Website STAGING DEMO QA QA Scheduler Website QA STAGING STAGING Node 2 Notifications Background Processing API Management Portal API Website DEMO QA QA Website STAGING Node 3 Notifications Background Processing Management Portal API STAGING DEMO DEMO Scheduler Website DEMO DEMO Notifications Notifications DEMO DEMO Background ProcessingQA Node 4 Notifications API Management Portal Website QA QA Scheduler Background Processing DEMO Background ProcessingQA Management Portal STAGING DEMO STAGING STAGING QA Management Portal STAGING STAGING STAGING DEMO QA
  3. Node 1 Notifications Background Processing API Management Portal What if

    a Node dies? API Website STAGING DEMO QA QA Scheduler Website QA STAGING STAGING Node 2 Notifications Background Processing API Management Portal API Website DEMO QA QA Website STAGING Node 3 Notifications Background Processing Management Portal API STAGING DEMO DEMO Scheduler Website DEMO DEMO Notifications Notifications DEMO DEMO Background ProcessingQA Node 4 Notifications API Management Portal Website QA QA Scheduler Background Processing DEMO Background ProcessingQA Management Portal STAGING DEMO STAGING STAGING QA Management Portal STAGING STAGING STAGING DEMO QA
  4. Node 1 Notifications Background Processing API Management Portal After redistribution

    API Website STAGING DEMO QA QA Scheduler Website QA STAGING STAGING Node 2 Notifications Background Processing API Management Portal API Website DEMO QA QA Website STAGING Node 3 Notifications Background Processing Management Portal API STAGING DEMO DEMO Scheduler Website DEMO DEMO Notifications Notifications DEMO DEMO Background ProcessingQA Notifications API Management Portal Website QA QA Scheduler Background Processing DEMO Background ProcessingQA Management Portal STAGING DEMO STAGING STAGING QA Management Portal STAGING STAGING STAGING DEMO QA
  5. Initial Release: July 21, 2015 Google partnered with the Linux

    Foundation to form the Cloud Native Computing Foundation (CNCF) to govern Kubernetes.
  6. apiVersion: v1 kind: Service metadata: name: self-healing-k8s-demo spec: type: LoadBalancer

    selector: app: self-healing-k8s-demo ports: - protocol: TCP port: 80 targetPort: 3000
  7. apiVersion: v1 kind: Pod metadata: name: demo-pod labels: app: self-healing-k8s-demo

    spec: containers: - name: demo-http-server image: quay.io/robertjscott/demo-http-server:0.1.1
  8. apiVersion: extensions/v1beta1 kind: Deployment metadata: name: demo-deployment spec: replicas: 3

    template: metadata: labels: app: self-healing-k8s-demo spec: containers: - name: demo-http-server image: quay.io/robertjscott/demo-http-server:0.1.1
  9. containers: - name: demo-http-server image: quay.io/robertjscott/demo-http-server:0.1.1 livenessProbe: httpGet: path: /alive

    port: 3000 periodSeconds: 5 timeoutSeconds: 1 initialDelaySeconds: 45 env: - name: STARTUP_DELAY_SECONDS value: '40'
  10. containers: - name: demo-http-server image: quay.io/robertjscott/demo-http-server:0.1.1 livenessProbe: httpGet: path: /alive

    port: 3000 periodSeconds: 5 timeoutSeconds: 1 initialDelaySeconds: 45 readinessProbe: httpGet: path: /ready port: 3000 periodSeconds: 5 timeoutSeconds: 1
  11. apiVersion: extensions/v1beta1 kind: Deployment metadata: name: mayhem-deployment spec: replicas: 5

    template: metadata: labels: app: mayhem spec: containers: - name: mayhem image: quay.io/robertjscott/mayhem:0.1.0
  12. Where to go from here • The Children's Illustrated Guide

    to Kubernetes • Quickstart for Google Container Engine • Setting up an HA Kubernetes Cluster in AWS with private topology with Kops 1.5.1 • KubeCon Videos