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

Kubernetes For Sysadmins

Kubernetes For Sysadmins

Maciej Strzelecki

December 14, 2017
Tweet

More Decks by Maciej Strzelecki

Other Decks in Technology

Transcript

  1. Maciej Strzelecki • DevOps Engineer @ Schibsted Tech Polska •

    Trainer @ infoShare Academy • Independent Consultant
  2. Mutable Infrastructure vs Immutable Infrastructure “Configuration management tools such as

    Chef, Puppet, Ansible, and SaltStack typically default to a mutable infrastructure paradigm.”
  3. Pods • abstraction that represents a group of one or

    more application containers • Shared storage, as Volumes • Networking, as a unique cluster IP address • Information about how to run each container, such as the container image version or specific ports to use
  4. Services and Labels • Service routes traffic across a set

    of Pods • Labels are key/value pairs attached to objects • Services match a set of Pods using labels and selectors
  5. Scheduling Decide where my container should run • nodeSelector •

    Node affinity • Inter-pod affinity and anti-affinity
  6. Lifecycle and health Keep my containers running despite failures •

    Container hooks • Init Containers • Liveness and Readiness Probes
  7. Load balancing Distribute traffic across a set of containers •

    Services • External Load Balancer • Ingress
  8. Storage volumes Provide data to containers • Volumes • Persistent

    Volumes • Persistent Volume Claims • Storage Classes
  9. Identity and authorization Control who can do things to my

    containers • Namespaces • RBAC • Network Policies
  10. How to Configure Autoscaling on Docker Swarm? “Not available today.

    Swarm uses Docker-Compose to scale statically. CPU/QPS monitoring is needed to do auto scaling. Swarm doesn't have that yet.”
  11. “Docker-Swarm, Kubernetes, Mesos & Core-OS Fleet” “I think that Mesos

    and Kubernetes are largely aimed at solving similar problems of running clustered applications, they have different histories and different approaches to solving the problem. Mesos focuses its energy on very generic scheduling and plugging in multiple different schedulers.”
  12. Minikube Run Kubernetes locally Minikube is a tool that makes

    it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day.
  13. Hosted Solutions • Google Container Kubernetes Engine (GKE) • Azure

    Container Service (AKS) • Amazon Elastic Container Service for Kubernetes (EKS)
  14. Kubernetes The Hard Way Bootstrap Kubernetes the hard way on

    Google Cloud Platform. No scripts. Kubernetes The Hard Way is optimized for learning, which means taking the long route to ensure you understand each task required to bootstrap a Kubernetes cluster.
  15. Note to Self • Monitor and log everything (especially count

    of restarted Pods) • Managed versions are OK to start, but sooner or later you’ll need some tweaks or customizations • Limit resources of each application from the beginning • Watch out for Java apps and heap size • Design readiness and liveness probes carefully, don’t check external dependencies • Take service mesh for consideration (Istio, Linkerd etc.) or at least configure tracing (included in NGINX Ingress Controller) • Use tools from K8s ecosystem (Helm, Draft) • Minikube on local development environment isn’t a problem, Docker-way of development is