Skip to content

Commit

Permalink
Merge pull request #88 from element-hq/bbz/statefulset-services
Browse files Browse the repository at this point in the history
Improve StatefulSets + Services
  • Loading branch information
benbz authored Oct 4, 2024
2 parents af130b3 + 3a18328 commit c0dd112
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each 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.7.6
version: 0.8.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
1 change: 1 addition & 0 deletions templates/haproxy-services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
namespace: {{ $.Release.Namespace }}
labels: {{ include "jitsi.haproxy.labels" $ | nindent 4 }}
spec:
clusterIP: None
ports:
- name: http
port: 8080
Expand Down
37 changes: 16 additions & 21 deletions templates/jvb-services.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
{{- range $shard, $e := until (int $.Values.shardCount) }}
---
apiVersion: v1
kind: Service
metadata:
labels: {{ include "jitsi.jvbShard.labels" (merge (dict "RelativeScope" (dict "shard" $shard)) $) | nindent 4 }}
name: {{ include "jitsi.name" $ }}-shard-{{ $shard }}-jvb
namespace: {{ $.Release.Namespace }}
spec:
clusterIP: None
type: ClusterIP
ports:
- name: "metrics"
protocol: "TCP"
port: 9888
targetPort: metrics
selector: {{ include "jitsi.jvbShard.selectorLabels" (merge (dict "RelativeScope" (dict "shard" $shard)) $) | nindent 4 }}
{{- range $replica, $f := until (int $.Values.jvb.replicas) }}
{{ if empty $.Values.jvb.hostPort }}
---
Expand All @@ -21,26 +37,5 @@ spec:
statefulset.kubernetes.io/pod-name: {{ include "jitsi.name" $ }}-shard-{{ $shard }}-jvb-{{ $replica }}
{{ include "jitsi.jvbShard.labels" (merge (dict "RelativeScope" (dict "shard" $shard)) $) | nindent 4 }}
{{ end -}}
---
apiVersion: v1
kind: Service
metadata:
{{ with $.Values.jvb.monitoring.service.extraAnnotations }}
annotations:
{{ toYaml . | nindent 4 }}
{{ end }}
labels: {{ include "jitsi.jvbReplicaMonitoring.labels" (merge (dict "RelativeScope" (dict "shard" $shard "replica" $replica)) $) | nindent 4 }}
name: {{ include "jitsi.name" $ }}-shard-{{ $shard }}-jvb-{{ $replica }}-metrics
namespace: {{ $.Release.Namespace }}
spec:
type: ClusterIP
ports:
- name: "metrics"
protocol: "TCP"
port: 9888
targetPort: metrics
selector:
statefulset.kubernetes.io/pod-name: {{ include "jitsi.name" $ }}-shard-{{ $shard }}-jvb-{{ $replica }}
{{ include "jitsi.jvbShard.labels" (merge (dict "RelativeScope" (dict "shard" $shard)) $) | nindent 4 }}
{{ end -}}
{{ end -}}
2 changes: 1 addition & 1 deletion templates/jvb-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
replicas: {{ $.Values.jvb.replicas }}
selector:
matchLabels: {{ include "jitsi.jvbShard.selectorLabels" (merge (dict "RelativeScope" (dict "shard" $shard)) $) | nindent 6 }}
serviceName: jvb
serviceName: {{ include "jitsi.name" $ }}-shard-{{ $shard }}-jvb
template:
metadata:
labels: {{ include "jitsi.jvbShard.labels" (merge (dict "RelativeScope" (dict "shard" $shard)) $) | nindent 8 }}
Expand Down

0 comments on commit c0dd112

Please sign in to comment.