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
76
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
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
Docコメントで始める簡単ガードレール
keisukeikeda
1
110
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
360
株式会社 Sun terras カンパニーデック
sunterras
0
2.1k
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
2
560
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
280
Takumiから考えるSecurity_Maturity_Model.pdf
gessy0129
1
140
Ruby and LLM Ecosystem 2nd
koic
1
580
ふつうのRubyist、ちいさなデバイス、大きな一年 / Ordinary Rubyists, Tiny Devices, Big Year
chobishiba
1
430
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
130
Windows on Ryzen and I
seosoft
0
260
nuget-server - あなたが必要だったNuGetサーバー
kekyo
PRO
0
230
猫の手も借りたい!ので AIエージェント猫を作って社内に放した話 Claude Code × Container Lambda の Slack Bot "DevNeko"
naramomi7
0
260
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
Design in an AI World
tapps
0
170
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
210
WENDY [Excerpt]
tessaabrams
9
36k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.8k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.1k
Paper Plane (Part 1)
katiecoart
PRO
0
5.5k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
400
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
170
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?