SlideShare une entreprise Scribd logo
1  sur  46
Matthias Lübken
Container Patterns
@luebken
“ Easily create lightweight, portable,
self-sufficient containers
from any application.”
“App Container (appc) is a well-specified and
community developed specification for
application containers. ”
nginx
Proxy
Rails
Frontend
A Go
Backend
A Node
Backend
An Application
Reuse
How does a good building block look like?
How do we assemble them?
Related Work
• 12factor.net apps
• Cloud-native application architectures:
Matt Stine Free Ebook
• Microservices
• Continuous Delivery
Container Patterns
•For designing “cloud” applications.
•Container runtime agnostic.
•Are there general applicable patterns?
•How would we describe them?
•What are concrete examples and best-practices?
github.com/luebken/container-patterns
How does a good building block look like?
How do we assemble them?
“Module-Container”
A “Module-Container” is a well behaving
building block in the architecture of an
application.
A Module Container is
1. Linux process
2. API
3. Descriptive
4. Disposable
5. Immutable
6. Self-contained
7. Small
1.Linux Process
1. Linux Process
• React to signals
• Return exit codes
• Use standard streams
• Handle arguments
Examples: module-container.md#1-linux-process
2. API
2. API
• ENV variables
• Available ports
• Volume mounts
• Lifecycle hooks
Examples: module-container.md#2-api
3. Descriptive
3. Descriptive
• Use standard labels (e.g. proposal generic labels)
• url, summary, vcs-url …
• Use custom labels:
• api.ENV
• api.EXPOSE
• api.LINKS
Examples: module-container.md#3-descriptive
POC github.com/luebken/container-api
4. Disposable
4. Disposable
• Don’t rely on a particular instance
• Be aware of shots at your cattle
• Be robust against sudden death
Examples: module-container.md#4-disposable
5. Immutable
5. Immutable
• Don’t change your container after build
• Strive or a dev/prod parity
Examples: module-container.md#5-immutable
6. Self-contained
6. Self-contained
• Add dependencies on build time
• Sensible defaults
Examples: module-container.md#6-self-contained
7. Small
7. Small
• Don’t use large base images
• Use the minimal footprint e.g. Alpine
Examples: module-container.md#6-small
Recap: A Module Container is
1. Linux process
2. API
3. Descriptive
4. Disposable
5. Immutable
6. Self-contained
7. Small
How does a good building block look like?
How do we assemble them?
nginx
Proxy
Rails
Frontend
A Go
Backend
A Node
Backend
nginx
Proxy
Rails
Frontend
A Go
Backend
A Node
Backend
Redis
Cache
Logging
Adapter
Service
Ambassador
A group of closely related containers. Deployed
as a single unit
and share namespaces.
A Node
Backend
Redis
Cache
Logging
Adapter
Service
Ambassador
Pattern: Sidecar / Sidekick
Enhance & extend the main container.
K8S: transparently. Netflix: platform features.
UDSA Node
Backend
MAIN CONTAINER
Redis
Cache
SIDECAR
Pod
A Node
Backend
Redis
Cache
Logging
Adapter
Service
Ambassador
Pattern: Adapter
Standardise and normalize output.
E.g. logging and metrics.
localhost or
A Node
Backend
MAIN CONTAINER
Logging
Adapter
ADAPTER
Pod
A Node
Backend
Redis
Cache
Logging
Adapter
Service
Ambassador
Proxy a local connection to the world:
Service Discovery, Client Side LB, Circuit Breaker
A Node
Backend
MAIN CONTAINER
Service
Discovery
AMBASSADOR
Pattern: Ambassador
localhost
(Pod)
Pattern: Container chains
Defined order of starting and stopping sidecar containers.
A Node
Backend
MAIN CONTAINER
Storage
Config
SIDECAR
Discovery
SIDECAR
Network
Config
SIDECAR
(Pod)
Summary: Container Patterns QCON 08.03.2016
Module container
1. Linux process
2. API
3. Descriptive
4. Disposable
5. Immutable
6. Self-contained
7. Small
Composite
• Sidecar
• Adapter
• Ambassador
• Chains
How does a good
building block look
like?
And how would you
assemble them?
github.com/luebken/container-patterns @luebken
matthias@luebken.com
Dankeschön.
@luebken
Credits
• https://www.flickr.com/photos/skynoir/8241460998 (Cover image)
• https://www.flickr.com/photos/amlz/8664728590 (Lego)
• https://www.flickr.com/photos/guidedbycthulhu/6810361241 (Socket)
• https://www.flickr.com/photos/seektan/2074853585/ (Label)
• https://www.flickr.com/photos/gullevek/2122873934 (Trash)
• https://www.flickr.com/photos/grantmac/4852826923 (Lock)
• https://www.flickr.com/photos/mhirano/13236048424 (Hand)

