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
0
74
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
Tweet
Share
More Decks by Mattias Gees
See All by Mattias Gees
A Cloud Native Journey At Scale (Belgium Kubernetes Meetup)
mattiasgees
0
36
Tarmak, why do we need another Kubernetes provisioner?
mattiasgees
1
260
Lightning Talk Prometheus
mattiasgees
0
65
Terraform workspaces
mattiasgees
0
100
Introduction to Ansible
mattiasgees
0
110
Other Decks in Programming
See All in Programming
AI Agent 時代的開發者生存指南
eddie
4
2.2k
Inside of Swift Export
giginet
PRO
1
270
マイベストのシンプルなデータ基盤の話 - Googleスイートとのつき合い方 / mybest-simple-data-architecture-google-nized
snhryt
0
110
Node-REDのノードの開発・活用事例とコミュニティとの関わり(Node-RED Con Nagoya 2025)
404background
0
110
20251016_Rails News ~Rails 8.1の足音を聴く~
morimorihoge
3
900
One Enishi After Another
snoozer05
PRO
0
170
Dive into Triton Internals
appleparan
0
370
KoogではじめるAIエージェント開発
hiroaki404
1
230
Google Opal解体新書
mickey_kubo
3
100
Blazing Fast UI Development with Compose Hot Reload (droidcon London 2025)
zsmb
0
440
Developer Joy - The New Paradigm
hollycummins
1
400
ボトムアップの生成AI活用を推進する社内AIエージェント開発
aku11i
0
1.4k
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
5.9k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
Documentation Writing (for coders)
carmenintech
76
5.1k
Fireside Chat
paigeccino
41
3.7k
How to Think Like a Performance Engineer
csswizardry
27
2.2k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
How to Ace a Technical Interview
jacobian
280
24k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
940
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
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?