Hello -
I am trying to get a sound app working for kubernetes use, and for testing I am trying to get a test platform working on the dev machines using minikube. And the first thing I am trying is to get the pulse audio socket mounted and accessible to the app in the pod. I have the socket there, but the app keeps giving me a connection refused error. I can get the docker image working from a local container with docker run, but I can’t get it to work in minikube. I’m not sure what I am missing, if I could get some help or some general notes in the best way of exposing the machine sound to a pod in minikube.
Cluster information:
Kubernetes version: minikube version: v1.12.1
Cloud being used: bare-metal
Installation method: Not sure
Host OS: Ubuntu 18.04.5 LTS
CNI and version: not sure
CRI and version: not sure
You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.
apiVersion: v1
kind: ConfigMap
metadata:
creationTimestamp: 2020-08-06T18:01:01Z
name: pulse-audio-config-data
namespace: default
data:
config-file: |-
default-server = unix:/tmp/pulse/pulseaudio.socket
autospawn = no
daemon-binary = /bin/true
enable-shm = false
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-service-deployment
labels:
app: my-service
spec:
replicas: 1
selector:
matchLabels:
app: my-service
template:
metadata:
labels:
app: my-service
spec:
securityContext:
fsGroup: 9999
volumes:
- name: audio-socket
hostPath:
path: /tmp/pulse
- name: pulse-conf
configMap:
name: pulse-audio-config-data
items:
- key: config-file
path: client.conf
containers:
- name: my-service
image: my-image:my-tag
securityContext:
runAsUser: 9999
runAsGroup: 9999
allowPrivilegeEscalation: true
privileged: true
env:
- name: PULSE_SERVER
value: "unix:/tmp/pulse/pulseaudio.socket"
- name: PULSE_COOKIE
value: "/tmp/pulseaudio.cookie"
volumeMounts:
- name: audio-socket
mountPath: "/tmp/pulse"
- name: pulse-conf
mountPath: /etc/pulse