Skip to content

Commit

Permalink
Add support for scaling on Nakadi metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
  • Loading branch information
mikkeloscar committed Nov 20, 2023
1 parent 7391b34 commit 743708a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 2 additions & 0 deletions cluster/config-defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ kube_metrics_adapter_default_scaling_window: "10m"
kube_metrics_adapter_scaling_schedule_ramp_steps: "5"
## ZMON KairosDB URL
zmon_kairosdb_url: "https://data-service.zmon.zalan.do/kairosdb-proxy"
## Nakadi URL (for the stats API)
nakadi_url: "https://nakadi-staging.nakadi-test.zalan.do"

# skipper east-west feature - deprecated configuration
# enable_skipper_eastwest is the legacy feature gate for the automatic
Expand Down
10 changes: 8 additions & 2 deletions cluster/manifests/kube-metrics-adapter/credentials.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if eq .Environment "production" }}
{{- if or (eq .Environment "production") (ne .Cluster.ConfigItems.nakadi_url "") }}
apiVersion: zalando.org/v1
kind: PlatformCredentialsSet
metadata:
Expand All @@ -10,6 +10,12 @@ metadata:
spec:
application: kubernetes
tokens:
{{- if and (eq .Environment "production") (ne .Cluster.ConfigItems.zmon_kairosdb_url "") }}
zmon:
privileges: []
{{ end }}
{{- end }}
{{- if ne .Cluster.ConfigItems.nakadi_url ""}}
nakadi:
privileges: []
{{- end }}
{{- end }}
14 changes: 9 additions & 5 deletions cluster/manifests/kube-metrics-adapter/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ spec:
serviceAccountName: custom-metrics-apiserver
containers:
- name: kube-metrics-adapter
image: container-registry.zalando.net/teapot/kube-metrics-adapter:v0.2.1-18-g85f1c3e
# image: container-registry.zalando.net/teapot/kube-metrics-adapter:v0.2.1-18-g85f1c3e
image: container-registry-test.zalando.net/teapot/kube-metrics-adapter-test:pr-636-9
env:
- name: AWS_REGION
value: {{ .Region }}
Expand All @@ -46,12 +47,15 @@ spec:
{{ if eq .Environment "production" }}
- --zmon-kariosdb-endpoint={{.Cluster.ConfigItems.zmon_kairosdb_url}}
{{ end }}
{{- if ne .Cluster.ConfigItems.nakadi_url "" }}
- --nakadi-endpoint={{.Cluster.ConfigItems.nakadi_url}}
{{- end }}
volumeMounts:
{{ if eq .Environment "production" }}
{{- if or (eq .Environment "production") (ne .Cluster.ConfigItems.nakadi_url "") }}
- name: credentials
mountPath: /meta/credentials
readOnly: true
{{ end }}
{{- end }}
resources:
limits:
cpu: 10m
Expand All @@ -60,8 +64,8 @@ spec:
cpu: 10m
memory: 4Gi
volumes:
{{ if eq .Environment "production" }}
{{- if or (eq .Environment "production") (ne .Cluster.ConfigItems.nakadi_url "") }}
- name: credentials
secret:
secretName: "kube-metrics-adapter"
{{ end }}
{{- end }}

0 comments on commit 743708a

Please sign in to comment.