summaryrefslogtreecommitdiff
path: root/roles/streaming/icecast/templates
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-04-23 22:46:12 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-04-23 22:46:12 +0200
commit476c03d6003f21cbf7fd83f18738ab06c1cf6230 (patch)
treeb5cc7c4d1737b71dc6c29628595398df6bbe4596 /roles/streaming/icecast/templates
parentsgg-icecast: standalone kubelet (diff)
icecast2 role and test deployment
Diffstat (limited to 'roles/streaming/icecast/templates')
-rw-r--r--roles/streaming/icecast/templates/icecast.xml.j271
-rw-r--r--roles/streaming/icecast/templates/pod-spec.yml.j231
2 files changed, 102 insertions, 0 deletions
diff --git a/roles/streaming/icecast/templates/icecast.xml.j2 b/roles/streaming/icecast/templates/icecast.xml.j2
new file mode 100644
index 00000000..3bf0044a
--- /dev/null
+++ b/roles/streaming/icecast/templates/icecast.xml.j2
@@ -0,0 +1,71 @@
+<icecast>
+<!-- ***** global ***** -->
+ <listen-socket>
+ <port>8080</port>
+ </listen-socket>
+
+ <limits>
+ <threadpool>5</threadpool>
+ <queue-size>524288</queue-size>
+ <client-timeout>30</client-timeout>
+ <header-timeout>15</header-timeout>
+ <source-timeout>10</source-timeout>
+ <burst-on-connect>1</burst-on-connect>
+ <burst-size>32768</burst-size>
+ </limits>
+
+ <authentication>
+ <source-password>{{ item.value.source_password }}</source-password>
+ <relay-password>{{ item.value.relay_password }}</relay-password>
+ <admin-user>{{ item.value.admin.username }}</admin-user>
+ <admin-password>{{ item.value.admin.password }}</admin-password>
+ </authentication>
+
+{% if 'hostname' in item.value %}
+ <hostname>{{ item.value.hostname }}</hostname>
+{% endif %}
+{% if 'location' in item.value %}
+ <location>{{ item.value.location }}</location>
+{% endif %}
+{% if 'contact' in item.value %}
+ <admin>{{ item.value.contact }}</admin>
+{% endif %}
+
+
+<!-- ***** mountpoints ***** -->
+{% for mountpoint, config in item.value.mountpoints.items() %}
+ <mount>
+ <mount-name>{{ mountpoint }}</mount-name>
+{% if 'username' in config %}
+ <username>{{ config.username }}</username>
+{% endif %}
+ <password>{{ config.password }}</password>
+{% if 'max_listeners' in config %}
+ <max-listeners>{{ config.max_listeners }}</max-listeners>
+{% endif %}
+ </mount>
+
+{% endfor %}
+
+<!-- ***** aux ***** -->
+ <fileserve>1</fileserve>
+ <paths>
+ <basedir>/usr/share/icecast2</basedir>
+ <logdir>/srv/logs</logdir>
+ <webroot>/usr/share/icecast2/web</webroot>
+ <adminroot>/usr/share/icecast2/admin</adminroot>
+ <alias source="/" dest="/status.xsl"/>
+ </paths>
+
+ <logging>
+ <errorlog>-</errorlog>
+ <accesslog>access.log</accesslog>
+ <loglevel>3</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
+ <logsize>100000</logsize> <!-- Max size of a logfile -->
+ </logging>
+
+ <security>
+ <chroot>0</chroot>
+ </security>
+<!-- ***** end ***** -->
+</icecast>
diff --git a/roles/streaming/icecast/templates/pod-spec.yml.j2 b/roles/streaming/icecast/templates/pod-spec.yml.j2
new file mode 100644
index 00000000..5dc0b086
--- /dev/null
+++ b/roles/streaming/icecast/templates/pod-spec.yml.j2
@@ -0,0 +1,31 @@
+securityContext:
+ allowPrivilegeEscalation: false
+ runAsUser: 990
+ runAsGroup: 990
+containers:
+- name: icecast
+ image: registry.gitlab.com/spreadspace/docker/icecast:{{ item.value.image_version }}
+ imagePullPolicy: Always
+ resources:
+ limits:
+ memory: "512Mi"
+ args:
+ - icecast2
+ - -c
+ - /srv/icecast.xml
+ volumeMounts:
+ - name: home
+ mountPath: /srv/icecast.xml
+ subPath: icecast.xml
+ readOnly: true
+ - name: home
+ mountPath: /srv/logs
+ subPath: logs
+ ports:
+ - containerPort: 8080
+ hostPort: {{ item.value.port }}
+
+volumes:
+- name: home
+ hostPath:
+ path: "{{ icecast_base_path }}/{{ item.key }}"