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

Das Gruselkabinett des Dr. Kube

Nicolas Byl
September 06, 2018

Das Gruselkabinett des Dr. Kube

Nicolas Byl

September 06, 2018
Tweet

More Decks by Nicolas Byl

Other Decks in Technology

Transcript

  1. 2

  2. 5

  3. 6

  4. 7

  5. 8 • Use Kubernetes CronJobs • Cluster-wide Scheduling • Save

    Ressources • https://kubernetes.io/docs/tasks/job/automated-tasks- with-cron-jobs
  6. 10 • Deploying multiple Server instances, sharing a volume. •

    Applications are deployed to volume • Flaws • No Rolling-Upgrades • Manual Rollback • Single Point of Failure • What is your artifact? Persistent Volume /usr/local/tomcat/webapps/ ROOT.war App1.war
  7. 15 Use small base images 1 Short startup times No

    debugging tools Split different runtimes across different containers Lookout for your image size (e.g. package caches, …) 2 3 4 5 15 1 5 Small is beautiful https://pxhere.com/de/photo/864475
  8. 16 • You don’t need debugging, you need observability: •

    Pod Lifecycles • Scaling • Cluster Rebalancing • Monitoring • Metrics • Cluster State • Tracing
  9. 18 • Running processes inside your container behing some init

    system (systemd, supervisord, …) • Hiding process state from your container runtime. • Restarts? • Separation of concerns? • Logs? • Patching? • Start-Up Times? Docker Container • supervisord • Application 1 • Application 2 • … • Applicaiton N
  10. 19 • The bigger your pods, the harder your scheduling

    • Horizontal Scaling? • Pods are scheduled, upgraded and restarted as a unit • Use one pod per container, unless you know what you’re doing! Pod Application 1 Application 2 Application 3 Application N
  11. 21

  12. 22 • A technology is matroschka complete when it can

    be deployed onto itself. • The matroschka level is the number of layers between a deployment and the hosting deployment of the same technology.
  13. 23 Nesting other clusters inside Kubernetes is tricky 1 Use

    StatefulSets for predictable Hostnames and Storage Provisioning Use clusters with reasonable recovery times from split brains and node failures Consider re-architecting your application into stateless containers 2 3 4 23 2 3 https://pxhere.com/de/photo/864475
  14. 25 • Docker Daemon is needed to build docker images

    • Solution: Passthrough of socket into build container • Paraphrasing: You are granting control of your host to not yet verified code. Host Build Docker Daemon App App Socket
  15. 26 Possible solution: Docker-in-Docker (still need priviledged access to the

    linux kernel) 1 Evaluate alternative builders: kaniko, jib Mitigation: Split clusters between development and other stages Caveat: If building in cluster, look at serviceaccount, too! 2 3 4 26 2 6 https://pxhere.com/de/photo/864475 https://pxhere.com/de/photo/833821
  16. 29 • Which version are you running now? • Docker-Tags

    are not immutable • Rolling Upgrades work only when definitions are changed • What was deployed at what time?
  17. 30

  18. 33 • Kubernetes knows hard and soft limits for memory

    and CPU • Take care if doing manually! • Strategies: • Hide behind workflow tool • Teach your users • compliance-check your deployments • Use an aware Runtime! (JDK 9+)