Slide 1

Slide 1 text

Hosting TYPO3 in Container Cloud Architectures Martin Helmich Mittwald CM Service GmbH & Co. KG TYPO3Camp Mitteldeutschland, Dresden 26. Januar 2018 CC-0, mahaviharya https://pixabay.com/en/meditation-monk-snow-mountain-3083274/

Slide 2

Slide 2 text

Martin Helmich Software & Systems Architect @ Mittwald CM Service Dozent @ Private Hochschule für Wirtschaft & Technik http://stackoverflow.com/story/martinhelmich https://github.com/martin-helmich https://www.martin-helmich.de

Slide 3

Slide 3 text

„Klassische“ Systemarchitektur für Webhosting

Slide 4

Slide 4 text

„Klassische“ Systemarchitektur für Webhosting Container-basierte Systemarchitektur

Slide 5

Slide 5 text

WHY DOCKER?

Slide 6

Slide 6 text

WHY DOCKER? • EFFIZIENZ Geringerer Overhead als „klassische“ Virtuelle Maschinen • STANDARDISIERT Open Container Initiative • COMMUNITY Docker + Kubernetes gehören zu den aktivsten Projekten auf GitHub • AUTOMATISIERUNG Auf DevOps zugeschnittene Tools Hoher Automatisierungsgrad

Slide 7

Slide 7 text

KUBERNETES

Slide 8

Slide 8 text

KUBERNETES • KUBER-WIEBITTE? „Kubernetes is an open-source system for automating deployment, scaling and management of containerized applications“ • GOOGLE SCALE „billions of containers a week“ • AUTOMATISIERUNG Horizontale Skalierung Selbstheilung Storage-Orchestrierung Konfigurationsmanagement und noch mehr…

Slide 9

Slide 9 text

SPACES Container Architecture Applikations-Pods (Deployment) Caching-Pods (StatefulSet) Database Pods (MySQL, Elasticsearch, …) (StatefulSet) Logging Pod (Deployment) Management Pod (Deployment)

Slide 10

Slide 10 text

SCALING CONTAINERS

Slide 11

Slide 11 text

SCALING TRADITIONELLE ARCHITEKTUREN • VERTIKALE SKALIERUNG „Buy a bigger box“ • HORIZONTALE SKALIERUNG „Buy more boxes“ Teurer Load Balancer

Slide 12

Slide 12 text

SCALING THE KUBERNETES WAY 1. Provider mit genügend Überkapazität finden 2. „Horizontal Autoscaler“ in Kubernetes konfigurieren 3. Zurücklehnen Viele kleine Applikations-Container Kurzlebig, häufig erstellt & gelöscht

Slide 13

Slide 13 text

$ kubectl scale deployment my-app --replicas=32 deployment "my-app" scaled $ kubectl get deployments NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE my-app 32 32 32 15 30m $ kubectl get pods NAME READY STATUS RESTARTS AGE my-app-2035384211-7ci7o 1/1 Running 0 18s my-app-2035384211-kzszj 1/1 Running 0 18s my-app-2035384211-qqcnn 1/1 Running 0 18s …

Slide 14

Slide 14 text

$ kubectl autoscale deployment my-app \ --min=4 --max=128 --cpu-percent=80 deployment "my-app" autoscaled

Slide 15

Slide 15 text

NUTZEN KUNDE + PROVIDER • Effiziente Ressourcenauslastung (kein „Over-Provisioning“) • Schneller Scale-Up & Scale-Down • „zero-conf“

Slide 16

Slide 16 text

HERAUS- FORDERUNGEN

Slide 17

Slide 17 text

HERAUSFORDERUNGEN Viele PHP-Applikationen unterstützen horizontales Scaling nur bedingt. Fallstricke: • Daten (Caches oder Nutzdaten) im lokalen Filesystem • Sich selbst verändernder Code

Slide 18

Slide 18 text

Shared Filesystem typo3temp/ typo3conf/ fileadmin/ uploads/ GLUSTER

Slide 19

Slide 19 text

HERAUSFORDERUNGEN • Die Applikation selbst kann (eventuell mit Biegen und Brechen) gut horizontal skaliert werden • Darunter liegende Datenbank- systeme (bspw. MySQL) nicht so einfach

Slide 20

Slide 20 text

Database Skalierbare Caching-Schicht

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content