Contenu connexe

Tendances

Tendances (20)

OpenTelemetry For Developers
OpenTelemetry For DevelopersOpenTelemetry For Developers
OpenTelemetry For Developers
 
The Future of Service Mesh
The Future of Service MeshThe Future of Service Mesh
The Future of Service Mesh
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
 
OpenTelemetry For Operators
OpenTelemetry For OperatorsOpenTelemetry For Operators
OpenTelemetry For Operators
 
Adopting OpenTelemetry
Adopting OpenTelemetryAdopting OpenTelemetry
Adopting OpenTelemetry
 
Practical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdfPractical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdf
 
Kubernetes architecture
Kubernetes architectureKubernetes architecture
Kubernetes architecture
 
GitOps is IaC done right
GitOps is IaC done rightGitOps is IaC done right
GitOps is IaC done right
 
Everything You Need To Know About Persistent Storage in Kubernetes
Everything You Need To Know About Persistent Storage in KubernetesEverything You Need To Know About Persistent Storage in Kubernetes
Everything You Need To Know About Persistent Storage in Kubernetes
 
Turning Virtual Machines Cloud-Native using KubeVirt
Turning Virtual Machines Cloud-Native using KubeVirtTurning Virtual Machines Cloud-Native using KubeVirt
Turning Virtual Machines Cloud-Native using KubeVirt
 
OpenShift Overview
OpenShift OverviewOpenShift Overview
OpenShift Overview
 
An overview of the Kubernetes architecture
An overview of the Kubernetes architectureAn overview of the Kubernetes architecture
An overview of the Kubernetes architecture
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerization
 
Kubernetes - introduction
Kubernetes - introductionKubernetes - introduction
Kubernetes - introduction
 
Kubernetes Architecture
 Kubernetes Architecture Kubernetes Architecture
Kubernetes Architecture
 
Présentation docker et kubernetes
Présentation docker et kubernetesPrésentation docker et kubernetes
Présentation docker et kubernetes
 
Azure container instances
Azure container instancesAzure container instances
Azure container instances
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Aks pimarox from zero to hero
Aks pimarox from zero to heroAks pimarox from zero to hero
Aks pimarox from zero to hero
 

En vedette

AWS April Webianr Series - How Willbros Builds Securely in AWS with Trend Micro
AWS April Webianr Series - How Willbros Builds Securely in AWS with Trend MicroAWS April Webianr Series - How Willbros Builds Securely in AWS with Trend Micro
AWS April Webianr Series - How Willbros Builds Securely in AWS with Trend Micro
Amazon Web Services
 

En vedette (20)

Hack-Proof Your Cloud: Responding to 2016 Threats | AWS Public Sector Summit ...
Hack-Proof Your Cloud: Responding to 2016 Threats | AWS Public Sector Summit ...Hack-Proof Your Cloud: Responding to 2016 Threats | AWS Public Sector Summit ...
Hack-Proof Your Cloud: Responding to 2016 Threats | AWS Public Sector Summit ...
 
AWS April Webianr Series - How Willbros Builds Securely in AWS with Trend Micro
AWS April Webianr Series - How Willbros Builds Securely in AWS with Trend MicroAWS April Webianr Series - How Willbros Builds Securely in AWS with Trend Micro
AWS April Webianr Series - How Willbros Builds Securely in AWS with Trend Micro
 
Highly scalable caching service on cloud - Redis
Highly scalable caching service on cloud - RedisHighly scalable caching service on cloud - Redis
Highly scalable caching service on cloud - Redis
 
The SOLID Principles Illustrated by Design Patterns
The SOLID Principles Illustrated by Design PatternsThe SOLID Principles Illustrated by Design Patterns
The SOLID Principles Illustrated by Design Patterns
 
Liquibase & Flyway @ Baltic DevOps
Liquibase & Flyway @ Baltic DevOpsLiquibase & Flyway @ Baltic DevOps
Liquibase & Flyway @ Baltic DevOps
 
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
Containers, Clusters and Kubernetes - Brendan Burns - Defrag 2014
 
An introduction to AWS Direct Connect
An introduction to AWS Direct ConnectAn introduction to AWS Direct Connect
An introduction to AWS Direct Connect
 
