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

Commandeering Kubernetes with Elixir

Cory O'Daniel
November 07, 2019

Commandeering Kubernetes with Elixir

The basics of extending Kubernetes using the Operator Pattern and a demo of using Bonny, the Elixir based Kubernetes Development Framework.

Cory O'Daniel

November 07, 2019
Tweet

Other Decks in Programming

Transcript

  1. Cory O’Daniel (apostrophe not required) Senior YAML Architect @ Container

    Heroes Creator of Bonny Kubernetes Development Framework @coryodaniel @coryodaniel
  2. Why do we extend? The operator pattern allows you to

    codify the expertise of a human operator with deep knowledge of managing an application or set of services and how to react if there are problems.
  3. The Operator pattern for extending Kubernetes • Process a chunked

    HTTP stream of add, modify, and delete events • Continually reconcile k8s resources’ state changes • Manage background tasks, processes, and state
  4. Why Kubernetes? Service Discovery and Load Balancing NODE NODE Where

    is microservice-a.prod.svc.cluster.local NODE MASTERS
  5. `kubectl explain pod` • 1 or more colocated docker containers

    • Acts as a “logical host” • Share volumes • Share network • Live and die as a unit
  6. `kubectl explain deployment` • Declarative management of pods ◦ Desired

    number of pod replicas ◦ Rollout Strategy ◦ Revision History
  7. `kubectl explain service` • Exposes a set of pods as

    a network service • Selects pods using labels
  8. Scheduler ETCD Master Components NODES Deployment ReplicaSet Pod API Server

    Deployment Controller ReplicaSet Controller Ctrl Manager HTTP POST HTTP GET deployment/nginx replicaset/nginx-jk1234 pod/nginx-jk1234-6963
  9. Our first operator: Todos App Create a Custom Resource Definition

    (CRD) • Generates a REST Endpoint • Defines the fields and validations we expect
  10. Our first operator: Todos App Create a Controller • Polls

    REST endpoint • Reconciles changes in resource state