This document provides 10 tips for designing cloud native applications using Kubernetes. It discusses determining if Kubernetes is needed based on requirements like scalability and availability needs. It also covers choosing frameworks that work well with containers and Kubernetes, ensuring fast startup times, enabling observability from the start, integrating with CI/CD pipelines, using environment variables and config maps for configuration, and best practices for efficient logging.
15. «Any organization that designs a
system (defined broadly) will
produce a design whose structure
is a copy of the organization's
communication structure.»
— M. Conway
15
16. What’s the associated RACI ?
Is your organisation compatible?
16
RACI &
Responsabilies
18. 18
Codebase
One codebase tracked in revision
control, many deploys
Dependencies
Explicitly declare and isolate
dependencies
Config
Store config in the environment
Backing Services
Treat backing services as attached
resources
Build, release, run
Strictly separate build and run
stages
Backing Services
Treat backing services as attached
resources
Processes
Execute the app as one or more
stateless processes
Port Binding
Export services via port binding
Disposability
Maximize robustness with fast
startup and graceful shutdown
Dev/prod parity
Keep development, staging, and
production as similar as possible
Logs
Treat logs as event streams
Admin processes
Run admin/management tasks as
one-off processes
Source: https://12factors.net
24. 24
Items to check
✓ Fast startup
✓ Shutdown handling
✓ Ability to be integrated into Docker and K8S
✓ Observability
✓ Memory and CPU consumption
✓ Dependency and patch management
25. TOMCAT vs FAT JARS
→ Production – Development teams trade-off
25
27. Address this point from
design phase
Don’t wait for the production deployment
Expose your system status through endpoints
Be careful to the used FRAMEWORKS
27
34. Steps to integrate in
your CI/CD pipeline
✓ Unit and integration tests
✓ Docker image creation
✓ Created docker image “Smoke tests”
✓ Continuous deployment of your develop branch
✓ HELM charts deployment
✓ Release deployment
✓ ...
34
50. Best practices
Indicate in your LOGS:
Container informations (image name, container ID,…)
Kubernetes related informations (POD @IP, POD ID,
namespace,...)
Log4j Docker Support – Log4j Kubernetes Support
50
51. To go further
You can identify the related informations of the APIs calls:
Caller ID, Correlation ID, request data,…
zalando/logbook: An extensible Java library for HTTP request and response
logging
51
52. Distributed tracing
You can identify and correlate your API calls on your
microservices based architecture by implement
Opentracing
52