Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/caoyingjunz/pixiu-autoscaler
pixiu-autoscaler aims to maintain the HPA automatically for kubernetes resources by annotations.
https://github.com/caoyingjunz/pixiu-autoscaler
hpa kubernetes kubez-ansible pixiu
Last synced: 4 days ago
JSON representation
pixiu-autoscaler aims to maintain the HPA automatically for kubernetes resources by annotations.
- Host: GitHub
- URL: https://github.com/caoyingjunz/pixiu-autoscaler
- Owner: caoyingjunz
- License: apache-2.0
- Created: 2021-02-24T15:28:45.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-12-16T02:46:37.000Z (about 1 month ago)
- Last Synced: 2025-01-04T17:09:07.038Z (11 days ago)
- Topics: hpa, kubernetes, kubez-ansible, pixiu
- Language: Go
- Homepage:
- Size: 363 KB
- Stars: 154
- Watchers: 12
- Forks: 34
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pixiu Autoscaler
`pixiu-autoscaler` 通过为 `workload` 添加 `annotations` 的方式,自动维护对应 `HorizontalPodAutoscaler` 的生命周期.
## Prerequisites
在 `kubernetes` 集群中, 需要先完成 `Metrics Server` 组件的安装,请参考 [Metrics Server](https://github.com/kubernetes-incubator/metrics-server)
`kubectl top node/pod` 验证 `Metrics Server` 已成功安装
``` bash
# kubectl top node
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
kubez 333m 16% 1225Mi 65%# kubectl top pod
NAME CPU(cores) MEMORY(bytes)
test1-54cd855b77-q67h6 1m 3Mi
```## Installing
The steps can be found in [Installation](./deploy)
## Getting Started
在 `workload` 的 `annotations` 中添加所需注释即可自动创建对应的 `HPA`
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
...
# 可选,默认 minReplicas 为 1
hpa.caoyingjunz.io/minReplicas: "2" # MINPODS
# 可选,默认 maxReplicas 为 6
hpa.caoyingjunz.io/maxReplicas: "6" # MAXPODS
...# 支持多种 TARGETS 类型,若开启,至少选择一种,可同时支持多个 TARGETS
# CPU, in cores. (500m = .5 cores)
# Memory, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)# 使用率 examples
cpu.hpa.caoyingjunz.io/targetAverageUtilization: "80"
memory.hpa.caoyingjunz.io/targetAverageUtilization: "60"# 使用值 examples
cpu.hpa.caoyingjunz.io/targetAverageValue: 600m
memory.hpa.caoyingjunz.io/targetAverageValue: 60Mi# prometheus examples
# TODO
...
name: test1
namespace: default
...
````pixiu-autoscaler-controller` 会根据注释的变化,自动同步 `HPA` 的生命周期.
Copyright 2019 caoyingjunz ([email protected]) Apache License 2.0