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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Mattias Gees
March 21, 2018
Programming
79
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
49
Tarmak, why do we need another Kubernetes provisioner?
mattiasgees
1
270
Lightning Talk Prometheus
mattiasgees
0
69
Terraform workspaces
mattiasgees
0
110
Introduction to Ansible
mattiasgees
0
120
Other Decks in Programming
See All in Programming
Built Our Own Background Agent at LayerX
layerx
PRO
10
5.6k
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
250
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
1k
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
270
What's New in Android 2026
veronikapj
0
260
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
230
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
230
OpenSpecのproposalにbrainstormingを持たせてみた
tigertora7571
1
240
言葉の格闘技のススメ~紙とペンと言葉から始める、キャリアの描き方~
progresscicada
2
150
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
210
VibeCodingからAgenticWorkflowへ
starfish719
0
540
5分で問診!Composer セキュリティ健康診断
codmoninc
0
1k
Featured
See All Featured
Chasing Engaging Ingredients in Design
codingconduct
0
270
Documentation Writing (for coders)
carmenintech
77
5.5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.3k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
470
The Art of Programming - Codeland 2020
erikaheidi
57
14k
The Curious Case for Waylosing
cassininazir
1
460
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Designing for humans not robots
tammielis
254
26k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
700
Designing Experiences People Love
moore
143
24k
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?