SlideShare a Scribd company logo
1 of 33
Download to read offline
The Kubernetes Effect
by @bibryam
Who am I?
➢ Bilgin Ibryam
➢ @bibryam
➢ http://ofbizian.com/
➢ http://github.com/bibryam/
➢
Integration Architect at Red Hat
➢ Committer for Camel, OFBiz, Isis at ASF
➢ Author of Camel Design Patterns, Kubernetes Patterns
➢ Interested in Integration, Cloud Native, Blockchain
Agenda
Cloud native...
A common defnition:
Cloud Native is structuring
teams, culture and technology
to utilize automation and architectures
to manage complexity and unlock velocity.
@jbeda
A typical application:
Applications adopting the principles of
microservices packaged as
containers orchestrated by
platforms running on top of
cloud infrastructure.
A Kubernetes based microservice
Local vs distributed primitives
Distributed abstractions and primitives
● Application packaging (Container)
● Deployment unit (Pod)
● Auto scaling (HPA)
● Atomic work unit (Job)
● Recurring execution (CronJob)
● Service discovery (Service)
● Load balancing (Service)
● Application placement (Scheduler)
● Lifecycle management (Deployment)
● Health checks (liveness/readiness)
● Lifecycle hooks (PostStart/PreStop)
● Artifact grouping (Label)
● Custom Resource Defnition (CRD)
Software design principles
● KISS - Keep it simple, stupid
● DRY - Don't repeat yourself
● YAGNI - You aren't gonna need it
● SoC - Separation of concerns
● SOLID Principles by Robert C. Martin:
• Single responsibility
• Open/Closed
• Liskov substitution
• Interface segregation
• Dependency inversion
Principles represent abstract guidelines or believes that help create systems with higher-quality attributes.
The twelve-factor app i.e. the Heroku way
1. One codebase tracked in revision control, many deploys
2. Explicitly declare and isolate dependencies
3. Store confg in the environment
4. Treat backing services as attached resources
5. Strictly separate build and run stages
6. Execute the app as one or more stateless processes
7. Export services via port binding
8. Scale out via the process model
9. Maximize robustness with fast startup and graceful shutdown
10.Keep development, staging, and production as similar as possible
11. Treat logs as event streams
12.Run admin/management tasks as one-off processes
Principles of container-based application design
● Build time:
● Single Concern Principle (SCP)
● Self-Containment Principle (S-CP)
● Image Immutability Principle (IIP)
● Runtime:
● High Observability Principle (HOP)
● Lifecycle Conformance Principle (LCP)
● Process Disposability Principle (PDP)
● Runtime Confnement Principle (RCP)
https://www.redhat.com/en/resources/cloud-native-container-design-whitepaper
Single concern principle
Design patterns:
• Sidecar
• Ambassador
• Adapter
• Init-container
• Defer-container
Self-containment principle
Anti-patterns:
• Locomotive
Image immutability principle
Also known as:
• Dev/Prod parity
• Snowflakes vs Phoenix
• Impedance mismatch
High observability principle
Healthcheck implementations:
• Spring Boot Actuator
• Dropwizard Metrics
• WildFly Swarm Monitor
• MicroProfle Healthchecks
• Apache Camel
• And many others!
Lifecycle conformance principle
● Graceful shutdown:
● SIGTERM
● SIGKILL
● Lifecycle hooks:
● PreStop
● PostStart
Process disposability principle
Also known as:
● Cattle rather than pets
● Don’t rely on a particular instance.
● Be aware of shots at your cattle.
● Be robust against sudden death.
● Stateless or with replicated state
● Idempotent startup
● Graceful shutdown
Runtime confnement principle
Implications:
● Pod scheduling
● Pod auto scaling
● Pod eviction
● Pod QoS classes:
● Best Effort
● Burstable
● Guaranteed
● Capacity management
Agenda
Software design patterns
Object-oriented patterns Container orchestration patterns
A reusable solution to a reoccurring problem within a given context.
Container design patterns
Sidecar pattern
● Use cases
● Monitoring, health checks, watchdog
● Logging
● Confguration
● Networking
● Offload proxy
Specialized Sidecars
Ambassador Pattern
Proxy Pattern
● Use cases
● Reverse proxy to a heterogeneous system
● Log normalizer
● Metrics exporter
● Use cases
● Out-of-process proxy
● Resiliency
● Monitoring
● Security
Init-container pattern
● Use cases
● Wait for external dependency
● Confguration
● Initialization
More Kubernetes Patterns
Confguration Patterns
● EnvVar Confguration
● Confguration Resource
● Confguration Template
● Immutable Confguration
Advanced Patterns
● Stateful Service
● Custom Resource Descriptors
● Custom Controller
● Build Container
Immutable confguration pattern
● Use cases
● Immutable confguration data
● Large confguration fles
Confguration template pattern
● Use cases
● Complex templating logic
Custom controller/Operator patterns
Application Controller
●
Prometheus operator
●
Zookeeper operator
●
Infnspan operator
●
Strimzi - Kafka operator
Extension controllers
●
Expose controller (fabric8)
●
Confgmap controller (fabric8)
●
Linux Update Operator
Techniques and practices
• Aim for small images - this reduces container size, improves build, and deployment time.
• Support arbitrary user IDs - avoid using the sudo command or requiring a specifc user ID.
• Mark important ports - declare ports using the EXPOSE command.
• Use volumes for persistent data - the data that needs to be preserved after a container is destroyed.
• Set image metadata - Image metadata in the form of tags, labels, and annotations.
• Synchronize host and image - attributes such as time and machine ID.
• Log to STDOUT and STDERR - to ensure container logs are picked up and aggregated properly.
Agenda
Kubernetes resources
●
The Kubernetes Effect (blog post)
https://www.infoq.com/articles/kubernetes-effect
●
Principles of container-based application design (white paper)
https://www.redhat.com/en/resources/cloud-native-container-design-whitepaper
●
Design patterns for container-based distributed systems (white paper)
https://www.usenix.org/system/fles/conference/hotcloud16/hotcloud16_burns.pdf
●
Designing Distributed Systems (free ebook)
https://azure.microsoft.com/en-us/resources/designing-distributed-systems
●
Kubernetes Patterns (ebook)
https://leanpub.com/k8spatterns
●
Kubernetes in Action (ebook)
https://www.manning.com/books/kubernetes-in-action
Q & A

