Microserviceswith Google Kubernetes Engine
Overview:
Why microservices?
The downside of microservices
Are microservices for your organization?
Architecting for microservices
Agenda
Kubernetes
Istio
Overview of Microservices
Why microservices?
1. Agility
Easier to manage releases and fixes; changes can be targeted instead of having to install the entire application.
Why microservices?
2. Small Code / Small Team
Single feature team handles build/test/deploy; small code base minimizes outside dependencies and makes change acceleration possible.
Why microservices?
3. Resiliency
Individual microservice faults do not affect entire application.
Why microservices?
4. Scalability
Microservices scale independently of each other.
Why microservices?
5. Data Isolation
Easier to perform schema updates with data segregation.
How Microservices
The downside of microservices
1. Data DistributionEach service manages its own data, keeps services decoupled but poses challenge to data integrity and redundancy.
The downside of microservices
2. Network ChallengesMore microservices equals more network traffic which can lead to additional network latency affecting performance.
The downside of microservices
3. Client CommunicationWith n number of services, an API gateway may need to be created and managed to communicate with the application.
The downside of microservices
4. CI/CDIt is mandatory to have this in place before deploying a microservices architecture for your application.
Are microservices for you?
Domain Driven Design (DDD)focus on business processes over technology processes
Is your software development process conducive of DDD (iterative, ubiquitous language)
Hexagonal Architecture - defines conceptual layers of code responsibility and ways to decouple code between those layers
Architecting for Microservices
Kubernetes
Kubernetes Node Kubernetes Node
Kubernetes Master
Originally developed by Google, which they use to deploy and scale internal enterprise applications such as Gmail and YouTube.
An open source orchestrator for deploying and managing containerized applications at scale.
About Kubernetes
API Server
Controller Manager
Scheduler
Kubelet cAdvisor Kube-Proxy Kubelet cAdvisor Kube-Proxy
Pod Pod Pod Pod Pod Pod
Plugin Network (eg Flannel, Weavenet, etc.)
etcd
... ... ...
Users
Developer/Operator
GoogleCloud Shell
Google Container Engine (GKE)
Google Container Registry (grc.io)
“When you use Kubernetes to orchestrate your applications, it’s important to change how you think about the network design of your applications and their hosts. With Kubernetes, you think about how Pods, Services, and external clients communicate, rather than thinking about how your hosts or VMs are connected.”
Docker Container
My Hello World App
Docker Container
My Hello World App
Kubernetes Cluster
Dockerfile
$ kubectl
$ gcloud
$ docker build$ gcloud docker push
$
My Hello Docker Image
My Hello Docker Image
DevMachine(Cloud Shell)
Replication Controller
Hello Pod Hello Pod
replicas: 5image: gcr.io/..…
selector:name: hello-node
Port: 8080…
Kubernetes Cluster
Hello Service$ kubectl
node #1 node #2
http://123.45.678.9:8080
DevMachine(Cloud Shell)
Hello Pod Hello Pod
backend:serviceName: hello-serviceservicePort: 8080
…
Kubernetes Cluster
Hello Ingress
node #1 node #2
https://example.com/hello
Istio
Defines a standard approach for managing microservices traffic flow management, access policy enforcement and the telemetry data aggregation in complex multi-clouds.
An open-source framework for connecting, managing, and securing microservices across heterogeneous clouds, platforms, and vendors.
About Istio
Pod
Envoy
svcA
Pod
Envoy
svcB
Service A Service B
HTTP,gRPC, TCPwith/out TLS
HTTP,gRPC, TCPwith/out TLS
Config Data to Envoys TLS Certs to Envoys
Pilot Mixer Istio-Auth
Control Plane REST API
Policy Checks,Telemetry
Monitoring & Observability
https://medium.com/google-cloud/istio-why-do-i-need-it-18d122838ee3
https://medium.com/@copyconstruct/monitoring-and-observability-8417d1952e1c
Q & A