Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 11 additions & 0 deletions egress/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,14 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Create the name of the pod monitor to use
*/}}
{{- define "egress.podMonitorName" -}}
{{- if .Values.podMonitor.create }}
{{- default (include "egress.fullname" .) .Values.podMonitor.name }}
{{- else }}
{{- default "default" .Values.podMonitor.name }}
{{- end }}
{{- end }}
20 changes: 20 additions & 0 deletions egress/templates/podmonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if and .Values.podMonitor.create .Values.egress.prometheus_port -}}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ include "egress.podMonitorName" . }}
labels:
{{- include "egress.labels" . | nindent 4 }}
{{- with .Values.podMonitor.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: metrics
path: /
interval: {{ .Values.podMonitor.interval }}
selector:
matchLabels:
{{- include "egress.selectorLabels" . | nindent 6 }}
{{- end }}
11 changes: 11 additions & 0 deletions egress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,14 @@ securityContext: {}
tolerations: []

affinity: {}

podMonitor:
# Specifies whether a service monitor should be created
create: false
# Annotations to add to the service monitor
annotations: {}
# The name of the service monitor to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
# The scrape interval
interval: 30s
11 changes: 11 additions & 0 deletions ingress/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,14 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Create the name of the service monitor to use
*/}}
{{- define "ingress.serviceMonitorName" -}}
{{- if .Values.serviceMonitor.create }}
{{- default (include "ingress.fullname" .) .Values.serviceMonitor.name }}
{{- else }}
{{- default "default" .Values.serviceMonitor.name }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions ingress/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ spec:
containerPort: {{ .Values.ingress.http_relay_port }}
protocol: TCP
{{- end }}
{{- if .Values.ingress.rtmp_port }}
{{- if and .Values.ingress.rtmp_port (gt (int .Values.ingress.rtmp_port) 0) }}
- name: rtmp-port
containerPort: {{ .Values.ingress.rtmp_port }}
protocol: TCP
{{- end }}
{{- if .Values.ingress.whip_port }}
{{- if and .Values.ingress.whip_port (gt (int .Values.ingress.whip_port) 0) }}
- name: whip-port
containerPort: {{ .Values.ingress.whip_port }}
protocol: TCP
Expand Down
13 changes: 12 additions & 1 deletion ingress/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: Service
metadata:
name: {{ include "ingress.fullname" . }}
labels: {{- include "ingress.labels" . | nindent 4 }}
{{- with .Values.loadBalancer.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ default "LoadBalancer" .Values.ingress.serviceType }}
ports:
Expand All @@ -14,9 +18,16 @@ spec:
- port: {{ .Values.ingress.rtmp_port }}
protocol: TCP
name: rtmp
{{- if and .Values.ingress.whip_port (gt (int .Values.ingress.whip_port) 0) }}
- port: {{ .Values.ingress.whip_port }}
protocol: TCP
name: whip

{{- end }}
{{- if .Values.ingress.prometheus_port }}
- port: {{ .Values.ingress.prometheus_port }}
targetPort: metrics
protocol: TCP
name: metrics
{{- end }}
selector:
{{- include "ingress.selectorLabels" . | nindent 4 }}
20 changes: 20 additions & 0 deletions ingress/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if and .Values.serviceMonitor.create .Values.ingress.prometheus_port -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "ingress.serviceMonitorName" . }}
labels:
{{- include "ingress.labels" . | nindent 4 }}
{{- with .Values.serviceMonitor.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: metrics
path: /
interval: {{ .Values.serviceMonitor.interval }}
selector:
matchLabels:
{{- include "ingress.selectorLabels" . | nindent 6 }}
{{- end }}
11 changes: 11 additions & 0 deletions ingress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,14 @@ securityContext: {}
tolerations: []

affinity: {}

serviceMonitor:
# Specifies whether a service monitor should be created
create: false
# Annotations to add to the service monitor
annotations: {}
# The name of the service monitor to use.
# If not set and create is true, a name is generated using the fullname template
name: ""
# The scrape interval
interval: 30s
11 changes: 11 additions & 0 deletions livekit-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,14 @@ Create the name of the service monitor to use
{{- default "default" .Values.serviceMonitor.name }}
{{- end }}
{{- end }}

{{/*
Prometheus port
*/}}
{{- define "livekit-server.prometheus_port" -}}
{{- if .Values.livekit.prometheus }}
{{- .Values.livekit.prometheus.port }}
{{- else }}
{{- default "" .Values.livekit.prometheus_port }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions livekit-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ spec:
hostPort: {{ .Values.livekit.rtc.tcp_port }}
protocol: TCP
{{- end }}
{{- if .Values.livekit.prometheus_port }}
{{- if include "livekit-server.prometheus_port" . }}
- name: metrics
containerPort: {{ .Values.livekit.prometheus_port }}
containerPort: {{ include "livekit-server.prometheus_port" . }}
hostPort: {{ .Values.livekit.prometheus_port }}
protocol: TCP
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions livekit-server/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ spec:
protocol: UDP
targetPort: rtc-udp
{{- end }}
{{- if .Values.livekit.prometheus_port }}
- port: {{ .Values.livekit.prometheus_port }}
{{- if include "livekit-server.prometheus_port" . }}
- port: {{ include "livekit-server.prometheus_port" . }}
targetPort: metrics
protocol: TCP
name: metrics
Expand Down
2 changes: 1 addition & 1 deletion livekit-server/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.serviceMonitor.create .Values.livekit.prometheus_port -}}
{{- if and .Values.serviceMonitor.create (include "livekit-server.prometheus_port" .) -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand Down