Skip to content

Commit

Permalink
[home] added external-mic
Browse files Browse the repository at this point in the history
  • Loading branch information
gruberdev committed Feb 2, 2024
1 parent 68a8dbc commit c47eef9
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 0 deletions.
38 changes: 38 additions & 0 deletions apps/argocd/base/home/external-mic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: external-mic
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: apps
source:
repoURL: "https://github.com/gruberdev/homelab.git"
path: apps/home/external-mic
targetRevision: main
destination:
namespace: homeassistant
name: in-cluster
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- Prune=true
- ServerSideApply=true
retry:
limit: 10
backoff:
duration: 20s
factor: 2
maxDuration: 15m
kustomize:
commonLabels:
app.kubernetes.io/category: home
info:
- name: "Github Repository:"
value: >-
https://github.com/rhasspy/wyoming-mic-external
- name: "Homelab documentation:"
value: >-
https://github.com/gruberdev/homelab/tree/main/apps/home/external-mic
1 change: 1 addition & 0 deletions apps/argocd/base/home/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ resources:
- piper.yaml
- whisper.yaml
- wyze.yaml
- external-mic.yaml

commonLabels:
app.kubernetes.io/category: home
Expand Down
15 changes: 15 additions & 0 deletions apps/home/broadlink-manager/base/svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: broadlink-manager-internal
labels:
app: broadlink-manager
spec:
selector:
app: broadlink-manager
ports:
- name: http
port: 80
targetPort: 7020
protocol: TCP
type: ClusterIP
1 change: 1 addition & 0 deletions apps/home/external-mic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Wyoming external-microphone
55 changes: 55 additions & 0 deletions apps/home/external-mic/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: external-mic
labels:
app: external-mic
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: external-mic
template:
metadata:
labels:
app: external-mic
spec:
securityContext:
fsGroup: 29
supplementalGroups: [29]
containers:
- name: server
image: grubertech/external-mic:v0.0.1
securityContext:
privileged: true
command: ["sh", "-c"]
args:
- |
pip install wyoming &&
python -m wyoming_mic_external \
--program "''arecord --device plughw:CARD=C920,DEV=0 -r 16000 -c 1 -f S16_LE -t raw''" \
--rate "16000" \
--width "2" \
--channels "1" \
--uri "tcp://0.0.0.0:10600" \
--debug
ports:
- name: http
containerPort: 10600
protocol: TCP
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 300m
memory: 256Mi
volumeMounts:
- name: dev-snd
mountPath: /dev/snd
volumes:
- name: dev-snd
hostPath:
path: /dev/snd
5 changes: 5 additions & 0 deletions apps/home/external-mic/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- svc.yaml
15 changes: 15 additions & 0 deletions apps/home/external-mic/base/svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: external-mic-internal
labels:
app: external-mic
spec:
selector:
app: external-mic
ports:
- name: http
port: 80
targetPort: 10600
protocol: TCP
type: ClusterIP
17 changes: 17 additions & 0 deletions apps/home/external-mic/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./base

namespace: homeassistant

patches:
- patch: |-
- op: add
path: "/spec/template/spec/nodeSelector"
value:
kubernetes.io/hostname: node-two
kubernetes.io/arch: amd64
target:
kind: Deployment
name: external-mic

0 comments on commit c47eef9

Please sign in to comment.