Introduction

This is a page about Microservice and monitoring

Prometheus

A tool for monitoring,install monitor application,it will send out the log metrics,
and in the UI it can search anything based on rate / frequence and so on
take node for example

  1. it monitor the machine side
  2. it using job config in yml file to add target

Microservices

  1. break down application into microservices based on the business functionalities
  2. keep one service doing one specifical jobs
  3. self-contained and independent from each other , can be developed deployed scaled separately
  4. it is loosely coupled
  5. communication use api call / message broker / service mesh

downside of MicroSerivces

  1. communication complexity
  2. how to monitor so many microservice when it is down

repo

when use microservice you might choose below two Repo type

  • monorepo
  • polyreop

Near Zero DownTime

  1. Blue/Green deployment strategy
    running two server and use load balance

  2. Canary release strategy
    slowly roll out the new version to a small group of users

k8s AutoScaling

K8s has three types of autoscaling

HPA(Horizontal Pod Autoscaler)

Pod number autoscaling, depends on metrics-server,adjust to CPU/memory/QPS

VPA(Vertical Pod Autoscaler)

Inside a Pod

CA(cluster Autoscaler)

Node number autoscaling

Source code link

folder structure

script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
- core #the core part of CA
- autoscaler.go #interface of the autoscaling
- scale_down.go
- scale_up.go

- cloudprovider #interface with all cloud provider
- alicloud
- aws
- azure
- baidu

- expander # different strategy of expand the node
- factory # design pattern of factory
- mostpods # use the most pods
- price # the lowest price
- priority # according to NodeGroup priority
- random # random pick
- waste # the most usage percentage

- simulator #

How k8s manage to increase Node(AWS)?

use awsmanager to increase ASG, the same we increase ASG inside aws console:
IncreaseSize .231

which strategy k8s is using?

scale up 475