More Related Content

What's hot

RedisConf18 - Redis Cluster Provisioning with Kubernetes Service-Catalog Exte...
RedisConf18 - Redis Cluster Provisioning with Kubernetes Service-Catalog Exte...RedisConf18 - Redis Cluster Provisioning with Kubernetes Service-Catalog Exte...
RedisConf18 - Redis Cluster Provisioning with Kubernetes Service-Catalog Exte...
Redis Labs
 

What's hot (20)

The evolving container landscape
The evolving container landscapeThe evolving container landscape
The evolving container landscape
 
RedisConf18 - Redis Cluster Provisioning with Kubernetes Service-Catalog Exte...
RedisConf18 - Redis Cluster Provisioning with Kubernetes Service-Catalog Exte...RedisConf18 - Redis Cluster Provisioning with Kubernetes Service-Catalog Exte...
RedisConf18 - Redis Cluster Provisioning with Kubernetes Service-Catalog Exte...
 
Introduction to Container Storage Interface (CSI)
Introduction to Container Storage Interface (CSI)Introduction to Container Storage Interface (CSI)
Introduction to Container Storage Interface (CSI)
 
[WSO2Con USA 2018] Deploying Applications in K8S and Docker
[WSO2Con USA 2018] Deploying Applications in K8S and Docker[WSO2Con USA 2018] Deploying Applications in K8S and Docker
[WSO2Con USA 2018] Deploying Applications in K8S and Docker
 
Getting Started with Kafka on k8s
Getting Started with Kafka on k8sGetting Started with Kafka on k8s
Getting Started with Kafka on k8s
 
RedisConf18 - Designing a Redis Client for Humans
RedisConf18 - Designing a Redis Client for Humans RedisConf18 - Designing a Redis Client for Humans
RedisConf18 - Designing a Redis Client for Humans
 
19. Cloud Native Computing - Kubernetes - Bratislava - Databases in K8s world
19. Cloud Native Computing - Kubernetes - Bratislava - Databases in K8s world19. Cloud Native Computing - Kubernetes - Bratislava - Databases in K8s world
19. Cloud Native Computing - Kubernetes - Bratislava - Databases in K8s world
 
Kubera Launch Webinar: Kubernetes native management of Kubernetes native data
Kubera Launch Webinar: Kubernetes native management of Kubernetes native dataKubera Launch Webinar: Kubernetes native management of Kubernetes native data
Kubera Launch Webinar: Kubernetes native management of Kubernetes native data
 
Dynomite @ RedisConf 2017
Dynomite @ RedisConf 2017Dynomite @ RedisConf 2017
Dynomite @ RedisConf 2017
 
Build Robust Blockchain Services with Hyperledger and Containers
Build Robust Blockchain Services with Hyperledger and ContainersBuild Robust Blockchain Services with Hyperledger and Containers
Build Robust Blockchain Services with Hyperledger and Containers
 
