From 9e81bbd8db0658def59694b9d5e29e461c759e1d Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 10 Feb 2018 19:17:08 +0100 Subject: make use of new and revised worker flags for inputs --- .../kubernetes/flumotion-worker-deploy.yml.j2 | 36 +++++++++++++++++----- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'templates/default/kubernetes') diff --git a/templates/default/kubernetes/flumotion-worker-deploy.yml.j2 b/templates/default/kubernetes/flumotion-worker-deploy.yml.j2 index bee42cc..0705364 100644 --- a/templates/default/kubernetes/flumotion-worker-deploy.yml.j2 +++ b/templates/default/kubernetes/flumotion-worker-deploy.yml.j2 @@ -48,30 +48,52 @@ spec: volumeMounts: - name: home mountPath: /srv -%% if 'input-decklink' in sub.flags - - name: decklink-devices - mountPath: /dev/blackmagic +%% if 'input' in sub.flags +%% set _needs_ = { 'decklink_libs': False, 'privileged': False } +%% for input_name in worker.flags.input +%% if desc.inputs[input_name].type == 'decklink' +%% if _needs_.update({'decklink_libs': True, 'privileged': True}) +%# jinja variables are weird... https://stackoverflow.com/questions/9486393 +%% endif + - name: decklink-device-{{ desc.inputs[input_name].properties.device }} + mountPath: /dev/blackmagic/dv{{ desc.inputs[input_name].properties.device }} +%% endif +%% endfor +%% if _needs_.decklink_libs - name: decklink-libs subPath: libDeckLinkAPI.so mountPath: /usr/lib/libDeckLinkAPI.so - name: decklink-libs subPath: libDeckLinkPreviewAPI.so mountPath: /usr/lib/libDeckLinkPreviewAPI.so +%% endif +%% if _needs_.privileged securityContext: privileged: true +%% endif %% endif %% endfor volumes: - name: home emptyDir: medium: Memory -%% if 'input-decklink' in worker.flags - - name: decklink-devices +%% if 'input' in worker.flags +%% set _needs_ = { 'decklink_libs': False } +%% for input_name in worker.flags.input +%% if desc.inputs[input_name].type == 'decklink' +%% if _needs_.update({'decklink_libs': True}) +%# jinja variables are weird... https://stackoverflow.com/questions/9486393 +%% endif + - name: decklink-device-{{ desc.inputs[input_name].properties.device }} hostPath: - type: Directory - path: /dev/blackmagic + type: File {# CharDevice doesn't work for some reason... #} + path: /dev/blackmagic/dv{{ desc.inputs[input_name].properties.device }} +%% endif +%% endfor +%% if _needs_.decklink_libs - name: decklink-libs hostPath: type: Directory path: /usr/lib/ +%% endif %% endif -- cgit v1.2.3