-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sftd: add support for multiple SFT servers (#1325)
* sftd: add support for multiple SFT servers * The ingress assigns an SFT allocation request to a random SFT * Each sftd pod is made aware of an URL on which it is directly reachable, and will return the URL in the response to the client. e.g. Pod `sftd-0` will be assigned `https://sft.example.com/sfts/sftd-0` * The client tells this URL to other clients willing to join the call * Other clients make a request to this URL * The ingress points requests to `/sfts` to the `join-call` deployment, which will redirect to the specific pod, such that the client can join the conference call of the other client
- Loading branch information
Showing
10 changed files
with
306 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "sftd.fullname" . }}-join-call | ||
labels: | ||
{{- include "sftd.join-call.labels" . | nindent 4 }} | ||
|
||
data: | ||
default.conf.template: | | ||
server { | ||
listen 8080; | ||
resolver ${NAMESERVER}; | ||
location /healthz { return 204; } | ||
location ~ ^/sfts/([a-z0-9\-]+)/(.*) { | ||
proxy_pass http://$1.sftd.${POD_NAMESPACE}.svc.cluster.local:8585/$2; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "sftd.fullname" . }}-join-call | ||
labels: | ||
{{- include "sftd.join-call.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.joinCall.replicaCount }} | ||
selector: | ||
matchLabels: | ||
{{- include "sftd.join-call.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: | ||
{{- include "sftd.join-call.selectorLabels" . | nindent 8 }} | ||
annotations: | ||
checksum/configmap: {{ include (print .Template.BasePath "/configmap-join-call.yaml") . | sha256sum }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
volumes: | ||
- name: nginx-config | ||
configMap: | ||
name: {{ include "sftd.fullname" . }}-join-call | ||
containers: | ||
- name: nginx | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.joinCall.image.repository }}:{{ .Values.joinCall.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
- name: http | ||
containerPort: 8080 | ||
protocol: TCP | ||
livenessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: http | ||
readinessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: http | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
volumeMounts: | ||
- mountPath: /etc/nginx/conf.d/default.conf.template | ||
name: nginx-config | ||
subPath: default.conf.template | ||
env: | ||
- name: POD_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
command: | ||
- "/bin/sh" | ||
- "-c" | ||
- | | ||
export NAMESERVER=`cat /etc/resolv.conf | grep "nameserver" | awk '{print $2}' | tr '\n' ' '` | ||
envsubst '$NAMESERVER $POD_NAMESPACE' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf | ||
exec nginx -g 'daemon off;' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "sftd.fullname" . }}-join-call | ||
labels: | ||
{{- include "sftd.join-call.labels" . | nindent 4 }} | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: http | ||
name: http | ||
selector: | ||
{{- include "sftd.join-call.selectorLabels" . | nindent 4 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.