summaryrefslogtreecommitdiff
path: root/templates/default/kubernetes/flumotion-worker-deploy.yml.j2
blob: 60a8ebe6d736fa7f35b7032758dd18b47e00ea7c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: {{ namespace }}
  name: flumotion-worker-{{ worker.name }}
  labels:
    app: flumotion
    type: worker
spec:
  replicas: 1
  selector:
    matchLabels:
      app: flumotion
      type: worker
  strategy:
    type: Recreate
  revisionHistoryLimit: 5
  template:
    metadata:
      labels:
        app: flumotion
        type: worker
    spec:
      nodeName: {{ worker.name }}
      securityContext:
        runAsUser: 998
        fsGroup: 998
      containers:
{% for subname, sub in worker.subs.items() %}
      - name: {{ subname }}
        image: spreadspace/flumotion:worker-{{ desc.globals.deployment.parameter.image_version }}
        imagePullPolicy: Always
        args:
        - --verbose
        - -H {{ desc.globals.manager.host }}
        - -P {{ desc.globals.manager.port }}
        - -T {{ desc.globals.manager.transport }}
        - -n {{ sub.fullname }}
        - -u {{ worker.name }}
        - -p {{ worker.password }}
        - -F {{ 8000 + loop.index0 * 10 }}-{{ 8001 + loop.index0 * 10 }}
        volumeMounts:
        - name: home
          mountPath: /srv
{% if 'input-decklink' in sub.flags %}
        - name: decklink-devices
          mountPath: /dev/blackmagic
        - name: decklink-libs
          subPath: libDeckLinkAPI.so
          mountPath: /usr/lib/libDeckLinkAPI.so
        - name: decklink-libs
          subPath: libDeckLinkPreviewAPI.so
          mountPath: /usr/lib/libDeckLinkPreviewAPI.so
        securityContext:
          privileged: true
{% endif %}
{% endfor %}
      volumes:
      - name: home
        emptyDir:
          medium: Memory
{% if 'input-decklink' in worker.flags %}
      - name: decklink-devices
        hostPath:
          type: Directory
          path: /dev/blackmagic
      - name: decklink-libs
        hostPath:
          type: Directory
          path: /usr/lib/
{% endif %}