15
Cloud Native Patterns Bilgin Ibryam (@bibryam), Architect, Red Hat

Cloud Native Patterns

Embed Size (px)

Citation preview

Page 1: Cloud Native Patterns

Cloud Native Patterns

Bilgin Ibryam (@bibryam), Architect, Red Hat

Page 2: Cloud Native Patterns

Cloud Native in Practice

Applications adopting the principles ofMicroservices packaged asContainers orchestrated byPlatforms running on top of

Cloud infrastructure

Page 3: Cloud Native Patterns

Cloud Native Platforms

Page 4: Cloud Native Patterns

Common Abstractions and Primitives

Application packaging (Container)Deployment unit (Pod)Declarative update/rollback (Deployment)Application placement (Scheduler)Artifact grouping (Label)Resources isolation (Container/Namespace)Service discovery & load balancing (Service)

Page 5: Cloud Native Patterns

10 Cloud Native...

PrinciplesPatternsPracticesTraits

http://leanpub.com/k8spatterns/

Page 6: Cloud Native Patterns

1. Observable Interior

Process Health CheckApplication Readiness Health CheckApplication Liveness Health CheckMetric collectionLog aggregationTermination message

Page 7: Cloud Native Patterns

2. Life Cycle Conformance

SIGTERMSIGKILLPreStopPostStartReleaseMemory (may be in the future)

Page 8: Cloud Native Patterns

3. Declarative Updates

Page 9: Cloud Native Patterns

4. Predictable Resource Profile

resources.limits.cpuresources.limits.memoryresources.requests.cpuresources.requests.memoryPersistentVolumeClaim

Page 10: Cloud Native Patterns

5. Dynamic Placement

Page 11: Cloud Native Patterns

6. Service Discovery & Load Balancing

Page 12: Cloud Native Patterns

7. (Scheduled) Batch Jobs

Example batch jobs in Java

JDK TimerJDK ScheduledExecutorServiceQuartz SchedulerSpring Batch

Batch jobs in Kubernetes

Page 13: Cloud Native Patterns

8. Clustered Services

How to run a single HA instance of a service? → Pod with 1 replicaHow to initialize an application with custom steps? → Init ContainersHow to run a process on every node? → DaemonSetHow to manage a stateful service? → StatefulSet

Page 14: Cloud Native Patterns

9. Executable Application Manifest

Application binaries → ContainerDeployment unit → PodArtifact grouping → LabelsResource demands → request/limit/PVCConfigurations → ConfigMap/SecretResource management → NamespacesUpdate/rollback mechanism → Deployment

Page 15: Cloud Native Patterns

10. In Summary

1. Let the platform automate your routine tasks.(placement, updates, healthchecks, self-healing, auto-scaling)

2. Move XFR/NFR from your application to the platform.(service discovery, job mgmt, config mgmt, log aggregation, metric collection, etc)

3. Allow Developers to focus on the business domain.(show creativity and talent to create great domain designs, hidden behind beautiful APIs)