Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Pod autoscaling with custom-metrics
Search
Mattias Gees
March 21, 2018
Programming
76
0
Share
Pod autoscaling with custom-metrics
How can you use your custom-metrics that are in your monitoring system to scale your pods.
Mattias Gees
March 21, 2018
More Decks by Mattias Gees
See All by Mattias Gees
A Cloud Native Journey At Scale (Belgium Kubernetes Meetup)
mattiasgees
0
39
Tarmak, why do we need another Kubernetes provisioner?
mattiasgees
1
270
Lightning Talk Prometheus
mattiasgees
0
67
Terraform workspaces
mattiasgees
0
100
Introduction to Ansible
mattiasgees
0
110
Other Decks in Programming
See All in Programming
2026-03-27 #terminalnight 変数展開とコマンド展開でターミナル作業をスマートにする方法
masasuzu
0
270
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
4k
forteeの改修から振り返るPHPerKaigi 2026
muno92
PRO
3
110
Tamach-sre-3_ANDPAD-shimaison93
mane12yurks38
0
230
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
910
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
140
モダンOBSプラグイン開発
umireon
0
190
PHPで TLSのプロトコルを実装してみる
higaki_program
0
710
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
500
OTP を自動で入力する裏技
megabitsenmzq
0
130
AI-DLC 入門 〜AIコーディングの本質は「コード」ではなく「構造」〜 / Introduction to AI-DLC: The Essence of AI Coding Is Not “Code” but “Structure”
seike460
PRO
0
150
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.8k
Featured
See All Featured
Skip the Path - Find Your Career Trail
mkilby
1
93
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.5k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
400
Making the Leap to Tech Lead
cromwellryan
135
9.8k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
27
3.4k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
68
38k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
160
First, design no harm
axbom
PRO
2
1.2k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
Agile that works and the tools we love
rasmusluckow
331
21k
Docker and Python
trallard
47
3.8k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
320
Transcript
Pod autoscaling with custom-metrics
Mattias Gees • Cloud Engineer @skyscrapers • Avid runner •
Likes to experiment github.com/mattiasgees twitter.com/mattiasgees blog.mattiasgees.be
We are hiring! https://skyscrapers.eu/jobs
Who has used kubernetes?
API
Some history! • SIG Instrumentation • Tackled Heapster • Metrics-server
(beta 1.8) • Annotations (1.2 - 1.5) • Blogposts Q1 2017 are outdated! • Autoscaler (1.6 - ...)
Architecture
Requirements • API aggregation layer • Resource Metrics API •
Custom metrics API • kube-controller-manager • --horizontal-pod-autoscaler-use-rest-clients • --kubeconfig <path-to-kubeconfig> OR --master <ip- address-of-apiserver>
Enabled on 1.9
Basic check kubectl api-versions kubectl cluster-info
Architecture
Prometheus helm install coreos/prometheus-operator \ --name prometheus-operator \ --namespace monitoring
helm install coreos/kube-prometheus \ --name kube-prometheus \ --namespace monitoring \ -f prometheus.yaml
Application kubectl apply -f metrics-app.yaml
Prometheus-adapter • Create cert • Upload cert as secret kubectl
-n custom-metrics create secret tls cm- adapter-serving-certs --cert=server.crt -- key=server-key.pem • Deploy prometheus-adapter kubectl apply -f manifests
Test kubectl api-versions | grep custom custom.metrics.k8s.io/v1beta1
Test kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1/" | jq
Test kubectl get --raw \ "/apis/custom.metrics.k8s.io/v1beta1/namespaces/default/ pods/*/http_requests" \ | jq
kubectl get --raw \ "/apis/custom.metrics.k8s.io/v1beta1/namespaces/default/ service/sample-metrics-app/http_requests" \ | jq
Deploy HPA kubectl apply -f hpa.yaml
Inspect kubectl describe hpa sample-metrics-app
Future • Still Alpha • Lots of discussions • Proposals
for extra features
Questions?