Skip to content

Commit

Permalink
Add an external controller metrics service
Browse files Browse the repository at this point in the history
Signed-off-by: Vlad Safronov <[email protected]>
  • Loading branch information
vladsf committed Dec 20, 2024
1 parent d951fdb commit bec5dce
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions charts/piraeus/templates/external-metrics-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{{ if (.Values.externalController).url }}
---
{{- $url := urlParse .Values.externalController.url -}}
{{- $host := regexSplit ":" (get $url "host") -1 -}}
{{- $ipAddr := index $host 0 -}}
{{- $port := index $host 1 }}
apiVersion: v1
kind: Endpoints
metadata:
name: {{ include "piraeus-operator.fullname" . }}-external-controller-metrics-service
labels:
{{- include "piraeus-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: linstor-external-controller
subsets:
- addresses:
- ip: {{ $ipAddr }}
ports:
- name: metrics
port: {{ $port }}
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "piraeus-operator.fullname" . }}-external-controller-metrics-service
labels:
{{- include "piraeus-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: linstor-external-controller
spec:
type: ExternalName
externalName: {{ $ipAddr }}
clusterIP: ""
selector:
{{- include "piraeus-operator.selectorLabels" . | nindent 4 }}
ports:
- name: metrics
port: {{ $port }}
targetPort: {{ $port }}
{{ end }}

0 comments on commit bec5dce

Please sign in to comment.