Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jhandguy/horizontal-pod-autoscaler
A sample project showcasing various Horizontal Pod Autoscaler implementations.
https://github.com/jhandguy/horizontal-pod-autoscaler
helm horizontal-pod-autoscaler ingress-nginx k6 kind kubernetes metrics-server prometheus prometheus-adapter
Last synced: about 1 month ago
JSON representation
A sample project showcasing various Horizontal Pod Autoscaler implementations.
- Host: GitHub
- URL: https://github.com/jhandguy/horizontal-pod-autoscaler
- Owner: jhandguy
- License: mit
- Created: 2022-02-21T19:21:56.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-01T16:07:40.000Z (about 1 year ago)
- Last Synced: 2023-12-01T21:31:59.141Z (about 1 year ago)
- Topics: helm, horizontal-pod-autoscaler, ingress-nginx, k6, kind, kubernetes, metrics-server, prometheus, prometheus-adapter
- Language: Kotlin
- Homepage:
- Size: 145 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Horizontal Pod Autoscaler
A sample project showcasing various Horizontal Pod Autoscaler implementations.
## Blog Posts
- [Horizontal Pod Autoscaler in Kubernetes (Part 1) — Simple Autoscaling using Metrics Server](https://jhandguy.github.io/posts/simple-horizontal-autoscaling/)
- [Horizontal Pod Autoscaler in Kubernetes (Part 2) — Advanced Autoscaling using Prometheus Adapter](https://jhandguy.github.io/posts/advanced-horizontal-autoscaling/)## Installing
### Autoscaling Golang service using Metrics Server
```shell
kind create cluster --image kindest/node:v1.27.3 --config=kind/cluster.yamlhelm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm install ingress-nginx/ingress-nginx --name-template ingress-nginx --create-namespace -n ingress-nginx --values kind/ingress-nginx-values.yaml --version 4.8.3 --waithelm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server
helm install metrics-server/metrics-server --name-template metrics-server --create-namespace -n metrics-server --values kind/metrics-server-values.yaml --version 3.11.0 --waithelm install golang-sample-app/helm-chart --name-template sample-app --create-namespace -n sample-app --wait
```### Autoscaling Kotlin service using Metrics Server
```shell
kind create cluster --image kindest/node:v1.27.3 --config=kind/cluster.yamlhelm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm install ingress-nginx/ingress-nginx --name-template ingress-nginx --create-namespace -n ingress-nginx --values kind/ingress-nginx-values.yaml --version 4.8.3 --waithelm repo add metrics-server https://kubernetes-sigs.github.io/metrics-server
helm install metrics-server/metrics-server --name-template metrics-server --create-namespace -n metrics-server --values kind/metrics-server-values.yaml --version 3.11.0 --waithelm install kotlin-sample-app/helm-chart --name-template sample-app --create-namespace -n sample-app --wait
```### Autoscaling Golang service using Prometheus Adapter
```shell
kind create cluster --image kindest/node:v1.27.3 --config=kind/cluster.yamlhelm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm install ingress-nginx/ingress-nginx --name-template ingress-nginx --create-namespace -n ingress-nginx --values kind/ingress-nginx-values.yaml --version 4.8.3 --waithelm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install prometheus-community/kube-prometheus-stack --name-template prometheus --create-namespace -n prometheus --version 54.2.2 --wait
helm install prometheus-community/prometheus-adapter --name-template prometheus-adapter --create-namespace -n prometheus-adapter --values kind/prometheus-adapter-values.yaml --version 4.9.0 --waithelm install golang-sample-app/helm-chart --name-template sample-app --create-namespace -n sample-app --set prometheus.enabled=true --wait
```## Smoke Testing
```shell
curl localhost/success -H "Host: sample.app" -v
curl localhost/error -H "Host: sample.app" -v
```## Load Testing
```shell
k6 run k6/script.js
```## Uninstalling
```shell
kind delete cluster
```