Skip to content

Commit 4733055

Browse files
feat: add metrics (#712)
* feat: add repos and layers metrics Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com> * feat: add more stuff Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com> * fix: move metrics to controller Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com> * fix: cleanup Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com> * fix: update tests Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com> * fix: cleanup Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com> * fix: GetLayerStatus Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com> * fix: cleanup Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com> * fix: linter issues Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com> * feat: add ingress Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com> * fix: ports Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com> * fix: wrong state info Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com> * fix: clear metrics Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com> * fix: lint and tests Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com> * fix(helm): rename controllers.ingress to metricsIngress --------- Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com> Co-authored-by: Luca Corrieri <luca.corrieri@theodo.com>
1 parent f6fe86b commit 4733055

12 files changed

Lines changed: 1444 additions & 2 deletions

File tree

deploy/charts/burrito/templates/controllers.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,33 @@ spec:
163163
selector:
164164
{{- toYaml .metadata.labels | nindent 4 }}
165165
{{- end }}
166+
{{- if .metricsIngress.enabled }}
167+
---
168+
apiVersion: networking.k8s.io/v1
169+
kind: Ingress
170+
metadata:
171+
name: burrito-controllers-metrics
172+
{{- with mergeOverwrite (deepCopy .metadata) .metricsIngress.metadata }}
173+
labels:
174+
{{- toYaml .labels | nindent 4}}
175+
annotations:
176+
{{- toYaml .annotations | nindent 4}}
177+
{{- end }}
178+
spec:
179+
ingressClassName: {{ .metricsIngress.ingressClassName }}
180+
rules:
181+
- host: {{ .metricsIngress.host }}
182+
http:
183+
paths:
184+
- pathType: ImplementationSpecific
185+
backend:
186+
service:
187+
name: burrito-controllers
188+
port:
189+
name: metrics
190+
tls:
191+
{{- toYaml .metricsIngress.tls | nindent 4 }}
192+
{{- end }}
166193
---
167194
apiVersion: v1
168195
kind: ServiceAccount

deploy/charts/burrito/values.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ config:
116116
hermitcrab:
117117
# -- Enable/Disable Hermitcrab (terraform provider cache in cluster)
118118
enabled: false
119-
# -- Metadata configuration for Hermitcrab
119+
# -- Metadata configuration for Hermitcrab
120120
metadata:
121121
labels:
122122
app.kubernetes.io/component: hermitcrab
@@ -341,7 +341,11 @@ controllers:
341341
command: ["burrito"]
342342
# -- Arguments to pass to the Burrito controller container
343343
args: ["controllers", "start"]
344-
# -- Controller liveness probe configuration
344+
# -- Controller exposed ports
345+
ports:
346+
- name: metrics
347+
containerPort: 8080
348+
# -- Controller liveness probe configuration
345349
livenessProbe:
346350
httpGet:
347351
path: /healthz
@@ -388,6 +392,23 @@ controllers:
388392
metadata:
389393
labels: {}
390394
annotations: {}
395+
ports:
396+
- name: metrics
397+
port: 80
398+
targetPort: metrics
399+
metricsIngress:
400+
# -- Enable/Disable ingress creation for the Burrito controller metrics endpoint (controllers.service MUST be enabled)
401+
enabled: false
402+
# -- Metadata configuration for the Burrito controller metrics ingress
403+
metadata:
404+
labels: {}
405+
annotations: {}
406+
# -- Ingress class name to use for the Burrito controller metrics ingress
407+
ingressClassName: nginx
408+
# -- Hostname for the Burrito controller metrics ingress
409+
host: burrito-controllers.example.com
410+
# -- TLS configuration for the Burrito controller metrics ingress
411+
tls: []
391412

392413
server:
393414
# -- Metadata configuration for the Burrito server

0 commit comments

Comments
 (0)