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

akka-cluster-etcd

 akka-cluster-etcd

Presented at Scalar conference 2016

Maciej Biłas

April 16, 2016
Tweet

More Decks by Maciej Biłas

Other Decks in Programming

Transcript

  1. Who am I? • Maciej Biłas • Software engineer at

    Adform • much data, some plumbing • Scala for ~4 years
  2. The Old Way • Servers, VMs • Chefs, Ansibles, …

    • System libraries, packages, … • logging, monitoring, … • Host-centric infrastructure
  3. +

  4. Kubernetes • Where do my containers live? • What are

    the IP addresses of their machines?
  5. Deployment kubectl create -f etcd-rc.yml \ 
 -f etcd-srv.yml \


    -f frontend-rc.yml \
 -f frontend-srv.yml \
 -f backend-rc.yml
  6. Deployment kubectl create -f etcd-rc.yml \ 
 -f etcd-srv.yml \


    -f frontend-rc.yml \
 -f frontend-srv.yml \
 -f backend-rc.yml
  7. frontend-rc.yml apiVersion: v1 kind: ReplicationController metadata: name: cluster-monitor-frontend spec: replicas:

    1 selector: app: cluster-monitor-frontend template: metadata: labels: app: cluster-monitor-frontend spec: containers: - name: cluster-monitor image: eu.gcr.io/sandbox-maciejb/akka-cluster-etcd/monitor:latest imagePullPolicy: IfNotPresent env: - name: CLUSTER_ROLE value: frontend
  8. frontend-srv.yml apiVersion: v1 kind: Service metadata: name: cluster-monitor-frontend spec: ports:

    - port: 8080 selector: app: cluster-monitor-frontend type: LoadBalancer
  9. ➜ kubectl get rc NAME DESIRED CURRENT AGE cloud-monitor-backend 1

    1 9m cloud-monitor-frontend 1 1 9m etcd 1 1 15m ➜ kubectl scale rc/cloud-monitor-backend --replicas=3 replicationcontroller "cloud-monitor-backend" scaled
  10. ➜ kubectl get rc NAME DESIRED CURRENT AGE cloud-monitor-backend 1

    1 9m cloud-monitor-frontend 1 1 9m etcd 1 1 15m ➜ kubectl scale rc/cloud-monitor-backend --replicas=3 replicationcontroller "cloud-monitor-backend" scaled
  11. ➜ kubectl get pods NAME READY STATUS RESTARTS AGE cloud-monitor-backend-2zpds

    1/1 Running 0 2m cloud-monitor-backend-cxj7r 1/1 Running 0 4m cloud-monitor-frontend-biw43 1/1 Running 0 3m etcd-tmpz6 1/1 Running 0 23m ➜ kubectl delete pods/cloud-monitor-backend-2zpds pod "cloud-monitor-backend-2zpds" deleted ➜ kubectl get pods NAME READY STATUS RESTARTS AGE cloud-monitor-backend-cxj7r 1/1 Running 0 5m cloud-monitor-backend-dqpvd 1/1 Running 0 20s cloud-monitor-frontend-biw43 1/1 Running 0 3m etcd-tmpz6 1/1 Running 0 24m
  12. ➜ kubectl get pods NAME READY STATUS RESTARTS AGE cloud-monitor-backend-2zpds

    1/1 Running 0 2m cloud-monitor-backend-cxj7r 1/1 Running 0 4m cloud-monitor-frontend-biw43 1/1 Running 0 3m etcd-tmpz6 1/1 Running 0 23m ➜ kubectl delete pods/cloud-monitor-backend-2zpds pod "cloud-monitor-backend-2zpds" deleted ➜ kubectl get pods NAME READY STATUS RESTARTS AGE cloud-monitor-backend-cxj7r 1/1 Running 0 5m cloud-monitor-backend-dqpvd 1/1 Running 0 20s cloud-monitor-frontend-biw43 1/1 Running 0 3m etcd-tmpz6 1/1 Running 0 24m
  13. ➜ kubectl get pods NAME READY STATUS RESTARTS AGE cloud-monitor-backend-2zpds

    1/1 Running 0 2m cloud-monitor-backend-cxj7r 1/1 Running 0 4m cloud-monitor-frontend-biw43 1/1 Running 0 3m etcd-tmpz6 1/1 Running 0 23m ➜ kubectl delete pods/cloud-monitor-backend-2zpds pod "cloud-monitor-backend-2zpds" deleted ➜ kubectl get pods NAME READY STATUS RESTARTS AGE cloud-monitor-backend-cxj7r 1/1 Running 0 5m cloud-monitor-backend-dqpvd 1/1 Running 0 20s cloud-monitor-frontend-biw43 1/1 Running 0 3m etcd-tmpz6 1/1 Running 0 24m
  14. ➜ kubectl get pods NAME READY STATUS RESTARTS AGE cloud-monitor-backend-2zpds

    1/1 Running 0 2m cloud-monitor-backend-cxj7r 1/1 Running 0 4m cloud-monitor-frontend-biw43 1/1 Running 0 3m etcd-tmpz6 1/1 Running 0 23m ➜ kubectl delete pods/cloud-monitor-backend-2zpds pod "cloud-monitor-backend-2zpds" deleted ➜ kubectl get pods NAME READY STATUS RESTARTS AGE cloud-monitor-backend-cxj7r 1/1 Running 0 5m cloud-monitor-backend-dqpvd 1/1 Running 0 20s cloud-monitor-frontend-biw43 1/1 Running 0 3m etcd-tmpz6 1/1 Running 0 24m
  15. Q&A