4. Train microservices
Microservices architecture magnifies the need for:
● Fairly homogenous build artifacts
● Standard running platform
● Configuration and secret management
● Service Discovery
5. Polyglot programming
● Pick right tool for the job
● Multiple teams with different expertise/perspectives
● Keep developers busy learning new language(s)
6. Homogenous build artifacts
Build artifacts:
● Java Jar and War files
● Ruby Gems and Rails apps
● Node packages and apps
● Go binaries
Containerise everything (Docker):
● Universally deployable artifact
10. Configuration management
● Train your app:
○ 12-factor app
● Configuration in a containerised world:
○ Log to stdout
○ Port mappings (from host to container)
○ SaaS blob storage (mount volumes only if providing a storage service)
○ Service discovery (Consul, Eureka, DNS)
○ Secrets (ideally only in memory but how?)
○ Environment Variables for everything else
11. Configuration management tools
● Docker compose
○ State management? Templating? Secrets? Service discovery? Cluster-
level volumes?
● Ansible Role (classic host-based approach + docker module)
● Kubernetes (container PaaS)
12. Kubernetes key resources
● Namespace
● Pod (container)
● Replica Set
● ConfigMap
● Secret
● Service
● Deployment
13. Kubernetes Master
API Server Replica Set
kubelet
Node
Pod
Container
Pod
Container
kubelet
Node
Pod
Container
Kubernetes Cluster
= Label
= Resource
= Process
18. Service discovery
● DNS
○ Take extra care when playing with fire
○ No control over client
○ Time sensitive protocol
○ Use only if you have a reliable DNS service, i.e. AWS Route53
● Provided environment variables
○ MY_DROGON_SERVICE_HOST=10.0.0.11
MY_DROGON_SERVICE_PORT=8080
○ Create services before using them in pods
○ Only works per namespace
● Kubernetes REST API
○ GET /api/v1/namespaces/{namespace}/services/{service_name}
DNS
HAZARD