Skip to content

Commit

Permalink
chore: Use dedicated service for metrics
Browse files Browse the repository at this point in the history
When the main service is used as a load balancer service to allow public
access through mTLS, the metrics should not be exposed on the same
service.
  • Loading branch information
anothertobi committed Apr 19, 2024
1 parent fd92cec commit 37d8e4b
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 6 deletions.
4 changes: 2 additions & 2 deletions charts/lagoon-logs-concentrator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ type: application
# time you make changes to the chart and its templates, including the app
# version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.47.0
version: 0.48.0

# This section is used to collect a changelog for artifacthub.io
# It should be started afresh for each release
# Valid supported kinds are added, changed, deprecated, removed, fixed and security
annotations:
artifacthub.io/changes: |
- kind: changed
description: update uselagoon/logs-concentrator image to v3.2.0
description: use dedicated service for metrics
22 changes: 22 additions & 0 deletions charts/lagoon-logs-concentrator/templates/metrics-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{- if .Values.metrics.enabled }}
apiVersion: v1
kind: Service
metadata:
{{- with .Values.metrics.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ include "lagoon-logs-concentrator.fullname" . }}-metrics
labels:
metrics-only: "true"
{{- include "lagoon-logs-concentrator.labels" . | nindent 4 }}
spec:
type: {{ .Values.metrics.service.type }}
ports:
- port: {{ .Values.metrics.service.port }}
targetPort: metrics
protocol: TCP
name: metrics
selector:
{{- include "lagoon-logs-concentrator.selectorLabels" . | nindent 4 }}
{{- end }}
4 changes: 0 additions & 4 deletions charts/lagoon-logs-concentrator/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,5 @@ spec:
targetPort: forward
protocol: TCP
name: forward
- port: 24231
targetPort: metrics
protocol: TCP
name: metrics
selector:
{{- include "lagoon-logs-concentrator.selectorLabels" . | nindent 4 }}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ spec:
- {{ .Release.Namespace }}
selector:
matchLabels:
metrics-only: "true"
{{- include "lagoon-logs-concentrator.selectorLabels" . | nindent 6 }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/lagoon-logs-concentrator/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ spec:
- name: forward
containerPort: 24224
protocol: TCP
{{- if .Values.metrics.enabled }}
- name: metrics
containerPort: 24231
protocol: TCP
{{- end }}
livenessProbe:
tcpSocket:
port: forward
Expand Down
8 changes: 8 additions & 0 deletions charts/lagoon-logs-concentrator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ service:
# Annotations to add to the service
annotations: {}

metrics:
enabled: true
service:
type: ClusterIP
port: 24231
# annotations to add to the metrics service
annotations: {}

serviceMonitor:
enabled: true

Expand Down

0 comments on commit 37d8e4b

Please sign in to comment.