Unique Ways Veritas can Supercharge your AWS Investment - Session Sponsored b...
Unique Ways Veritas can Supercharge your AWS Investment - Session Sponsored b...Unique Ways Veritas can Supercharge your AWS Investment - Session Sponsored b...
Unique Ways Veritas can Supercharge your AWS Investment - Session Sponsored b...
 
AWS re:Invent 2016: Hybrid Architectures: Bridging the Gap to the Cloud( ARC2...
AWS re:Invent 2016: Hybrid Architectures: Bridging the Gap to the Cloud( ARC2...AWS re:Invent 2016: Hybrid Architectures: Bridging the Gap to the Cloud( ARC2...
AWS re:Invent 2016: Hybrid Architectures: Bridging the Gap to the Cloud( ARC2...
 
Business Continuity & Disaster Recovery with Microsoft Azure
Business Continuity & Disaster Recovery with Microsoft AzureBusiness Continuity & Disaster Recovery with Microsoft Azure
Business Continuity & Disaster Recovery with Microsoft Azure
 
DockerCon SF 2015: The Distributed System Toolkit
DockerCon SF 2015: The Distributed System ToolkitDockerCon SF 2015: The Distributed System Toolkit
DockerCon SF 2015: The Distributed System Toolkit
 
Containers: Life Beyond Microservices? by Sushil Kumar, Robin Systems
Containers: Life Beyond Microservices? by Sushil Kumar, Robin SystemsContainers: Life Beyond Microservices? by Sushil Kumar, Robin Systems
Containers: Life Beyond Microservices? by Sushil Kumar, Robin Systems
 
Establishing a Scalable, Resilient Web Architecture | AWS Public Sector Summi...
Establishing a Scalable, Resilient Web Architecture | AWS Public Sector Summi...Establishing a Scalable, Resilient Web Architecture | AWS Public Sector Summi...
Establishing a Scalable, Resilient Web Architecture | AWS Public Sector Summi...
 
AWS Webcast - High Availability with Route 53 DNS Failover
AWS Webcast - High Availability with Route 53 DNS FailoverAWS Webcast - High Availability with Route 53 DNS Failover
AWS Webcast - High Availability with Route 53 DNS Failover
 
(SDD408) Amazon Route 53 Deep Dive: Delivering Resiliency, Minimizing Latency...
(SDD408) Amazon Route 53 Deep Dive: Delivering Resiliency, Minimizing Latency...(SDD408) Amazon Route 53 Deep Dive: Delivering Resiliency, Minimizing Latency...
(SDD408) Amazon Route 53 Deep Dive: Delivering Resiliency, Minimizing Latency...
 
Shipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerShipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with Docker
 
Advanced Approaches to Amazon VPC and Amazon Route 53 | AWS Public Sector Sum...
Advanced Approaches to Amazon VPC and Amazon Route 53 | AWS Public Sector Sum...Advanced Approaches to Amazon VPC and Amazon Route 53 | AWS Public Sector Sum...
Advanced Approaches to Amazon VPC and Amazon Route 53 | AWS Public Sector Sum...
 
AWS re:Invent 2016: Reinventing Disaster Recovery Leveraging AWS Cloud Infras...
AWS re:Invent 2016: Reinventing Disaster Recovery Leveraging AWS Cloud Infras...AWS re:Invent 2016: Reinventing Disaster Recovery Leveraging AWS Cloud Infras...
AWS re:Invent 2016: Reinventing Disaster Recovery Leveraging AWS Cloud Infras...
 
Architecting for Resiliency
Architecting for ResiliencyArchitecting for Resiliency
Architecting for Resiliency
 
20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles
 

Similaire à Container Patterns

Building a server platform with os gi
Building a server platform with os giBuilding a server platform with os gi
Building a server platform with os gi
Dileepa Jayakody
 
Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...
Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...
Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...
mfrancis
 
Why Kubernetes as a container orchestrator is a right choice for running spar...
Why Kubernetes as a container orchestrator is a right choice for running spar...Why Kubernetes as a container orchestrator is a right choice for running spar...
Why Kubernetes as a container orchestrator is a right choice for running spar...
DataWorks Summit
 

Similaire à Container Patterns (20)

Patterns in a Containerized World (Matthias Luebken Technology Stream)
Patterns in a Containerized World (Matthias Luebken Technology Stream)Patterns in a Containerized World (Matthias Luebken Technology Stream)
Patterns in a Containerized World (Matthias Luebken Technology Stream)
 
Ci with jenkins docker and mssql belgium
Ci with jenkins docker and mssql belgiumCi with jenkins docker and mssql belgium
Ci with jenkins docker and mssql belgium
 
Dockers and kubernetes
Dockers and kubernetesDockers and kubernetes
Dockers and kubernetes
 
Containers, microservices and serverless for realists
Containers, microservices and serverless for realistsContainers, microservices and serverless for realists
Containers, microservices and serverless for realists
 
Microservices Architecture and Containers.
Microservices Architecture and Containers.Microservices Architecture and Containers.
Microservices Architecture and Containers.
 
Microfrontends Monoreops & Trunkbased based
Microfrontends Monoreops & Trunkbased basedMicrofrontends Monoreops & Trunkbased based
Microfrontends Monoreops & Trunkbased based
 
Top java script frameworks ppt
Top java script frameworks pptTop java script frameworks ppt
Top java script frameworks ppt
 
Demystifying Containerization Principles for Data Scientists
Demystifying Containerization Principles for Data ScientistsDemystifying Containerization Principles for Data Scientists
Demystifying Containerization Principles for Data Scientists
 
Short-Training asp.net vNext
Short-Training asp.net vNextShort-Training asp.net vNext
Short-Training asp.net vNext
 
Building a server platform with os gi
Building a server platform with os giBuilding a server platform with os gi
Building a server platform with os gi
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
 
Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...
Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...
Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...
 
Building a Modular Server Platform with OSGi
Building a Modular Server Platform with OSGiBuilding a Modular Server Platform with OSGi
Building a Modular Server Platform with OSGi
 
BRKSDN-2115
BRKSDN-2115 BRKSDN-2115
BRKSDN-2115
 
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
DC Titanium User Group Meetup: Appcelerator Titanium Alloy jan2013
 
Rami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerRami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with Docker
 
Microservices: How loose is loosely coupled?
Microservices: How loose is loosely coupled?Microservices: How loose is loosely coupled?
Microservices: How loose is loosely coupled?
 
Chicago Microservices Integration Talk
Chicago Microservices Integration TalkChicago Microservices Integration Talk
Chicago Microservices Integration Talk
 
Containers, Serverless and Functions in a nutshell
Containers, Serverless and Functions in a nutshellContainers, Serverless and Functions in a nutshell
Containers, Serverless and Functions in a nutshell
 
Why Kubernetes as a container orchestrator is a right choice for running spar...
Why Kubernetes as a container orchestrator is a right choice for running spar...Why Kubernetes as a container orchestrator is a right choice for running spar...
Why Kubernetes as a container orchestrator is a right choice for running spar...
 

Plus de Matthias Luebken

Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless world
Matthias Luebken
 
Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless world
Matthias Luebken
 
Verbessertes Feedback durch Peerreview
Verbessertes Feedback durch PeerreviewVerbessertes Feedback durch Peerreview
Verbessertes Feedback durch Peerreview
Matthias Luebken
 

Plus de Matthias Luebken (14)

Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless world
 
Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless world
 
Eine Einführung in Docker
Eine Einführung in DockerEine Einführung in Docker
Eine Einführung in Docker
 
How to scale product development when you no longer fit in one room
How to scale product development when you no longer fit in one roomHow to scale product development when you no longer fit in one room
How to scale product development when you no longer fit in one room
 
How to scale product development when you no longer fit in one room
How to scale product development when you no longer fit in one roomHow to scale product development when you no longer fit in one room
How to scale product development when you no longer fit in one room
 
Docker Introduction – @ Agile Bonn
Docker Introduction – @ Agile BonnDocker Introduction – @ Agile Bonn
Docker Introduction – @ Agile Bonn
 
“Und wie war ich so?”
Feedback in Unternehmen
“Und wie war ich so?”
Feedback in Unternehmen“Und wie war ich so?”
Feedback in Unternehmen
“Und wie war ich so?”
Feedback in Unternehmen
 
Home- (office) ?
Home- (office) ?Home- (office) ?
Home- (office) ?
 
Staying Startup
Staying StartupStaying Startup
Staying Startup
 
Talk: Staying Startup at Interactive-Cologne
Talk: Staying Startup at Interactive-CologneTalk: Staying Startup at Interactive-Cologne
Talk: Staying Startup at Interactive-Cologne
 
Verbessertes Feedback durch Peerreview
Verbessertes Feedback durch PeerreviewVerbessertes Feedback durch Peerreview
Verbessertes Feedback durch Peerreview
 
Mobile WebApps
Mobile WebAppsMobile WebApps
Mobile WebApps
 
Mobile Webapps Entwicklung
Mobile Webapps EntwicklungMobile Webapps Entwicklung
Mobile Webapps Entwicklung
 
Mobile Webapps Motivation
Mobile Webapps MotivationMobile Webapps Motivation
Mobile Webapps Motivation
 

Dernier

"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 

Dernier (20)

Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 

Container Patterns

Notes de l'éditeur

  1. About me developer: OSGi, {team, group, department} lead product guy Slides and code examples will be available online
  2. Docker introduced the term “application container”. Containers are not just a lightweight VM.
  3. Others have incorporated that term like the appc standard.
  4. An application usually consists of multiple containers. How would I design my containers that they well behave in my application?
  5. Let’s take a close look the building blocks. What color, size? Kind of connectors? Reasons for having multiple building blocks.
  6. These are the questions we should ask ourselves when designing and developing applications with containers.
  7. There is a lot related work / prior art: Modules, Distributed systems, Continuos integration See especially cloud native / paas experience.
  8. We need to remember that a container is foremost a Linux process. Which is separated by namespaces and controlled by cgroups.
  9. React to signals Use the `exec` form Catch signals: SIGINT: Interrupt by Ctrl-C, SIGTERM: Process termination by schedular like `docker stop` Return exit codes: `0` for successful termination, `>0` for a failure Handle arguments: Use conventions like POSIX or a library Use standard streams Use standard out for logging let the infrastructure (or sidecar) handle the forwarding
  10. env usage was proposed by 12Factor easy to change between deploys, no danger go checking in set default in image and let user overwrite with `docker -e` use simple tools like `envtpl` https://github.com/andreasjansson/envtpl ports: use `EXPOSE` they will show up in `docker ps` and `docker inspect` can be enforced with `iptables = true` && `icc = false volume mounts different patterns depend on this like data-container hooks sometimes the container lifecycle is not enough. e.g. database init kubernetes and runc have them. you can build them with docker events
  11. TODO: schema for labels
  12. start with `docker — rm` many reasons for a container instance going away Rescheduling because of limit or bad resources Down-scaling Errors within the container Migration to new hardware / locality of services Be robust against sudden death. Minimal setup Counter argument: OPs argues they want to keep as much as possible after a crash TODO what does kubernetes do with logs Pets vs. Cattle: Treat your container as part of a cattle. You number them and when get sick you shoot them Note: Most argued slide so far.
  13. dev / prod parity extract runtime state in volumes Anti-pattern: `docker exec`
  14. E.g. Build Uber-Jar and include webserver Generate dynamic config files on the fly.: confd
  15. Build from scratch Use small base-image busybox, alpine Reuse custom base image Anti-Pattern: VM Container
  16. You can hook up containers just as ordinary services. Let’s look into something special with containers.
  17. Hands up: Who knows Docker? Who knows Pods? Pods: Kubernetes and rkt. (Docker working on something?) Share all available namespaces Network, IPC, UTS (hostname), Volumes, PID The pod as a whole can be limited or the individual container.
  18. A general pattern about adding functionality for the main container Netflix: coined the term for adding platform features Burns: uses examples with transparent sidecars
  19. Special purpose side-car Full-fill a contract to the outside e.g.Present a consistent interface for a monitoring system
  20. All connections are proxied by the Ambassadors Resolves endpoint and establish connections More logic like client-side load balancing circuit breakers Pods optional: depend on the implementation Coined by Docker implemented using Docker links Next brought to a wider audience by CoreOS using etcd Nowadays seen many times using Consul
  21. starting all containers at once will end in chaos (e.g. storage not being ready for example) some things have to wait on each other (e.g. discovery needs network access) shutdowns also have order (e.g. de-register a consul node before the node backend shuts down & finish open requests) an error in one of the process will result in a restart of the whole chain Implementation Basically we are talking about requirements for an init process with systemd with attributes e.g. “Requires=” and “After=” But also custom implementations (e.g. a Golang binary taking care of this) // Wandering how this could be implemented with Kubernetes The example: Storage: ensure that the volume data that the container requires is available Network: setup network for custom networks like weave or shared network between user pods Main Container: Well, thats your business service, man! Discovery: Announce the world that your business is running! So other services can use it. Note: Pods are fro many use-cases optional. Most containers shown here do need to run as a group (start together, die together), but not necessarily run in the same cgroups/namespaces etc.