Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Minikube and Helm medea-demo app integration (#34) #41

Merged
merged 341 commits into from
Aug 6, 2019
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
341 commits
Select commit Hold shift + click to select a range
06774bb
Handler error send event
Kirguir Apr 4, 2019
f601964
draft
alexlapa Apr 4, 2019
0d472b8
Impl transition into failure state for peer
Kirguir Apr 5, 2019
83f139d
implementing transport
alexlapa Apr 5, 2019
d3cd4a8
Revert rename ws session
Kirguir Apr 8, 2019
022c980
Merge branch 'master' into add_peer
Kirguir Apr 8, 2019
7eb2837
Ignore connection errors when closing Room
Kirguir Apr 8, 2019
135abd3
handle on close: stop pinger, remove socket
alexlapa Apr 8, 2019
7b48542
move transport to package
alexlapa Apr 8, 2019
c2e6a6c
ping_interval, fmt
alexlapa Apr 8, 2019
479dcd4
Merge branch 'master' into discover-jason-api
alexlapa Apr 8, 2019
ce6d1f5
update lock
alexlapa Apr 8, 2019
6ef9c74
Merge branch 'master' into bootstrap-web-client
alexlapa Apr 8, 2019
a568ba8
fix merge
alexlapa Apr 8, 2019
f423025
fix merge
alexlapa Apr 8, 2019
0d26545
copy protocol messages
alexlapa Apr 8, 2019
eeccfc7
Merge branch 'bootstrap-web-client' into discover-jason-api
alexlapa Apr 8, 2019
f5f653b
Merge branch 'add_peer' into discover-jason-api
alexlapa Apr 8, 2019
22d3724
parse command
alexlapa Apr 8, 2019
319d732
Merge branch 'master' into discover-jason-api
alexlapa Apr 8, 2019
436e3b6
impl drop for transport, send events to subs
alexlapa Apr 9, 2019
cf6ea50
transport.send_command()
alexlapa Apr 9, 2019
d852df2
Refactoring send message from WsSession to Room use try_send
Kirguir Apr 9, 2019
ff94c99
parse event in session
alexlapa Apr 9, 2019
0618206
Add reconnect timeout parameter to config
Kirguir Apr 10, 2019
b74656f
properly pass medea events to session
alexlapa Apr 10, 2019
e2dd0f3
Merge branch 'master' into discover-jason-api
alexlapa Apr 10, 2019
3db478c
fix merge
alexlapa Apr 10, 2019
f40661f
Merge branch 'master' into add_peer
Kirguir Apr 11, 2019
63c9896
create api package
alexlapa Apr 11, 2019
fbe6664
fix imports
alexlapa Apr 11, 2019
e41a7e2
refactor session.rs
alexlapa Apr 11, 2019
24e2413
move rpc connection to module
alexlapa Apr 11, 2019
b0de9a7
minor refactor
alexlapa Apr 11, 2019
a8eb8e0
add todos
alexlapa Apr 12, 2019
baa65b4
refactor session
alexlapa Apr 12, 2019
20d9859
Merge branch 'add_peer' into discover-jason-api
alexlapa Apr 12, 2019
99c058b
refactor
alexlapa Apr 15, 2019
d708a21
Impl handler StartSignaling
Kirguir Apr 15, 2019
b498467
error handling and propagation
alexlapa Apr 15, 2019
d1f4651
error handling and propagation
alexlapa Apr 15, 2019
81ebfba
error handling and propagation
alexlapa Apr 16, 2019
ae869fd
error handling and propagation
alexlapa Apr 16, 2019
7bf48f0
Make linter happy
Kirguir Apr 16, 2019
c068a69
TryFrom<&MessageEvent> for MedeaEvent, TryFrom<&MessageEvent> for Hea…
alexlapa Apr 16, 2019
5a00dbf
js_val_to_string
alexlapa Apr 16, 2019
785b76b
create websocket wrapper
alexlapa Apr 16, 2019
32df588
refactor
alexlapa Apr 17, 2019
dbe5a93
fmt
alexlapa Apr 17, 2019
7d20f08
enable clippy for jason, fix jason lint
alexlapa Apr 17, 2019
fdc34c7
add some docs
alexlapa Apr 17, 2019
97246ca
refactor
alexlapa Apr 17, 2019
95baf6f
fix room duplication
alexlapa Apr 17, 2019
27715ec
properly drop Room
alexlapa Apr 17, 2019
2e862e0
websocket close
alexlapa Apr 17, 2019
1f8c6f6
fix msg json representation
alexlapa Apr 17, 2019
c90bcf5
properly drop room's process_msg_task
alexlapa Apr 18, 2019
5efee0a
correct drop transport
alexlapa Apr 18, 2019
f00b923
watch socket.on_error, track socket state
alexlapa Apr 19, 2019
d620dc3
fix cyclic drop
alexlapa Apr 19, 2019
eb88542
add event_listener
alexlapa Apr 23, 2019
98862d9
make clippy happy
alexlapa Apr 23, 2019
ae6fafa
cleanup debug logs
alexlapa Apr 23, 2019
4a494ff
clippy, cleanup
alexlapa Apr 23, 2019
b7a89ad
add some doc
alexlapa Apr 23, 2019
bf29c77
remove Handler<Heartbeat> for WsSession
alexlapa Apr 23, 2019
e80bec8
fix signaling_test
alexlapa Apr 23, 2019
d64d604
transport to rpc
alexlapa Apr 24, 2019
db792d8
refactor RpcClient.init
alexlapa Apr 24, 2019
7584324
refactor
alexlapa Apr 24, 2019
ad20aa1
refactor
alexlapa Apr 24, 2019
bbc6048
refactor
alexlapa Apr 24, 2019
96369c5
impl ser for ClientMsg and ServerMsg
alexlapa Apr 24, 2019
29eb658
add protocol deser, tests, run jason unit tests on make test
alexlapa Apr 25, 2019
41dece5
add protocol from jason
alexlapa Apr 25, 2019
b7de721
make clippy happy
alexlapa Apr 25, 2019
92de12d
fix tests
alexlapa Apr 25, 2019
b39c735
clippy
alexlapa Apr 25, 2019
a83de49
fix event send
alexlapa Apr 25, 2019
f349796
Merge branch 'add_peer' into discover-jason-api
alexlapa Apr 25, 2019
9a50956
fix event send
alexlapa Apr 25, 2019
e7eacbf
Merge branch 'add_peer' into discover-jason-api
alexlapa Apr 25, 2019
f753f25
connect in tests
alexlapa Apr 25, 2019
b49eec6
refactor transport.subscribe()
alexlapa Apr 26, 2019
246d395
transport futurization
alexlapa Apr 26, 2019
4af378a
format
alexlapa May 1, 2019
965256a
format
alexlapa May 1, 2019
0361e30
Impl return socket only if connection success
Kirguir May 2, 2019
91e83fd
Impl on_close handler
Kirguir May 2, 2019
59623c6
Impl on_close handler for RpcClient
Kirguir May 3, 2019
7cd3ff1
Impl on_message handler for RpcClient
Kirguir May 3, 2019
6002e2d
Create protocol package
Kirguir May 6, 2019
508796e
add MediaManager, Stream, MediaCaps
alexlapa May 6, 2019
e99f6c6
MediaManager
alexlapa May 6, 2019
6c0bca3
Impl MemberMessage and RoomMessage for in and out messages in Room
Kirguir May 6, 2019
9f2c57a
add Callback wrapper
alexlapa May 6, 2019
9454b0f
Impl ServerMessage for input messages in WebMessage
Kirguir May 7, 2019
fe390a7
Merge branch 'master' into discover-jason-api
Kirguir May 7, 2019
ca1feaf
Fix merge
Kirguir May 7, 2019
2671262
Add docs
Kirguir May 7, 2019
76c660f
Fix docs
Kirguir May 7, 2019
abf3d48
Remove api::client::protocol
Kirguir May 7, 2019
c865f2d
store Stream instead of tracks, play local video
alexlapa May 7, 2019
ed182b1
Merge branch 'discover-jason-api' into jason-media-management
alexlapa May 7, 2019
7e23542
fix merge
alexlapa May 7, 2019
e9b3bed
refactor
alexlapa May 7, 2019
c50bd4e
fix lint errors
alexlapa May 7, 2019
c684866
Merge branch 'discover-jason-api' into jason-media-management
alexlapa May 7, 2019
a511d43
refactor to use weak links in external handles, implementing RTCPeerC…
alexlapa May 9, 2019
09e205c
add_stream
alexlapa May 9, 2019
1dab5d2
Merge branch 'master' into discover-jason-api
alexlapa May 9, 2019
c6dbd62
fix merge
alexlapa May 9, 2019
df15e79
Merge branch 'discover-jason-api' into jason-media-management
alexlapa May 9, 2019
44e7fbf
handle IceCandidateDiscovered
alexlapa May 9, 2019
a1bc6d7
fix lint
alexlapa May 9, 2019
2872902
handle PeersRemoved
alexlapa May 9, 2019
5da5b86
handle SpdAnswerMade
alexlapa May 9, 2019
fd4c1ee
use weak link in RoomHandle
alexlapa May 10, 2019
ecb6690
add on_ice_candidate callback
alexlapa May 10, 2019
7453894
Merge branch 'discover-jason-api' into jason-media-management
alexlapa May 10, 2019
3421de3
fix merge
alexlapa May 10, 2019
68ec5cb
implementing on_peer_created
alexlapa May 10, 2019
29c89e4
refactor, extend docs
alexlapa May 12, 2019
0f51c6d
refactor
alexlapa May 12, 2019
d65e2f5
Merge branch 'discover-jason-api' into jason-media-management
alexlapa May 12, 2019
5ba6efb
fix merge
alexlapa May 12, 2019
dfa2467
refactor
alexlapa May 13, 2019
693007c
implementing on_peer_created
alexlapa May 13, 2019
a01da0d
fmt
alexlapa May 13, 2019
1ce1568
Merge branch 'discover-jason-api' into jason-media-management
alexlapa May 13, 2019
78070e7
implementing on_peer_created
alexlapa May 13, 2019
0a34eef
parse tracks
alexlapa May 28, 2019
09d296d
implementing sigalling
alexlapa May 28, 2019
e92b82e
implementing on_peer_created
alexlapa May 29, 2019
3729019
add conenctionhandler, emit on_local_stream, setup peer=>room messaging
alexlapa May 30, 2019
d415c0a
implementing on_remote_track, rework test client to use transceivers
alexlapa Jun 2, 2019
7f9af39
add mids to signaling
alexlapa Jun 2, 2019
c059f7f
fix tests
alexlapa Jun 3, 2019
a5c6549
fix lint
alexlapa Jun 3, 2019
6003a67
formatting deps
alexlapa Jun 3, 2019
da94941
formatting deps
alexlapa Jun 3, 2019
607414f
adding docs
alexlapa Jun 6, 2019
2c0468e
fix merge
alexlapa Jun 6, 2019
937a089
(cherry picked from commit 0c8a3aa585f703794ed589b761fbf41766249b89)
alexlapa May 17, 2019
7f75241
Merge branch 'cherry' into jason-media-management
alexlapa Jun 6, 2019
1b5a30a
fix merge
alexlapa Jun 6, 2019
7cf98c1
fix merge
alexlapa Jun 6, 2019
b06c40c
Merge branch 'cherry' into jason-media-management
alexlapa Jun 6, 2019
f8e9be9
fix merge
alexlapa Jun 6, 2019
00b29aa
Merge branch 'master' into jason-media-management
alexlapa Jun 6, 2019
b1b366b
fix merge
alexlapa Jun 6, 2019
dbfc982
fix deps locks cause rand broke again :(
alexlapa Jun 6, 2019
5fc03e8
fix tests
alexlapa Jun 6, 2019
4f922b4
documentation, refactor callbacks
alexlapa Jun 6, 2019
b374022
documentation
alexlapa Jun 7, 2019
a8e0d8b
documentation, refactor
alexlapa Jun 7, 2019
1eaa06b
documentation, refactor
alexlapa Jun 7, 2019
893749f
refactor
alexlapa Jun 12, 2019
c8b83d0
Merge branch 'master' into jason-media-management
alexlapa Jun 13, 2019
9ec0902
fix merge
alexlapa Jun 13, 2019
8503802
refactor
alexlapa Jun 13, 2019
8c7a826
refactor
alexlapa Jun 17, 2019
968d7f1
refactor
alexlapa Jun 17, 2019
ba7c847
refactor
alexlapa Jun 17, 2019
6400c66
add ice servers, decompose peer, clippy
alexlapa Jun 17, 2019
122731f
refactor
alexlapa Jun 17, 2019
9b95541
refactor
alexlapa Jun 17, 2019
9da4dbd
refactor
alexlapa Jun 17, 2019
78aba98
documentation
alexlapa Jun 17, 2019
91943d6
cleanup rpc connection on connection_established err
alexlapa Jun 18, 2019
86e6f91
fix race
alexlapa Jun 19, 2019
da85646
refactor
alexlapa Jun 25, 2019
d75eaca
refactor
alexlapa Jun 26, 2019
0fef592
Merge branch 'master' into jason-media-management
alexlapa Jun 26, 2019
1c93c72
merge
alexlapa Jun 26, 2019
f0c9cb7
refactor
alexlapa Jun 27, 2019
951e8c3
refactor
alexlapa Jun 27, 2019
d0ee404
refactor
alexlapa Jun 30, 2019
a34f535
minor fixes
alexlapa Jun 30, 2019
557b1b8
fix
alexlapa Jul 3, 2019
1b74b81
refcator transceivers management
alexlapa Jul 4, 2019
20f2ad9
impl from<str> && from<String> for wasmerr
alexlapa Jul 4, 2019
5774e18
refactoring transceivers management
alexlapa Jul 4, 2019
3547dd2
docs, refactor
alexlapa Jul 4, 2019
d882059
remove some debug
alexlapa Jul 5, 2019
b5f680e
refactor
alexlapa Jul 7, 2019
5647ada
refactor transceivers management
alexlapa Jul 7, 2019
21c7866
add InnerMediaConnections
alexlapa Jul 8, 2019
450117c
add RtcPeerConnection wrapper
alexlapa Jul 8, 2019
2a72a91
refactor
alexlapa Jul 8, 2019
778d70a
add InnerPeerConnection, on_ice_candidate, on_track
alexlapa Jul 8, 2019
1541a80
rearrange packages
alexlapa Jul 8, 2019
10c5106
fix memory leak
alexlapa Jul 9, 2019
95b31a0
fix tests
alexlapa Jul 9, 2019
78b74a4
update client api rfc
alexlapa Jul 9, 2019
e24f7e5
add TODO
alexlapa Jul 9, 2019
95ca265
refactor, use pub+pub in demo
alexlapa Jul 9, 2019
f00dd56
docs
alexlapa Jul 9, 2019
fcf9287
fix possible race with get_stream()
alexlapa Jul 9, 2019
bc251cb
docs
alexlapa Jul 10, 2019
b845e82
add `crate` param to `make docs`
alexlapa Jul 10, 2019
6cbf95f
add docs
alexlapa Jul 10, 2019
06f0e12
refactor server and components bootstrap to use future
alexlapa Jul 11, 2019
293b42b
use 1=>1 in tests and 1<=>1 in dev
alexlapa Jul 11, 2019
88199c2
Revert unnecessary changes and code style corrections
tyranron Jul 13, 2019
b68f0b4
Correct Makefile changes
tyranron Jul 13, 2019
135ce32
Refactor jason::utils
tyranron Jul 13, 2019
1fe6143
Corrections in jason crate
tyranron Jul 13, 2019
774b966
creating demo
alexlapa Jul 14, 2019
31fdd4d
creating demo
alexlapa Jul 14, 2019
8b7b340
Merge branch 'master' into p2p-demo
alexlapa Jul 18, 2019
6e07828
fmt
alexlapa Jul 18, 2019
cbbda3c
dockerize yarn, docker.build.demo
alexlapa Jul 19, 2019
27b1ee3
configure nginx to use wasm
alexlapa Jul 22, 2019
09dd88d
impl demo, docker-compose, make publish.jason
alexlapa Jul 22, 2019
7c55e01
impl demo, docker-compose
alexlapa Jul 23, 2019
51e0890
derive Clone for PeerStateMachine, Arc<TurnAuthService> in Participan…
alexlapa Jul 23, 2019
55fbedd
dont clone peers, some room management in demo client
alexlapa Jul 23, 2019
4e8e12e
make up.demo
alexlapa Jul 23, 2019
e9f5d85
fix tests
alexlapa Jul 23, 2019
2612892
reread
alexlapa Jul 23, 2019
fcccc80
reread
alexlapa Jul 23, 2019
0263451
Arc<Box<dyn _>> to Arc<dyn _>, increase logger buffer and OverflowStr…
alexlapa Jul 23, 2019
045a2f0
makefile: helm.init, helm.build, helm.dep, helm.up, helm.down, helm.l…
alexlapa Jul 26, 2019
e76d36f
Merge branch 'master' into 34-helm
alexlapa Jul 26, 2019
69aa048
makefile, medea-demo templates
alexlapa Jul 26, 2019
7f8f4a7
add config map, coturn, redis to medea-deployment
alexlapa Jul 30, 2019
0884195
makefile
alexlapa Jul 30, 2019
ffc2777
add tls
alexlapa Jul 30, 2019
1c2a23e
add tls
alexlapa Jul 30, 2019
686cfbf
parse medea url from location in demo, some naming changes in charts
alexlapa Jul 31, 2019
280d59c
values.yml
alexlapa Jul 31, 2019
940afa0
add tls section to values.yml
alexlapa Jul 31, 2019
c324788
build config map from files
alexlapa Jul 31, 2019
1df657c
oops
alexlapa Jul 31, 2019
6446209
pass config file to medea container
alexlapa Jul 31, 2019
c088ec9
pass medea conf file as env var
alexlapa Jul 31, 2019
93f5afd
reread
alexlapa Jul 31, 2019
5d8dbaf
Refactor Helm chart
tyranron Aug 1, 2019
57a2858
Move chart to demo dir
tyranron Aug 1, 2019
218b116
Correct Docker Compose env
tyranron Aug 1, 2019
4ff3e6f
Refactor Makefile
tyranron Aug 2, 2019
f3287bf
Refactor Makefile
tyranron Aug 2, 2019
3f42504
Impl Helm releasing
tyranron Aug 2, 2019
c3245f8
Impl publishing Helm chart to GitHub Pages
tyranron Aug 2, 2019
b2d1bab
Correct env vars
tyranron Aug 2, 2019
aea5ef6
Impl deployment to staging
tyranron Aug 2, 2019
b609928
Correct TURN IP for staging
tyranron Aug 2, 2019
0714d3f
Fix Redis DB arg evaluation for Coturn in Helm chart
tyranron Aug 5, 2019
7715904
Add ability to specify external_ip explicitly for Coturn in Helm chart
tyranron Aug 5, 2019
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
109 changes: 104 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,25 +204,29 @@ release.jason:
# Docker commands #
###################

docker-env = $(strip $(if $(call eq,$(minikube),yes),\
$(subst export,,$(shell minikube docker-env | cut -d '\#' -f1)),))

# Build Docker image for demo application.
#
# Usage:
# make docker.build.demo [TAG=(dev|<tag>)]
# make docker.build.demo [TAG=(dev|<tag>)] [minikube=(no|yes)]

docker-build-demo-image-name = $(DEMO_IMAGE_NAME)

docker.build.demo:
@make yarn proj=demo
docker build \
$(docker-env) \
docker build $(if $(call eq,$(minikube),yes),,--network=host) \
-t $(docker-build-demo-image-name):$(if $(call eq,$(TAG),),dev,$(TAG)) \
jason/demo


# Build medea project Docker image.
#
# Usage:
# make docker.build.medea [TAG=(dev|<tag>)]
# [debug=(yes|no)] [no-cache=(no|yes)]
# make docker.build.medea [TAG=(dev|<tag>)] [debug=(yes|no)]
# [no-cache=(no|yes)] [minikube=(no|yes)]

docker-build-medea-image-name = $(MEDEA_IMAGE_NAME)

Expand All @@ -237,7 +241,8 @@ ifneq ($(no-cache),yes)
endif
$(call docker.build.clean.ignore)
@echo "!target/$(if $(call eq,$(debug),no),release,debug)/" >> .dockerignore
docker build --network=host --force-rm \
$(docker-env) \
docker build $(if $(call eq,$(minikube),yes),,--network=host) --force-rm \
$(if $(call eq,$(no-cache),yes),\
--no-cache --pull,) \
$(if $(call eq,$(IMAGE),),\
Expand Down Expand Up @@ -309,6 +314,98 @@ up.medea:



##############################
# Helm and Minikube commands #
##############################

helm-cluster = $(if $(call eq,$(cluster),),minikube,$(cluster))

# Upgrade (or initialize) Tiller (server side of Helm) of Minikube.
#
# Usage:
# make helm.init [client-only=no [upgrade=(yes|no)]]
# [client-only=yes]

helm.init:
helm init --wait \
$(if $(call eq,$(client-only),yes),\
--client-only,\
--kube-context=minikube --tiller-namespace=kube-system \
$(if $(call eq,$(upgrade),no),,--upgrade))


# Run project in Minikube Kubernetes cluster as Helm release.
#
# Usage:
# make helm.up [rebuild=(no|yes) [no-cache=(no|yes)]] [wait=(yes|no)]
# [release=(dev|<current-git-branch>|<release-name>)]

helm.up:
ifeq ($(rebuild),yes)
@make docker.build.medea no-cache=$(no-cache) minikube=yes TAG=dev
endif
helm upgrade --install minikube _helm/medea-demo/ \
$(if $(call eq,$(wait),no),,\
--wait )


# Remove Helm release of project from Kubernetes Minikube cluster.
#
# Usage:
# make helm.down

helm.down:
$(if $(shell helm ls | grep 'minikube'),\
helm del --purge minikube ,\
@echo "--> No 'minikube' release found in $(helm-cluster) cluster")


# Lint project Helm chart.
#
# Usage:
# make helm.lint

helm.lint:
helm lint _helm/medea-demo/


# Bootstrap Minikube cluster (local Kubernetes) for development environment.
#
# The bootsrap script is updated automatically to the latest version every day.
# For manual update use 'update=yes' command option.
#
# Usage:
# make minikube.boot [update=(no|yes)]
# [driver=(virtualbox|hyperkit|hyperv)]
# [k8s-version=<kubernetes-version>]

minikube.boot:
ifeq ($(update),yes)
$(call minikube.boot.download)
else
ifeq ($(wildcard $(HOME)/.minikube/bootstrap.sh),)
$(call minikube.boot.download)
else
ifneq ($(shell find $(HOME)/.minikube/bootstrap.sh -mmin +1440),)
$(call minikube.boot.download)
endif
endif
endif
@$(if $(cal eq,$(driver),),,MINIKUBE_VM_DRIVER=$(driver)) \
$(if $(cal eq,$(k8s-version),),,MINIKUBE_K8S_VER=$(k8s-version)) \
$(HOME)/.minikube/bootstrap.sh
define minikube.boot.download
$()
@mkdir -p $(HOME)/.minikube/
@rm -f $(HOME)/.minikube/bootstrap.sh
curl -fL -o $(HOME)/.minikube/bootstrap.sh \
https://raw.githubusercontent.com/instrumentisto/toolchain/master/minikube/bootstrap.sh
@chmod +x $(HOME)/.minikube/bootstrap.sh
endef




##################
# .PHONY section #
##################
Expand All @@ -318,6 +415,8 @@ up.medea:
docker.build.demo docker.build.medea docker.down.demo docker.up.demo \
docs docs.rust \
release.jason \
helm helm.down helm.init helm.up \
minikube.boot \
test test.unit \
up up.coturn up.demo up.dev up.jason up.medea \
yarn
File renamed without changes.
2 changes: 0 additions & 2 deletions dev/coturn/turnserver.conf → _dev/coturn/turnserver.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ fingerprint
no-cli
no-tls
no-dtls
min-port=49160
max-port=49200
realm=medea
redis-userdb="ip=127.0.0.1 port=6379 dbname=0 password=turn"
user=USER:PASS
4 changes: 4 additions & 0 deletions _helm/medea-demo/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
name: medea-demo
version: 0.0.1
appVersion: 0.0.0
67 changes: 67 additions & 0 deletions _helm/medea-demo/conf/medea.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[server]
# IP address to bind HTTP server to.
bind_ip = "0.0.0.0"

# Port to bind HTTP server to.
bind_port = 8080




[rpc]
# Duration, after which remote RPC client will be considered idle if no
# heartbeat messages received.
idle_timeout = "10s"

# Duration, after which the server deletes the client session if
# the remote RPC client does not reconnect after it is idle.
reconnect_timeout = "10s"




[turn]
# Turn server IP address.
ip = "127.0.0.1"

# Turn server port.
port = 3478

# Static user on Turn server.
user = "USER"

# Static user password on Turn server.
pass = "PASS"

[turn.db.redis]
# Host of Coturn's Redis database.
host = "127.0.0.1"

# Port of Coturn's Redis database for client connections.
port = 6379

# Password to connect to Coturn's Redis database with.
pass = "turn"

# Number of Coturn's database in Redis.
db_number = 0

# Timeout for establishing connection with Coturn's Redis database.
connection_timeout = "5s"




[log]
# Maximum allowed level of application log entries.
#
# Possible values:
# "OFF", "CRITICAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"
level = "DEBUG"




[shutdown]
# Maximum duration given to shutdown the whole application gracefully.
timeout = "5s"
3 changes: 3 additions & 0 deletions _helm/medea-demo/conf/redis.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
requirepass turn
timeout 0
tcp-keepalive 60
8 changes: 8 additions & 0 deletions _helm/medea-demo/conf/turnserver.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
lt-cred-mech
fingerprint
no-cli
no-tls
no-dtls
realm=medea
redis-userdb="ip=127.0.0.1 port=6379 dbname=0 password=turn"
user=USER:PASS
40 changes: 40 additions & 0 deletions _helm/medea-demo/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{- if .Values.ingress.enabled -}}
{{- range $i, $host := .Values.ingress.hosts }}
---
kind: Ingress
apiVersion: extensions/v1beta1
metadata:
name: webclient.{{ $host }}
spec:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexlapa Helm mandatory labels and injectable annotations are missing. They should be present in every chart.

See: https://helm.sh/docs/chart_best_practices/#labels-and-annotations

{{- if $.Values.ingress.tls.enabled }}
tls:
- hosts:
- {{ $host | quote }}
- {{ printf "www.%s" $host | quote }}
secretName: medea-demo-cert
{{- end }}
rules:
- host: {{ $host | quote }}
http:
paths:
- path: /ws
backend:
serviceName: medea
servicePort: http
- path: /
backend:
serviceName: webclient
servicePort: http
- host: {{ printf "www.%s" $host | quote }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no sense to consider www. case for our demo. It's mostly used by legacy sites exposed to broad public audience.

http:
paths:
- path: /ws
backend:
serviceName: medea
servicePort: http
- path: /
backend:
serviceName: webclient
servicePort: http
{{- end }}
{{- end -}}
11 changes: 11 additions & 0 deletions _helm/medea-demo/templates/medea-config-map.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
data:
redis.conf: |
{{- tpl (.Files.Get "conf/redis.conf") . | nindent 4 }}
coturn.turnserver.conf: |
{{- tpl (.Files.Get "conf/turnserver.conf") . | nindent 4 }}
medea.toml: |
{{- tpl (.Files.Get "conf/medea.toml") . | nindent 4 }}
kind: ConfigMap
metadata:
name: medea.config
77 changes: 77 additions & 0 deletions _helm/medea-demo/templates/medea-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
kind: Deployment
apiVersion: apps/v1
metadata:
name: medea
labels:
app: medea
tier: backend
spec:
selector:
matchLabels:
app: medea
tier: backend
template:
spec:
hostNetwork: true
containers:
- name: medea
image: "{{ $.Values.medea.image.repository }}:{{ $.Values.medea.image.tag }}"
imagePullPolicy: {{ $.Values.medea.image.pullPolicy }}
env:
- name: MEDEA_CONF
value: '/etc/medea.toml'
ports:
- name: medea-http
containerPort: 8080
volumeMounts:
- name: config
subPath: medea.toml
mountPath: /etc/medea.toml
readOnly: true
- name: coturn-db
image: redis:alpine
imagePullPolicy: IfNotPresent
args: ['redis-server', '/etc/redis.conf']
volumeMounts:
- name: config
subPath: redis.conf
mountPath: /etc/redis.conf
readOnly: true
livenessProbe:
exec:
command: ['redis-cli', 'ping']
initialDelaySeconds: 30
readinessProbe:
exec:
command: ['redis-cli', 'ping']
initialDelaySeconds: 5
- name: coturn
image: instrumentisto/coturn:4.5
imagePullPolicy: Always
args:
- --verbose
- --log-file=stdout
ports:
- name: turn
containerPort: 3478
protocol: TCP
- name: turn-udp
containerPort: 3478
protocol: UDP
volumeMounts:
- name: config
subPath: coturn.turnserver.conf
mountPath: /etc/coturn/turnserver.conf
readOnly: true
- name: coturn-data
mountPath: /var/lib/coturn
volumes:
- name: config
configMap:
name: medea.config
- name: coturn-data
emptyDir: {}
metadata:
labels:
app: medea
tier: backend
15 changes: 15 additions & 0 deletions _helm/medea-demo/templates/medea-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
kind: Service
apiVersion: v1
metadata:
name: medea
labels:
app: medea
tier: backend
spec:
selector:
app: medea
tier: backend
ports:
- name: http
port: 80
targetPort: 8080
Loading