summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2018-02-10 19:17:08 +0100
committerChristian Pointner <equinox@spreadspace.org>2018-02-10 19:17:08 +0100
commit9e81bbd8db0658def59694b9d5e29e461c759e1d (patch)
tree4bac74180a5b121c2c472f207328e76726d005fe /templates
parentrevised worker flags (diff)
make use of new and revised worker flags for inputs
Diffstat (limited to 'templates')
-rw-r--r--templates/default/kubernetes/flumotion-worker-deploy.yml.j236
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