Kubernetes + netflix oss
Kubernetes + netflix ossKubernetes + netflix oss
Kubernetes + netflix oss
 
[Lakmal] Automate Microservice to API
[Lakmal] Automate Microservice to API[Lakmal] Automate Microservice to API
[Lakmal] Automate Microservice to API
 
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
 
Creating a Kubernetes Operator in Java
Creating a Kubernetes Operator in JavaCreating a Kubernetes Operator in Java
Creating a Kubernetes Operator in Java
 
RedisConf18 - Video Experience Operational Insights in Real Time.
RedisConf18 - Video Experience Operational Insights in Real Time.RedisConf18 - Video Experience Operational Insights in Real Time.
RedisConf18 - Video Experience Operational Insights in Real Time.
 
7 - Monitoring Kubernetes with Elastic
7 - Monitoring Kubernetes with Elastic7 - Monitoring Kubernetes with Elastic
7 - Monitoring Kubernetes with Elastic
 
MesosCon 2016 - minimesos, the experimentation and testing tool for Apache Mesos
MesosCon 2016 - minimesos, the experimentation and testing tool for Apache MesosMesosCon 2016 - minimesos, the experimentation and testing tool for Apache Mesos
MesosCon 2016 - minimesos, the experimentation and testing tool for Apache Mesos
 
5 - Hands-on Kubernetes Workshop:
5 - Hands-on Kubernetes Workshop:5 - Hands-on Kubernetes Workshop:
5 - Hands-on Kubernetes Workshop:
 
On Prem Container Cloud - Lessons Learned
On Prem Container Cloud - Lessons LearnedOn Prem Container Cloud - Lessons Learned
On Prem Container Cloud - Lessons Learned
 
OSDC 2018 | The operational brain: how new Paradigms like Machine Learning ar...
OSDC 2018 | The operational brain: how new Paradigms like Machine Learning ar...OSDC 2018 | The operational brain: how new Paradigms like Machine Learning ar...
OSDC 2018 | The operational brain: how new Paradigms like Machine Learning ar...
 

Similar to The Kubernetes Effect

Similar to The Kubernetes Effect (20)

Cloud Native Camel Design Patterns
Cloud Native Camel Design PatternsCloud Native Camel Design Patterns
Cloud Native Camel Design Patterns
 
OSDC 2018 | Three years running containers with Kubernetes in Production by T...
OSDC 2018 | Three years running containers with Kubernetes in Production by T...OSDC 2018 | Three years running containers with Kubernetes in Production by T...
OSDC 2018 | Three years running containers with Kubernetes in Production by T...
 
Kubernetes – An open platform for container orchestration
Kubernetes – An open platform for container orchestrationKubernetes – An open platform for container orchestration
Kubernetes – An open platform for container orchestration
 
Migrating from oracle soa suite to microservices on kubernetes
Migrating from oracle soa suite to microservices on kubernetesMigrating from oracle soa suite to microservices on kubernetes
Migrating from oracle soa suite to microservices on kubernetes
 
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
 
Cloud-Native: A New Ecosystem for Putting Containers into Production
Cloud-Native:  A New Ecosystem for Putting Containers into ProductionCloud-Native:  A New Ecosystem for Putting Containers into Production
Cloud-Native: A New Ecosystem for Putting Containers into Production
 
Meetup Openshift Geneva 03/10
Meetup Openshift Geneva 03/10Meetup Openshift Geneva 03/10
Meetup Openshift Geneva 03/10
 
Breaking the Monolith Road to Containers
Breaking the Monolith Road to ContainersBreaking the Monolith Road to Containers
Breaking the Monolith Road to Containers
 
Cloud Native Practice
Cloud Native PracticeCloud Native Practice
Cloud Native Practice
 
Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications
 
DNUG46 - Build your own private Cloud environment
DNUG46 - Build your own private Cloud environmentDNUG46 - Build your own private Cloud environment
DNUG46 - Build your own private Cloud environment
 
Build your own private Cloud environment
Build your own private Cloud environmentBuild your own private Cloud environment
Build your own private Cloud environment
 
12 Factor App Methodology
12 Factor App Methodology12 Factor App Methodology
12 Factor App Methodology
 
Edge 2016 SCL-2484: a software defined scalable and flexible container manage...
Edge 2016 SCL-2484: a software defined scalable and flexible container manage...Edge 2016 SCL-2484: a software defined scalable and flexible container manage...
Edge 2016 SCL-2484: a software defined scalable and flexible container manage...
 
