how the hell do i run my microservices in production, and will it scale?
Post on 21-Mar-2017
144 Views
Preview:
TRANSCRIPT
Daniël van Gils @foldingbeauty daniel@cloud66.com
www.cloud66.com
!
"
How the hell do I run Microservice in Production?...
and will it scale?
%
''
containers
% %%%%%
%
bin/libs
os
&
bin/libs bin/libs
(
)
*+
&
'server
os
bin/libs
)
,
''
cloud/VM
os
bin/libs
&
(
)
'os
bin/libs
$ service
% containers
server cluster(s)'
image%#
%%
= code
= docker file
= docker engine
= platform
%
build
ship
deploy
%#
“The right image need at least 5 kisses” kiss = keep an image s…, smart ass
slim secure speedy stable set
SLIM Start with the smallest minimal image you can find and trust. Remove compile time dependencies. Remove packages you don’t need. Squash layers to reduce size. Run stats for the image. habitus.io
%#
SECURE Remove all the secrets. Patch to the latest security updates. Run the image with the right UID. Test the image. https://github.com/docker/docker-bench-security
%#
SET Use volumes wisely, use external services for persistency, don’t abuse host system. Loosely coupled. Remove things which are hard to maintain in production.
%#
$
%#
%
/
splitting monolith containerisation ± 6%
%#api 6x
frontend 1x %#
%
workers 10x
%%%%%%%%%
image frontend FAT
image api THIN
image workers THIN
%%%%%%
$
%#
0/
%#A 6x
B 12x %#
%
C 10x
%%%%%%%%%
image B THIN
image A THIN
image C THIN
%%%%%%
microservice architecture ± 4%
%%%%%%%
%%%%%
message queue
LIFECYCLE Have an image guideline. Create a workflow using the same image in all the software cycle stages. From design to production mimic the environment. Test heavily.
1/
ORCHESTRATION Provisioning nodes. Networking. Isolation of services. Self healing. iOi = Infrastructure on Infrastructure.
12
DISCOVERY Find your services and datasources with minimal code change. Versioning of running services. Automagically update discovery when services come and go.
13
SCALING/SCHEDULING Scale your service (= more running containers). Scale your nodes. Scale your on/off jobs. Failover groups. Hybrid infrastructure. Load balancing.
14
MONITORING Get all the statistics of resources (mem/load/net/res) used. Aggregating of logs. Key debugging ingredient.
15
SECURITY Node and Engine level. Intrusion detection and prevention systems. DoS protection. Firewall. Segregate container groups Verification of images.
11
When you get DevOps right, Microservices architecture right and creating the right minimal lovable Image and having the right platform to run containers. Happy Camper.#
www.cloud66.com blog.cloud66.com habitus.io startwithdocker.com
Daniël van Gils @foldingbeauty daniel@cloud66.com
www.cloud66.com
!
"
```
%#
top related