diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/examples/elevate2018.yml | 2 | ||||
-rwxr-xr-x | src/flufigut.py | 24 |
2 files changed, 23 insertions, 3 deletions
diff --git a/src/examples/elevate2018.yml b/src/examples/elevate2018.yml index 20b1eb0..8dfc7c4 100644 --- a/src/examples/elevate2018.yml +++ b/src/examples/elevate2018.yml @@ -109,7 +109,9 @@ streams: burst-on-connect: 5 hostname: "emc-%02i.spreadspace.org" repeater: True + lb-hostname: "elevate-live.spreadspace.org" onion-service: "elevateh7tpoo7eg.onion" + site-hostname: "stream.elevate.at" records: av: mux: avr diff --git a/src/flufigut.py b/src/flufigut.py index ada1813..638075d 100755 --- a/src/flufigut.py +++ b/src/flufigut.py @@ -782,6 +782,20 @@ class K8sDeployment: cm = self.__generate_object(tmpl_env, 'onion-service-cm.yml', deploy) v1.create_namespaced_config_map(self._namespace, cm) + def _deploy_stream_loadbalancer(self, template_dir, tmpl_env, v1, appsV1, stream_name, stream): + streamers = [] + for idx in range(stream['count']): + streamers.append(stream['hostname'] % (idx + 1)) + + cm = self.__generate_object(tmpl_env, 'stream-lb-cm.yml', {'stream': stream_name, 'streamers': streamers}) + v1.create_namespaced_config_map(self._namespace, cm) + + svc = self.__generate_object(tmpl_env, 'stream-lb-svc.yml', {'stream': stream_name, 'streamers': streamers}) + v1.create_namespaced_service(self._namespace, svc) + + deploy = self.__generate_object(tmpl_env, 'stream-lb-deploy.yml', {'stream': stream_name, 'streamers': streamers}) + appsV1.create_namespaced_deployment(self._namespace, deploy) + def _deploy_stream_website(self, template_dir, tmpl_env, v1, appsV1, stream_name, stream): # TODO: add me pass @@ -820,17 +834,21 @@ class K8sDeployment: for _, worker in self._planet.workers.items(): if not len(worker['subs']): worker['subs']['worker'] = { - 'fullname': worker['name'], - 'flags': worker['flags'] + 'fullname': + worker['name'], + 'flags': + worker['flags'] } self._deploy_flumotion_worker(template_dir, tmpl_env, v1, appsV1, worker) 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 'lb-hostname' in stream: + self._deploy_stream_loadbalancer(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) + self._deploy_stream_website(template_dir, tmpl_env, v1, appsV1, stream_name, stream) if self.__has_onion_service: role = self.__generate_object(tmpl_env, 'onion-service-role.yml') |