summaryrefslogtreecommitdiff
path: root/roles/streaming/rtmp/streamer/templates/pod-spec.yml.j2
blob: f670fb25d9bfb0c6aa797a2e5e7af32de612d5e7 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
containers:
- name: nginx
  image: registry.gitlab.com/spreadspace/docker/nginx:{{ rtmp_streamer_nginx_image_version }}
  imagePullPolicy: Always
  command:
  - nginx
  args:
  - -c
  - /srv/nginx.conf
  - -g
  - "daemon off;"
  ports:
  - containerPort: 1935
    hostPort: {{ rtmp_streamer_port }}
  volumeMounts:
  - name: home
    mountPath: /srv
    readOnly: true
  - name: nginx-lib
    mountPath: /var/lib/nginx

- name: ffmpeg
  image: registry.gitlab.com/spreadspace/docker/nginx:{{ rtmp_streamer_nginx_image_version }}
  imagePullPolicy: Always
  command:
  - ffmpeg-decklink-rtmp.py
  args:
  - "{{ rtmp_streamer_decklink_card }}"
{% for level in rtmp_streamer_quality_levels %}
  - {{ level }}
{% endfor %}
  securityContext:
    privileged: true
  volumeMounts:
  - name: home
    mountPath: /srv
    readOnly: true
  - name: decklink-device
    mountPath: /dev/blackmagic
  - name: decklink-libs
    subPath: libDeckLinkAPI.so
    mountPath: /usr/lib/libDeckLinkAPI.so
    readOnly: true
  - name: decklink-libs
    subPath: libDeckLinkPreviewAPI.so
    mountPath: /usr/lib/libDeckLinkPreviewAPI.so
    readOnly: true
  - name: decklink-libs
    subPath: blackmagic
    mountPath: /usr/lib/blackmagic
    readOnly: true
  env:
  - name: CONFIG_FILENAME
    value: /srv/config.yml

{% if rtmp_streamer_recording_enabled %}
- name: record
  image: registry.gitlab.com/spreadspace/docker/nginx:{{ rtmp_streamer_nginx_image_version }}
  imagePullPolicy: Always
  args:
  - /srv/record.sh
  volumeMounts:
  - name: home
    mountPath: /srv
    readOnly: true
  - name: recordings
    mountPath: /srv/recordings

{% endif %}
volumes:
- name: home
  hostPath:
    path: "{{ rtmp_streamer_base_path }}/{{ rtmp_streamer_inst_name }}"
- name: nginx-lib
  emptyDir:
    medium: Memory
- name: decklink-device
  hostPath:
    path: /dev/blackmagic
- name: decklink-libs
  hostPath:
    type: Directory
    path: /usr/lib/
{% if rtmp_streamer_recording_enabled %}
- name: recordings
  hostPath:
    type: Directory
    path: "{{ rtmp_streamer_base_path }}/{{ rtmp_streamer_inst_name }}/recordings"
{% endif %}