Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an external controller metrics service #751

Open
wants to merge 3 commits into
base: v2
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
vladsf marked this conversation as resolved.
Show resolved Hide resolved
ports:
- name: metrics
port: {{ $port }}
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "piraeus-operator.fullname" . }}-external-controller-metrics-service
WanzenBug marked this conversation as resolved.
Show resolved Hide resolved
labels:
{{- include "piraeus-operator.labels" . | nindent 4 }}
app.kubernetes.io/component: linstor-external-controller
spec:
type: ExternalName
externalName: {{ $ipAddr }}
clusterIP: ""
vladsf marked this conversation as resolved.
Show resolved Hide resolved
selector:
{{- include "piraeus-operator.selectorLabels" . | nindent 4 }}
vladsf marked this conversation as resolved.
Show resolved Hide resolved
ports:
- name: metrics
port: {{ $port }}
targetPort: {{ $port }}
{{ end }}