Skip to content

Commit

Permalink
Merge pull request #6584 from zalando-incubator/nakadi-based-scaling
Browse files Browse the repository at this point in the history
Add support for scaling on Nakadi metrics
  • Loading branch information
myaser authored Dec 12, 2023
2 parents 79fa1b8 + 5996419 commit 6e24728
Show file tree
Hide file tree
Showing 3 changed files with 18 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 @@ -204,6 +204,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: ""

# 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 }}
13 changes: 8 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,7 @@ 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.2
env:
- name: AWS_REGION
value: {{ .Region }}
Expand All @@ -46,12 +46,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 +63,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 6e24728

Please sign in to comment.