Skip to content

Deployment strategies with Kubernetes and how to prepare your micro-service for them

Notifications You must be signed in to change notification settings

wojciech12/talk_zero_downtime_deployment_with_kubernetes

Repository files navigation

Zero deployment of Micro-Services with Kubernetes

Do you need to implement a zero-downtime deployment for your product? Did you consider Kubernetes? Check whether my slides, demos of different deployment strategies, and an service implementation example might help you get started. You can run all demos on minikube.

To see how to prepare your microservice, check Golang and .net core implementations (Looking for contributions in Py and Rust).

The demos cover recreate, rolling updates, blue-green, and canary deployment strategies. In future, I will add other deployment approaches - see TBD below.

Slides:

Demos:

Helpful? Please give a LIKE to the most recent LinkedIn post about this talk or a STAR to this github repo.

Questions, Feedback? Let me know at [email protected].

ps. We are hiring - github.com/hypatos/jobs

Start

You can use a hosted kubernetes, in the demo I assume we are on minikube:

minikube start
kubectl config use-context minikube

Why minikube? I want to make it easy for you to start.

How to build your component

livenessProbe and readinessProbe

  • livenessProbe:

    livenessProbe:
      httpGet:
        path: /model
        port: 8000
        httpHeaders:
          - name: X-Custom-Header
            value: Awesome
      initialDelaySeconds: 600
      periodSeconds: 5
      timeoutSeconds: 18
      successThreshold: 1
      failureThreshold: 3
    
  • readinessProbe:

    readinessProbe:
      exec:
        command:
        - cat
         - /tmp/healthy
      initialDelaySeconds: 5
      periodSeconds: 5
    

Graceful shutdown

  • handling SIGTERM
  • health and ready implementation

Check demo and demo_net.

Looking for a Java implementation, check Mateusz Dyminski talk.

TBD

To Be Added before the next talk:

  1. lifecycle: preStop sleep
  2. cover: what happening is during a k8s upgrade
  3. cover: anti-affinity
  4. conver pod's disruption budget
  5. shadow deployment with (most probably) Istio
  6. feature switch with Golang
  7. A/B deployment with Golang
  8. Python example.
  9. Java example.

History

Previous versions of the talk:

Related Work

About

Deployment strategies with Kubernetes and how to prepare your micro-service for them

Resources

Stars

Watchers

Forks

Packages

No packages published