The Evolution of Distributed Systems on Kubernetes
The Evolution of Distributed Systems on KubernetesThe Evolution of Distributed Systems on Kubernetes
The Evolution of Distributed Systems on Kubernetes
 
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
 
Journey Through Four Stages of Kubernetes Deployment Maturity
Journey Through Four Stages of Kubernetes Deployment MaturityJourney Through Four Stages of Kubernetes Deployment Maturity
Journey Through Four Stages of Kubernetes Deployment Maturity
 
reBuy on Kubernetes
reBuy on KubernetesreBuy on Kubernetes
reBuy on Kubernetes
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kubernetes
 
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
 

More from Bilgin Ibryam

More from Bilgin Ibryam (7)

Dapr - A 10x Developer Framework for Any Language
Dapr - A 10x Developer Framework for Any LanguageDapr - A 10x Developer Framework for Any Language
Dapr - A 10x Developer Framework for Any Language
 
Modernization patterns to refactor a legacy application into event driven mic...
Modernization patterns to refactor a legacy application into event driven mic...Modernization patterns to refactor a legacy application into event driven mic...
Modernization patterns to refactor a legacy application into event driven mic...
 
Application modernization patterns with apache kafka, debezium, and kubernete...
Application modernization patterns with apache kafka, debezium, and kubernete...Application modernization patterns with apache kafka, debezium, and kubernete...
Application modernization patterns with apache kafka, debezium, and kubernete...
 
Dual write strategies for microservices
Dual write strategies for microservicesDual write strategies for microservices
Dual write strategies for microservices
 
How to financially survive while growing a small open source project
How to financially survive while growing a small open source projectHow to financially survive while growing a small open source project
How to financially survive while growing a small open source project
 
Enterprise Integration for Ethereum
Enterprise Integration for EthereumEnterprise Integration for Ethereum
Enterprise Integration for Ethereum
 
Camel Desing Patterns Learned Through Blood, Sweat, and Tears
Camel Desing Patterns Learned Through Blood, Sweat, and TearsCamel Desing Patterns Learned Through Blood, Sweat, and Tears
Camel Desing Patterns Learned Through Blood, Sweat, and Tears
 

Recently uploaded

Production 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxProduction 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptx
ChloeMeadows1
 
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
lolsDocherty
 

Recently uploaded (16)

Production 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxProduction 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptx
 
Reggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirts
 
Premier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdfPremier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdf
 
The Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyThe Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case Study
 
Pvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdf
 
Statistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdfStatistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdf
 
Thank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirtsThank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirts
 
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
 
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWebiThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
 
How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?
 
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital PresenceCyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
 
I’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 ShirtI’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 Shirt
 
Topology of the Network class 8 .ppt pdf
Topology of the Network class 8 .ppt pdfTopology of the Network class 8 .ppt pdf
Topology of the Network class 8 .ppt pdf
 
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
 
Bug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideBug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's Guide
 
Development Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of appsDevelopment Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of apps
 

