summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/examples/elevate2018.yml36
-rwxr-xr-xsrc/flufigut.py22
2 files changed, 40 insertions, 18 deletions
diff --git a/src/examples/elevate2018.yml b/src/examples/elevate2018.yml
index 4bb1860..20b1eb0 100644
--- a/src/examples/elevate2018.yml
+++ b/src/examples/elevate2018.yml
@@ -91,25 +91,25 @@ muxes:
mp3: [ high, medium, low, mini ]
streams:
local:
- muxes: [ av-orig, audio-orig ]
- nginx-muxes: [ av-orig ]
- type: http
- count: 1
- port: 8000
- max-con: 100
- burst-on-connect: 5
- hostname: elevate-feed.spreadspace.org
+ muxes: [ av-orig, audio-orig ]
+ nginx-muxes: [ av-orig ]
+ type: http
+ count: 1
+ port: 8000
+ max-con: 100
+ burst-on-connect: 5
+ hostname: elevate-feed.spreadspace.org
public:
- muxes: [ av-orig, audio-orig ]
- nginx-muxes: [ av-orig ]
- type: http
- count: 4
- port: 8000
- max-bw: 290000000
- burst-on-connect: 5
- hostname: "emc-%02i.spreadspace.org"
- repeater: True
- onion-service: "elevateh7tpoo7eg.onion"
+ muxes: [ av-orig, audio-orig ]
+ nginx-muxes: [ av-orig ]
+ type: http
+ count: 4
+ port: 8000
+ max-bw: 290000000
+ burst-on-connect: 5
+ hostname: "emc-%02i.spreadspace.org"
+ repeater: True
+ onion-service: "elevateh7tpoo7eg.onion"
records:
av:
mux: avr
diff --git a/src/flufigut.py b/src/flufigut.py
index f13c5b4..94c393d 100755
--- a/src/flufigut.py
+++ b/src/flufigut.py
@@ -765,6 +765,19 @@ class K8sDeployment:
deploy = self.__generate_object(tmpl_env, 'sfive-deploy.yml', {'worker': worker})
appsV1.create_namespaced_deployment(self._namespace, deploy)
+ def _deploy_onion_service_config(self, template_dir, tmpl_env, v1, stream_name, stream):
+ deploy = {'stream': stream_name}
+ deploy['onion_services'] = {}
+ # TODO: hardcoded value (sync with sfive_proxy_config)
+ deploy['onion_services'][stream['port']] = {'host': '127.0.0.1', 'port': 8001}
+ # TODO: add port 80 -> onion streaming site
+ cm = self.__generate_object(tmpl_env, 'onion-service-cm.yml', deploy)
+ v1.create_namespaced_config_map(self._namespace, cm)
+
+ def _deploy_stream_website(self, template_dir, tmpl_env, v1, appsV1, stream_name, stream):
+ # TODO: add me
+ pass
+
def _deploy_onionbalance(self, template_dir, tmpl_env, v1, appsV1, rbacV1):
sa = self.__generate_object(tmpl_env, 'onionbalance-sa.yml')
v1.create_namespaced_service_account(self._namespace, sa)
@@ -776,6 +789,10 @@ class K8sDeployment:
rbacV1.create_namespaced_role_binding(self._namespace, rb)
secret = self.__generate_object(tmpl_env, 'onionbalance-secret.yml')
+ # TODO: for _, stream in self._desc.streams:
+ # if 'onion-service' in stream:
+ # key = ~~~~get_key(stream['onion-service'])
+ # secret['data'][stream['onion-service']] = base64.b64encode(key).decode('ascii')
v1.create_namespaced_secret(self._namespace, secret)
worker = self._planet.workers[self._desc.globals['deployment']['parameter']['onionbalance_worker']]
@@ -802,6 +819,11 @@ class K8sDeployment:
self._deploy_nginx_worker(template_dir, tmpl_env, v1, appsV1, worker)
self._deploy_sfive_worker(template_dir, tmpl_env, v1, appsV1, worker)
+ for stream_name, stream in self._desc.streams.items():
+ self._deploy_stream_website(template_dir, tmpl_env, v1, appsV1, stream_name, stream)
+ if 'onion-service' in stream:
+ self._deploy_onion_service_config(template_dir, tmpl_env, v1, stream_name, stream)
+
if self.__has_onion_service:
role = self.__generate_object(tmpl_env, 'onion-service-role.yml')
rbacV1.create_namespaced_role(self._namespace, role)