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
68
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
29
Tarmak, why do we need another Kubernetes provisioner?
mattiasgees
1
230
Lightning Talk Prometheus
mattiasgees
0
59
Terraform workspaces
mattiasgees
0
94
Introduction to Ansible
mattiasgees
0
92
Other Decks in Programming
See All in Programming
VSCodeでのDatabricks開発もお勧めしたい/I would also recommend Databricks development with VSCode.
kazumain
0
250
Java 22 Overview
kishida
1
180
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
160
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
120
Git Rebase
bkuhlmann
11
1.6k
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
210
デフォルトにして至高、RubyMineの大好きな所
ruzia
0
120
エンターテイメント業界で利用されるAWS
demuyan
0
210
Rubyでたのしむクリエイティブコーディング/Enjoy Creative coding with Ruby
chobishiba
1
170
雑に思考を整理する技術と効能
konifar
58
28k
Code Reviews
bkuhlmann
4
890
Semantic search with Django and pgvector
pauloxnet
0
240
Featured
See All Featured
Designing for humans not robots
tammielis
247
25k
A designer walks into a library…
pauljervisheath
199
23k
Testing 201, or: Great Expectations
jmmastey
27
6.3k
Statistics for Hackers
jakevdp
789
220k
Automating Front-end Workflow
addyosmani
1355
200k
Happy Clients
brianwarren
91
6.4k
Being A Developer After 40
akosma
56
580k
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
Creatively Recalculating Your Daily Design Routine
revolveconf
209
11k
RailsConf 2023
tenderlove
2
530
GraphQLの誤解/rethinking-graphql
sonatard
50
9.2k
Optimising Largest Contentful Paint
csswizardry
7
2.3k
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?