The Kubernetes Effect

  • 2. Who am I? ➢ Bilgin Ibryam ➢ @bibryam ➢ http://ofbizian.com/ ➢ http://github.com/bibryam/ ➢ Integration Architect at Red Hat ➢ Committer for Camel, OFBiz, Isis at ASF ➢ Author of Camel Design Patterns, Kubernetes Patterns ➢ Interested in Integration, Cloud Native, Blockchain
  • 4. Cloud native... A common defnition: Cloud Native is structuring teams, culture and technology to utilize automation and architectures to manage complexity and unlock velocity. @jbeda A typical application: Applications adopting the principles of microservices packaged as containers orchestrated by platforms running on top of cloud infrastructure.
  • 5. A Kubernetes based microservice
  • 6. Local vs distributed primitives
  • 7. Distributed abstractions and primitives ● Application packaging (Container) ● Deployment unit (Pod) ● Auto scaling (HPA) ● Atomic work unit (Job) ● Recurring execution (CronJob) ● Service discovery (Service) ● Load balancing (Service) ● Application placement (Scheduler) ● Lifecycle management (Deployment) ● Health checks (liveness/readiness) ● Lifecycle hooks (PostStart/PreStop) ● Artifact grouping (Label) ● Custom Resource Defnition (CRD)
  • 8. Software design principles ● KISS - Keep it simple, stupid ● DRY - Don't repeat yourself ● YAGNI - You aren't gonna need it ● SoC - Separation of concerns ● SOLID Principles by Robert C. Martin: • Single responsibility • Open/Closed • Liskov substitution • Interface segregation • Dependency inversion Principles represent abstract guidelines or believes that help create systems with higher-quality attributes.
  • 9. The twelve-factor app i.e. the Heroku way 1. One codebase tracked in revision control, many deploys 2. Explicitly declare and isolate dependencies 3. Store confg in the environment 4. Treat backing services as attached resources 5. Strictly separate build and run stages 6. Execute the app as one or more stateless processes 7. Export services via port binding 8. Scale out via the process model 9. Maximize robustness with fast startup and graceful shutdown 10.Keep development, staging, and production as similar as possible 11. Treat logs as event streams 12.Run admin/management tasks as one-off processes
  • 10. Principles of container-based application design ● Build time: ● Single Concern Principle (SCP) ● Self-Containment Principle (S-CP) ● Image Immutability Principle (IIP) ● Runtime: ● High Observability Principle (HOP) ● Lifecycle Conformance Principle (LCP) ● Process Disposability Principle (PDP) ● Runtime Confnement Principle (RCP) https://www.redhat.com/en/resources/cloud-native-container-design-whitepaper
  • 11. Single concern principle Design patterns: • Sidecar • Ambassador • Adapter • Init-container • Defer-container
  • 13. Image immutability principle Also known as: • Dev/Prod parity • Snowflakes vs Phoenix • Impedance mismatch
  • 14. High observability principle Healthcheck implementations: • Spring Boot Actuator • Dropwizard Metrics • WildFly Swarm Monitor • MicroProfle Healthchecks • Apache Camel • And many others!
  • 15. Lifecycle conformance principle ● Graceful shutdown: ● SIGTERM ● SIGKILL ● Lifecycle hooks: ● PreStop ● PostStart
  • 16. Process disposability principle Also known as: ● Cattle rather than pets ● Don’t rely on a particular instance. ● Be aware of shots at your cattle. ● Be robust against sudden death. ● Stateless or with replicated state ● Idempotent startup ● Graceful shutdown
  • 17. Runtime confnement principle Implications: ● Pod scheduling ● Pod auto scaling ● Pod eviction ● Pod QoS classes: ● Best Effort ● Burstable ● Guaranteed ● Capacity management
  • 19. Software design patterns Object-oriented patterns Container orchestration patterns A reusable solution to a reoccurring problem within a given context.
  • 21. Sidecar pattern ● Use cases ● Monitoring, health checks, watchdog ● Logging ● Confguration ● Networking ● Offload proxy
  • 22.
  • 23. Specialized Sidecars Ambassador Pattern Proxy Pattern ● Use cases ● Reverse proxy to a heterogeneous system ● Log normalizer ● Metrics exporter ● Use cases ● Out-of-process proxy ● Resiliency ● Monitoring ● Security
  • 24. Init-container pattern ● Use cases ● Wait for external dependency ● Confguration ● Initialization
  • 25.
  • 26. More Kubernetes Patterns Confguration Patterns ● EnvVar Confguration ● Confguration Resource ● Confguration Template ● Immutable Confguration Advanced Patterns ● Stateful Service ● Custom Resource Descriptors ● Custom Controller ● Build Container
  • 27. Immutable confguration pattern ● Use cases ● Immutable confguration data ● Large confguration fles
  • 28. Confguration template pattern ● Use cases ● Complex templating logic
  • 29. Custom controller/Operator patterns Application Controller ● Prometheus operator ● Zookeeper operator ● Infnspan operator ● Strimzi - Kafka operator Extension controllers ● Expose controller (fabric8) ● Confgmap controller (fabric8) ● Linux Update Operator
  • 30. Techniques and practices • Aim for small images - this reduces container size, improves build, and deployment time. • Support arbitrary user IDs - avoid using the sudo command or requiring a specifc user ID. • Mark important ports - declare ports using the EXPOSE command. • Use volumes for persistent data - the data that needs to be preserved after a container is destroyed. • Set image metadata - Image metadata in the form of tags, labels, and annotations. • Synchronize host and image - attributes such as time and machine ID. • Log to STDOUT and STDERR - to ensure container logs are picked up and aggregated properly.
  • 32. Kubernetes resources ● The Kubernetes Effect (blog post) https://www.infoq.com/articles/kubernetes-effect ● Principles of container-based application design (white paper) https://www.redhat.com/en/resources/cloud-native-container-design-whitepaper ● Design patterns for container-based distributed systems (white paper) https://www.usenix.org/system/fles/conference/hotcloud16/hotcloud16_burns.pdf ● Designing Distributed Systems (free ebook) https://azure.microsoft.com/en-us/resources/designing-distributed-systems ● Kubernetes Patterns (ebook) https://leanpub.com/k8spatterns ● Kubernetes in Action (ebook) https://www.manning.com/books/kubernetes-in-action
  • 33. Q & A