#SPDX-License-Identifier: MIT-0 --- # tasks file for ansible-role-nginx-rtmp - name: Create nginx-rtmp namespace k8s: state: present definition: apiVersion: v1 kind: Namespace metadata: name: nginx-rtmp - name: Create config map for nginx-rtmp volume k8s: state: present definition: apiVersion: v1 kind: ConfigMap metadata: name: nginx namespace: nginx-rtmp data: nginx.conf: "{{ lookup('template', 'nginx.conf.j2') }}" - name: Create a Deployment k8s: definition: apiVersion: apps/v1 kind: Deployment metadata: name: nginx-rtmp namespace: nginx-rtmp spec: replicas: 1 selector: matchLabels: app: nginx-rtmp template: metadata: labels: app: nginx-rtmp spec: containers: - name: nginx-rtmp image: ericomeehan/nginx-rtmp volumeMounts: - name: config mountPath: /etc/nginx/nginx.conf subPath: nginx.conf ports: - containerPort: 1935 volumes: - name: config configMap: name: nginx - name: Expose Deployment as a Service k8s: definition: apiVersion: v1 kind: Service metadata: name: nginx-rtmp namespace: nginx-rtmp spec: selector: app: nginx-rtmp ports: - port: 1935 protocol: TCP name: rtmp type: LoadBalancer