Skip to content

Commit

Permalink
switch keda to use site-controller for unleased metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
sofuture committed Sep 5, 2024
1 parent 8c3920d commit 9cdfa7c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
18 changes: 3 additions & 15 deletions charts/primary-site/templates/deployments/inbox-listener.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
{{- if .Values.inboxListener.autoscaling.enabled }}
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: keda-inbox-listener-auth
spec:
secretTargetRef:
- parameter: token
name: foxglove-site-token
key: FOXGLOVE_SITE_TOKEN
---
apiVersion: keda.sh/v1alpha1
kind: ScaledJob
metadata:
name: inbox-listener-scaledjob
Expand All @@ -26,12 +16,10 @@ spec:
triggers:
- type: metrics-api
metadata:
format: "prometheus"
targetValue: "2"
url: "{{ .Values.globals.foxgloveApiUrl }}/internal/platform/v1/pending-imports-stats"
valueLocation: "unleased"
authMode: "bearer"
authenticationRef:
name: keda-inbox-listener-auth
url: "http://site-controller.{{.Release.Namespace}}.svc.cluster.local:6001/"
valueLocation: "unleased_pending_import_count"
{{- else }}
apiVersion: apps/v1
kind: Deployment
Expand Down
17 changes: 17 additions & 0 deletions charts/primary-site/templates/services/site-controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: site-controller
annotations:
{{- range $key, $value := .Values.siteController.service.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
type: ClusterIP
ports:
- name: metrics
port: 6001
protocol: TCP
targetPort: 6001
selector:
app: site-controller
2 changes: 2 additions & 0 deletions charts/primary-site/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ streamService:
## eks.amazonaws.com/role-arn: arn:aws:iam::xxxxxxxxxxxx:role/foxglove-stream-service-sa-role

siteController:
service:
annotations: {}
deployment:
resources:
requests:
Expand Down

0 comments on commit 9cdfa7c

Please sign in to comment.