diff options
Diffstat (limited to 'templates/default')
-rw-r--r-- | templates/default/kubernetes/flumotion-worker-deploy.yml.j2 | 36 |
1 files changed, 29 insertions, 7 deletions
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 |