23
eZ Platform on Kubernetes Managing services running in Linux containers known as Docker technology

Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Embed Size (px)

Citation preview

Page 1: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

eZ Platform on Kubernetes

Managing services running in Linux containers known as Docker technology

Page 2: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Björn Dieding (about me)Degree in computer scienceWorking for over 13 years for my own companyDoing technical and strategic advisory

Believes open source is often the better choice.

Page 3: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

xrow GmbH (about us)We plan and deliver content & commerce solutions and digital processes.We deploy applications in business critical environments and make them scale.We select, aggregate and integrate open source technology and combine them for the benefit of the client.Located in Hannover Germany

Photo: Axel Hindemith

Page 4: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Virtual Maschines vs Docker Containers

Source: Docker, Crisp Research 2014

Page 5: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Containers: Advantages for the developer• Save, clean and portable runtime for applications• Puts all the dependencies inside the container• Hassle-free deployments• Each application is an isolated and versioned container

„Once it is build – it will run anywhere“

Page 6: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Container: Advantages for the administrator• There are no inconsistencies between test and production

environments • Fast deployments (continuous deployment / continuous integration)• A standard format for developers to ship applications• Containers have better performance

„Once configured – it runs everywhere“

Page 7: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Administrator:

„Doctor Evil, containers will not run in your datacenter all alone. You would need Kubernetes to take care of them.“

Page 8: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)
Page 9: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

What is it Kubernetes?• is a cluster management software• donated by Google and released as open source in 2014• supported by Red Hat• it’s used as the base of Google’s Cloud Platform and Red

Hat’s Open Shift• It`s users are SAP, EBAY, Wikimedia, New York Times

“A platform for automating deployment, scaling, and operations of application containers across clusters of hosts"

Page 10: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Cockpit

Page 11: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Kubernetes infrastructure

Page 12: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Kubernetes Services

Page 13: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Features of Kubernetes• enabling composite

applications and preserving the one-application-per-container model• mounting storage systems• distributing secrets• application health checking• replicating application

instances• horizontal auto-scaling

• naming and discovery• load balancing• rolling updates• resource monitoring• log access• support for introspection and

debugging• identity and authorization

Page 14: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Continuous Delivery Pipeline

Page 15: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Kubernetes DictionaryPODLogical grouping of one or more containersReplication ControllerTakes care that containers are properly distributedNamespaceGrouping of PODs. Security barrier between applications.NodePhysical or virtual maschineServiceIs the loadblanced endpoint of one application.MasterDevOps go there to bring change to the cluster.

LabelYou can tag pods and services. Common labels are the version number, the project name or the application name.SchedulerThe component that decides to which node a pod is bound. API ServerThe one and only Kubernetes API to which all parts of the software talk to it.ProxyThe proxy knows how to route traffic, if users and services request data from services.JobA task that is executed also in paralell on many nodes.

Page 16: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Rolling update

Service eZ Studio

eZ Studio1.5.0

eZ Studio1.5.0

eZ Studio1.5.0

eZ Studio1.5.1

eZ Studio1.5.1

eZ Studio1.5.1

Node Node Node

Page 17: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Failover Container Crash

Service eZ Studio

eZ Studio1.5.0

eZ Studio1.5.0

eZ Studio1.5.0

Node Node Node

eZ Studio1.5.0

Page 18: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Failover Node Crash

Service eZ Studio

eZ Studio1.5.0

eZ Studio1.5.0

Node

eZ Studio1.5.0

Node Node

eZ Studio1.5.0

Page 19: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Autodiscovery of services$url = "https://10.254.0.1:443/api/v1/namespaces/project123-prod/services"; $json = json_decode(file_get_contents($url));$ip = $this->services->items["mariadb"]->spec->clusterIP;$container->setParameter("database_server", $ip );

• Read all services from the API• Set the proper parameters in your symfony application

Page 20: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

PODs / Containers for a eZ platform• Mariadb• Memcached• SOLR• Postfix / SMTP• eZ platform webserver• eZ platform cron• Varnish (Optional)

Page 21: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Perils of Kubernetes / Docker• Filesystem wisely. They all have different features. • RENAME function is limited in AUFS and OverlayFS• Make sure the NFS is fast enough• Take your time to get used to all a new software pieces• Beware of kernels. Newer kernels have more features, but might be not as

secure.• Clean up your systems regulary. Rotating containers leaves a lot of junk on

disk.• Warm your caches before taking containers online.• Some apps still need to get configured per customer.

Page 22: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Recommended Rollout ScenariosPAAS Provider

7 GB RAM

5 GB Storage

Kubernetes on AWS

90 GB RAM12 Cores200 GB Storage

Kubernetes on bare metal

384 GB RAM36 Cores2000 GB Storage

Page 23: Running eZ Platform on Kubernetes (presented by Björn Dieding at eZ Conference 2016)

Björn [email protected]