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

Intro to Kubernetes

Intro to Kubernetes

Ca3d0556227d66b3c15be1eadf69473b?s=128

Jacob Tomlinson

October 29, 2015
Tweet

Transcript

  1. Jacob Tomlinson Senior Developer / Engineer

  2. None
  3. Docker

  4. $ docker run mongo

  5. $ docker run -d --name mongo1 --restart always -- log-driver=syslog

    --log-opt address=tcp:// 192.168.0.42:123 -v /data/:/data/ -v /home/me/file:/ file -p 27017: 27017 mongo
  6. #!/bin/bash docker run -d --name mongo1 --restart always --log-driver=syslog --log-

    opt address=tcp://192.168.0.42:123 -v /data/:/data/ -v /home/me/file:/file - p 27017: 27017 mongo docker run -d --name webapp1 --restart always --log-driver=syslog --log- opt address=tcp://192.168.0.42:123 -v /home/me/file:/file -p 8000: 8000 myorg/webapp docker run -d --name webapp2 --restart always --log-driver=syslog --log- opt address=tcp://192.168.0.42:123 -v /home/me/file:/file -p 8001: 8000 myorg/webapp docker run -d --name webapp3 --restart always --log-driver=syslog --log- opt address=tcp://192.168.0.42:123 -v /home/me/file:/file -p 8002: 8000 myorg/webapp docker run -d --name nginx --restart always --log-driver=syslog --log-opt address=tcp://192.168.0.42:123 -p 80: 80 nginx
  7. Shipyard

  8. None
  9. None
  10. Describe

  11. Pods

  12. apiVersion: v1 kind: Pod metadata: name: mongo spec: containers: -

    name: mongo image: mongo ports: - containerPort: 27017
  13. apiVersion: v1 kind: Pod metadata: name: mongo spec: containers: -

    name: mongo image: mongo ports: - containerPort: 27017
  14. Replication

  15. apiVersion: v1 kind: ReplicationController metadata: name: webapp spec: replicas: 3

    managing selector: app: webapp template: metadata: labels: app: webapp spec: containers: - name: webapp image: myorg/webapp ports: - containerPort: 8000
  16. apiVersion: v1 kind: ReplicationController metadata: name: webapp spec: replicas: 3

    managing selector: app: webapp template: metadata: labels: app: webapp spec: containers: - name: webapp image: myorg/webapp ports: - containerPort: 8000
  17. apiVersion: v1 kind: ReplicationController metadata: name: webapp spec: replicas: 3

    managing selector: app: webapp template: metadata: labels: app: webapp spec: containers: - name: webapp image: myorg/webapp ports: - containerPort: 8000
  18. apiVersion: v1 kind: ReplicationController metadata: name: webapp spec: replicas: 3

    managing selector: app: webapp template: metadata: labels: app: webapp spec: containers: - name: webapp image: myorg/webapp ports: - containerPort: 8000
  19. Services

  20. apiVersion: v1 kind: Service metadata: name: nginx-service spec: ports: -

    port: 8000 targetPort: 80 protocol: TCP selector: app: nginx
  21. apiVersion: v1 kind: Service metadata: name: nginx-service spec: ports: -

    port: 8000 targetPort: 80 protocol: TCP selector: app: nginx
  22. Fail Fast, Fail Cheap

  23. Cattle Not Pets

  24. Stateless Applications

  25. Forced

  26. Scalability

  27. Patching? Host problems?

  28. None
  29. Embrace

  30. www.informaticslab.co.uk www.jacobtomlinson.co.uk @_jacobtomlinson Questions?