running and scaling symfony app in container(s)

20
Running and Scaling Symfony app in container(s) Jussi Nummelin, Engineer@Kontena Inc. @JNummelin

Upload: kontena-inc

Post on 12-Jan-2017

222 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Running and Scaling Symfony app in container(s)

Running and Scaling Symfonyapp in container(s)

Jussi Nummelin, Engineer@Kontena Inc.

@JNummelin

Page 2: Running and Scaling Symfony app in container(s)

© 2015 Kontena, Inc.

Page 3: Running and Scaling Symfony app in container(s)

docker run –d mysql && docker run –d symfony

Running containers is easy

© 2016 Kontena, Inc.

Page 4: Running and Scaling Symfony app in container(s)

From Containers to Microservices

• Containers have dependencies with eachother

• Docker Compose• Tool for defining and running multi-container Docker applications• Services and their configurations are defined in YAML file(s)

Page 5: Running and Scaling Symfony app in container(s)

docker-compose.yml

© 2015 Kontena, Inc.

Page 6: Running and Scaling Symfony app in container(s)

Docker Containers – Best Practices

© 2015 Kontena, Inc.

Page 7: Running and Scaling Symfony app in container(s)

Docker Containers – Best practices

• Run one process per container• Config through env• Don’t rely on anything• Databases at startup• Downstream services

• Logs in stdout/stderr• Don’t rely on IP addresses

© 2015 Kontena, Inc.

Page 8: Running and Scaling Symfony app in container(s)

Rolling to production

© 2015 Kontena, Inc.

Page 9: Running and Scaling Symfony app in container(s)

Rolling to Production

• How big this app will be? How many users it will serve?• Do you want your application to be infrastructure agnostic or lean

heavily on some cloud provider?• How to run databases or save other persistent data?• How to scale the application and handle load balancing?• How do you pass sensitive data to your application and where to

store that data?• How the application can be deployed and updated with zero down-

time?

© 2015 Kontena, Inc.

Page 10: Running and Scaling Symfony app in container(s)

© 2015 Kontena, Inc.

Page 11: Running and Scaling Symfony app in container(s)

Kontena briefly

Page 12: Running and Scaling Symfony app in container(s)

© 2015 Kontena, Inc.

What is Kontena?

Open Source container platform built to maximize developer happiness. Works on

any cloud, easy to setup, simple to use.

Page 13: Running and Scaling Symfony app in container(s)

How does it work?

Kontena GridA number of physical or virtual machines – Kontena Nodes– create a Kontena Grid. The nodes may be located anywhere; in single data center, different AZs or different cloud providers.

Overlay NetworkKontena will automatically create an overlay network powered by Weave and connect all nodes of a Grid. Overlay network enable services to communicate with each other in multi-host, multi-AZ environment.

Service DiscoveryKontena has a built-in service discovery powered by etcd. It is used to automatically assign DNS addresses for any services running in Kontena. It is also used by Kontena’s load balancer for zero-downtime operation.

OrchestrationKontena’s orchestrator is distributing, running and monitoring all Kontena Services in a Grid. Services may be stateless or stateful, and they are automatically distributed across Nodes in a Grid.

Containerized WorkloadsWith Kontena, all containerized workloads are described as Services. Kontena Service is composed of containers based on the same image file. Services may be scaled and linked together to create complex elastic apps.

OS

Docker

Kontena Nodes & AgentKontena Agent may be installed to

any machine capable of running Docker. It is running as a privileged

container in a machine.

Kontena MasterKontena Master is orchestrating the

entire Kontena system. It provides APIs used by Kontena CLI, Web UI and

third party integrations.

Kontena Master may be installed as high-availability setup if needed.

Page 14: Running and Scaling Symfony app in container(s)

All Batteries Included!

Built-In Image RegistrySometimes projects can not use publicly

hosted container image registries like DockerHub. Kontena comes with built-in

container image registry providing private and secure solution.

Built-In VPN AccessAll containers are run inside a virtual private

network by default. Nothing is exposed to Internet unless explicitly defined. With

Kontena’s built-in VPN access developers can securely access those resources.

Built-In Load BalancerKontena comes with built-in load balancer.

Based on Haproxy. It features fully automatic, zero-downtime operation due to deep

integration with Kontena’s service discovery and orchestration technology.

Aggregated Stats & LogsKontena provides real-time log and statistics streams containers. The streams may be grouped and aggregated to produce service level streams. This allows easy viewing of logs and statistics for your application CPU, memory, disk and network usage.

User Management with Audit TrailAll events and actions performed through Kontena CLI or APIs are logged into audit trail. Combined with users and access control, the audit trail support makes Kontena a reliable and secure solution for any enterprise deployments.

Built-In Secrets ManagementWhen your application requires access to APIs or databases, you'll often need to use secrets such as passwords and access tokens for authenticating the access. Kontena Vault is a secure key/value storage that can be used to manage secrets in Kontena.

Page 15: Running and Scaling Symfony app in container(s)

“Includes all the sh*it you don’t need to implement by yourself”

Page 16: Running and Scaling Symfony app in container(s)

Let’s kick some tires

https://github.com/jnummelin/symfony-demo

Page 17: Running and Scaling Symfony app in container(s)
Page 18: Running and Scaling Symfony app in container(s)

Our mission is to becomenumber 1 container &

microservices platformfor developers

Page 19: Running and Scaling Symfony app in container(s)

! [email protected]

" @kontenainc

# slack.kontena.io

$ github.com/kontena/kontena

meetup.com/pro/kontena

% www.kontena.io

Stay up to date!

Page 20: Running and Scaling Symfony app in container(s)

Thank You!www.kontena.io