Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL...

29
Hochverfügbare Cluster auf Kubernetes FELIX KUNDE FELIX KUNDE slides.com/fxku/postgis-k8s F O S S I G 2020

Transcript of Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL...

Page 1: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

Hochverfügbare

Cluster auf Kubernetes

FELIX KUNDEFELIX KUNDEslides.com/fxku/postgis-k8s F O S S

IG

2020

Page 2: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

ÜBER MICHÜBER MICH

GeoinformatikerJetzt Database Engineer @ Zalando

Hin und wieder Gastdozent für Datenbanken, and @FlxKu

Postgres Operator 3DCityDB pgMemento

Page 3: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

@@Wenig PostGIS, aber jede Menge PostgreSQLEarly Adopter von Kubernetes im ProduktivbetriebÜber 1400 Postgres Cluster auf KubernetesEigenes DBaaS-Produkt / Team

Page 4: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf
Page 6: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

KUBERNETES?KUBERNETES?

Page 7: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

KUBERNETES =K8SKUBERNETES =K8S

Page 8: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

MM

Server / Cloud

Registry

image: wfs:v3.0

Page 9: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

MM

Server / Cloud

Registry

image: wfs:v3.0

Page 10: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

MM

Deploymentmit Container(n)

Server / Cloud

replicas: 3

Registry

image: wfs:v3.0

Page 11: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

MM

Deploymentmit Container(n)

Server / Cloud

replicas: 3

Registry

image: wfs:v3.0

Page 12: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

MM

Deploymentmit Container(n)

Server / Cloud

replicas: 3

Registry

DeploymentControllerimage: wfs:v3.0

Page 13: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

MM

Deploymentmit Container(n)

Server / Cloud

replicas: 3

Registry

DeploymentControllerimage: wfs:v3.0

Page 14: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

MM

Deploymentmit Container(n)

Server / Cloud

replicas: 3

Registry

pull

DeploymentControllerimage: wfs:v3.0

Page 15: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

MM

Deploymentmit Container(n)

Server / Cloud

replicas: 3

Registry

pull

DeploymentControllerimage: wfs:v3.0

Page 16: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

MM

Deploymentmit Container(n)

Server / Cloud

replicas: 3

Registry

pull

DeploymentControllerimage: wfs:v3.0

Page 17: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

MM

Deploymentmit Container(n)

Server / Cloud

replicas: 3 DeploymentControllerimage: wfs:v3.0

!= 2

Page 18: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

MM

Deploymentmit Container(n)

Server / Cloud

replicas: 3 DeploymentControllerimage: wfs:v3.0

Page 19: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

MM

StatefulSetmit Container(n)

Server / Cloud

replicas: 3 StatefulSetControllerimage:

postgis:v3

MM

RR

RR

Page 20: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

MM

Postgresqlmit Container

Server / Cloud

replicas: 2image: spilo

Operator

Spilo

MM

RR

Page 21: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

apiVersion: acid.zalan.do/v1kind: Postgresqlmetadata: name: fossgis-app-dbspec: numberOfInstances: 2 postgresql: version: "12" teamId: fossgis users: app_owner: [] databases: prod_app_db: app_owner volume: size: 10Gi

Page 22: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

apiVersion: acid.zalan.do/v1kind: Postgresqlmetadata: name: fossgis-app-dbspec: numberOfInstances: 2 postgresql: version: "12" teamId: fossgis users: app_owner: [] databases: prod_app_db: app_owner volume: size: 10Gi

- Erstelle einen PostgreSQL cluster- mit dem Namen: fossgis-app-db. - Zwei Instanzen, Master & Replica- PostgreSQL 12- Team: fossgis (Rollen für Mitarbeiter)- Lege App-Nutzer app_owner an- Keine dedizierten Privilegien- Lege Datenbank prod_app_db an - Beantrage an 10GB Volume / Instanz

Page 23: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

POSTGIS-AS-A-SERVICEPOSTGIS-AS-A-SERVICE

Power to the people! Nicht nur DBAs.Auto. Rollen & sExtension Angebot und

,  & außerhalb von K8s und Hochverfügbarkeit

von und PostgreSQL Logs aus der DB abfragbar ( )

Authentifizierung managementWhitelisting

Backups WAL archiving RecoverySkalierenMonitoring Performance Incidents

file_fdw

Page 24: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

  OPENSOURCE.ZALANDO.COMOPENSOURCE.ZALANDO.COM

 ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni

 betreut Spilo auf K8s

PatroniSpiloPostgres-Operator

Page 25: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

DEMODEMO

Page 26: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

IST DAS SCHWER?IST DAS SCHWER?

Wer Docker kennt, kommt schneller reinK8s eigentlich überschaubarViel zu konfigurieren für den Prod.-BetriebLokal testen mit , etc.

1x1

Minikube Kind

Page 27: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

HAUSAUFGABEHAUSAUFGABE

Page 28: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

BRAUCHE ICH DAS?BRAUCHE ICH DAS?

In-house K8s braucht AdminsErst bei größeren Firmen, ansonsten CloudWas kann gehen?Es muss nicht K8s sein, aber Spilo schon ;)

schief

Page 29: Hochverfügbare Cluster auf Kubernetes › 2020 › attachments › ... · ist DER PostgreSQL high-availability manager ist Zalando's Postgres Image incl. Patroni betreut Spilo auf

DANKEDANKE

FELIX KUNDEFELIX KUNDEslides.com/fxku/postgis-k8s