diff --git a/services/wyoming/deploy/app/kustomization.yaml b/services/wyoming/deploy/app/kustomization.yaml new file mode 100644 index 0000000..05072a8 --- /dev/null +++ b/services/wyoming/deploy/app/kustomization.yaml @@ -0,0 +1,15 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: wyoming +resources: + - pvc.yaml + - piper-deployment.yaml + - piper-service.yaml + - whisper-deployment.yaml + - whisper-service.yaml + - piper-image-policy.yaml + - piper-image-repo.yaml + - piper-image-update-automation.yaml + - whisper-image-policy.yaml + - whisper-image-repo.yaml + - whisper-image-update-automation.yaml \ No newline at end of file diff --git a/services/wyoming/deploy/app/piper-deployment.yaml b/services/wyoming/deploy/app/piper-deployment.yaml new file mode 100644 index 0000000..85b1b24 --- /dev/null +++ b/services/wyoming/deploy/app/piper-deployment.yaml @@ -0,0 +1,49 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + namespace: wyoming + name: wyoming-piper + labels: + app: wyoming-piper +spec: + replicas: 1 + selector: + matchLabels: + app: wyoming-piper + template: + metadata: + labels: + app: wyoming-piper + spec: + nodeSelector: + role: worker-node + containers: + - name: wyoming-piper + ### Maintained by flux - Image Update Automation + image: rhasspy/wyoming-piper # {"$imagepolicy": "wyoming:piper"} + ### + volumeMounts: + - mountPath: /data + name: data + args: + - --voice + - en-gb-southern_english_female-low + ports: + - containerPort: 10200 + volumes: + - name: data + persistentVolumeClaim: + claimName: wyoming-piper + +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: wyoming-piper + namespace: wyoming +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi \ No newline at end of file diff --git a/services/wyoming/deploy/app/piper-image-policy.yaml b/services/wyoming/deploy/app/piper-image-policy.yaml new file mode 100644 index 0000000..1b9937a --- /dev/null +++ b/services/wyoming/deploy/app/piper-image-policy.yaml @@ -0,0 +1,13 @@ +apiVersion: image.toolkit.fluxcd.io/v1 +kind: ImagePolicy +metadata: + name: piper +spec: + imageRepositoryRef: + name: piper + filterTags: + pattern: '^latest$' + policy: + alphabetical: {} + digestReflectionPolicy: Always + interval: 24h \ No newline at end of file diff --git a/services/wyoming/deploy/app/piper-image-repo.yaml b/services/wyoming/deploy/app/piper-image-repo.yaml new file mode 100644 index 0000000..214c77d --- /dev/null +++ b/services/wyoming/deploy/app/piper-image-repo.yaml @@ -0,0 +1,7 @@ +apiVersion: image.toolkit.fluxcd.io/v1 +kind: ImageRepository +metadata: + name: piper +spec: + image: rhasspy/wyoming-piper + interval: 72h \ No newline at end of file diff --git a/services/wyoming/deploy/app/piper-image-update-automation.yaml b/services/wyoming/deploy/app/piper-image-update-automation.yaml new file mode 100644 index 0000000..1f75f48 --- /dev/null +++ b/services/wyoming/deploy/app/piper-image-update-automation.yaml @@ -0,0 +1,25 @@ +apiVersion: image.toolkit.fluxcd.io/v1 +kind: ImageUpdateAutomation +metadata: + name: piper +spec: + interval: 72h + sourceRef: + kind: GitRepository + name: casa + namespace: casa-limbosolutions-com + git: + checkout: + ref: + branch: main + commit: + author: + name: FluxCD + email: flux@local + messageTemplate: | + Update wyoming piper image. + push: + branch: main + update: + path: ./services/wyoming/deploy/app/piper-deployment.yaml + strategy: Setters \ No newline at end of file diff --git a/services/wyoming/deploy/app/piper-service.yaml b/services/wyoming/deploy/app/piper-service.yaml new file mode 100644 index 0000000..b9199e1 --- /dev/null +++ b/services/wyoming/deploy/app/piper-service.yaml @@ -0,0 +1,18 @@ +# dns: piper.wyoming.svc.cluster.local +apiVersion: v1 +kind: Service +metadata: + name: piper + namespace: wyoming + labels: + app: wyoming-piper +spec: + selector: + app: wyoming-piper + ports: + - name: tcp-piper + protocol: TCP + port: 10200 + targetPort: 10200 + type: ClusterIP + diff --git a/services/wyoming/deploy/app/pvc.yaml b/services/wyoming/deploy/app/pvc.yaml new file mode 100644 index 0000000..40c95b2 --- /dev/null +++ b/services/wyoming/deploy/app/pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: wyoming-whisper + namespace: wyoming +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 8Gi \ No newline at end of file diff --git a/services/wyoming/deploy/app/whisper-deployment.yaml b/services/wyoming/deploy/app/whisper-deployment.yaml new file mode 100644 index 0000000..9c49a76 --- /dev/null +++ b/services/wyoming/deploy/app/whisper-deployment.yaml @@ -0,0 +1,44 @@ + +apiVersion: apps/v1 +kind: Deployment +metadata: + namespace: wyoming + name: wyoming-whisper + labels: + app: wyoming-whisper +spec: + replicas: 1 + selector: + matchLabels: + app: wyoming-whisper + template: + metadata: + labels: + app: wyoming-whisper + spec: + nodeSelector: + role: worker-node + containers: + - name: wyoming-whisper + ### Maintained by flux - Image Update Automation + image: rhasspy/wyoming-whisper # {"$imagepolicy": "wyoming:piper"} + ### + volumeMounts: + - mountPath: /data + name: data + args: + - --model + - small-int8 + - --language + - pt + - --beam-size + - "4" + - --debug + ports: + - name: tcp-whisper + containerPort: 10300 + volumes: + - name: data + persistentVolumeClaim: + claimName: wyoming-whisper + diff --git a/services/wyoming/deploy/app/whisper-image-policy.yaml b/services/wyoming/deploy/app/whisper-image-policy.yaml new file mode 100644 index 0000000..f4b9771 --- /dev/null +++ b/services/wyoming/deploy/app/whisper-image-policy.yaml @@ -0,0 +1,13 @@ +apiVersion: image.toolkit.fluxcd.io/v1 +kind: ImagePolicy +metadata: + name: whisper +spec: + imageRepositoryRef: + name: whisper + filterTags: + pattern: '^latest$' + policy: + alphabetical: {} + digestReflectionPolicy: Always + interval: 24h \ No newline at end of file diff --git a/services/wyoming/deploy/app/whisper-image-repo.yaml b/services/wyoming/deploy/app/whisper-image-repo.yaml new file mode 100644 index 0000000..6e390a6 --- /dev/null +++ b/services/wyoming/deploy/app/whisper-image-repo.yaml @@ -0,0 +1,7 @@ +apiVersion: image.toolkit.fluxcd.io/v1 +kind: ImageRepository +metadata: + name: whisper +spec: + image: rhasspy/wyoming-whisper + interval: 72h \ No newline at end of file diff --git a/services/wyoming/deploy/app/whisper-image-update-automation.yaml b/services/wyoming/deploy/app/whisper-image-update-automation.yaml new file mode 100644 index 0000000..f840e7d --- /dev/null +++ b/services/wyoming/deploy/app/whisper-image-update-automation.yaml @@ -0,0 +1,25 @@ +apiVersion: image.toolkit.fluxcd.io/v1 +kind: ImageUpdateAutomation +metadata: + name: whisper +spec: + interval: 72h + sourceRef: + kind: GitRepository + name: casa + namespace: casa-limbosolutions-com + git: + checkout: + ref: + branch: main + commit: + author: + name: FluxCD + email: flux@local + messageTemplate: | + Update wyoming whisper image. + push: + branch: main + update: + path: ./services/wyoming/deploy/app/whisper-deployment.yaml + strategy: Setters \ No newline at end of file diff --git a/services/wyoming/deploy/app/whisper-service.yaml b/services/wyoming/deploy/app/whisper-service.yaml new file mode 100644 index 0000000..3932123 --- /dev/null +++ b/services/wyoming/deploy/app/whisper-service.yaml @@ -0,0 +1,18 @@ + # dns: whisper.wyoming.svc.cluster.local +apiVersion: v1 +kind: Service +metadata: + name: whisper + namespace: wyoming + labels: + app: wyoming-whisper +spec: + selector: + app: wyoming-whisper + ports: + - name: tcp-whisper + protocol: TCP + port: 10300 + targetPort: 10300 + type: ClusterIP + \ No newline at end of file diff --git a/services/wyoming/deploy/cicd-rbac.yaml b/services/wyoming/deploy/cicd-rbac.yaml deleted file mode 100644 index e156eb4..0000000 --- a/services/wyoming/deploy/cicd-rbac.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - namespace: wyoming - name: ci-cd -rules: -- apiGroups: [""] - resources: ["pods", "services", "secrets", "configmaps", "persistentvolumeclaims", "endpoints"] - verbs: ["get", "watch", "list", "create", "update", "patch", "delete"] -- apiGroups: ["apps"] - resources: ["deployments", "statefulsets"] - verbs: ["get", "watch", "list", "create", "update", "patch", "delete"] -- apiGroups: ["networking.k8s.io"] - resources: ["ingresses"] - verbs: ["get", "watch", "list", "create", "update", "patch", "delete"] -- apiGroups: ["traefik.io"] - resources: ["ingressroutes"] - verbs: ["get", "watch", "list", "create", "update", "patch", "delete"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: ci-cd - namespace: wyoming -subjects: -- kind: ServiceAccount - name: casa-ci-cd - namespace: home-assistant -roleRef: - kind: Role - name: ci-cd - apiGroup: rbac.authorization.k8s.io diff --git a/services/wyoming/deploy/flux/app-sync.yaml b/services/wyoming/deploy/flux/app-sync.yaml new file mode 100644 index 0000000..fdcbfe0 --- /dev/null +++ b/services/wyoming/deploy/flux/app-sync.yaml @@ -0,0 +1,13 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: wyoming +spec: + interval: 1m + sourceRef: + kind: GitRepository + name: casa + namespace: casa-limbosolutions-com + path: services/wyoming/deploy/app + prune: true + \ No newline at end of file diff --git a/services/wyoming/deploy/flux/kustomization.yaml b/services/wyoming/deploy/flux/kustomization.yaml new file mode 100644 index 0000000..2a93e7f --- /dev/null +++ b/services/wyoming/deploy/flux/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: wyoming +resources: + - app-sync.yaml diff --git a/services/wyoming/deploy/namespaces.yaml b/services/wyoming/deploy/namespaces.yaml deleted file mode 100644 index b7deb93..0000000 --- a/services/wyoming/deploy/namespaces.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: wyoming \ No newline at end of file diff --git a/services/wyoming/deploy/wyoming-deploy.yaml b/services/wyoming/deploy/wyoming-deploy.yaml deleted file mode 100644 index 7fb1568..0000000 --- a/services/wyoming/deploy/wyoming-deploy.yaml +++ /dev/null @@ -1,148 +0,0 @@ - - - ---- -# dns: whisper.wyoming.svc.cluster.local -apiVersion: v1 -kind: Service -metadata: - name: whisper - namespace: wyoming - labels: - app: wyoming-whisper -spec: - selector: - app: wyoming-whisper - ports: - - name: tcp-whisper - protocol: TCP - port: 10300 - targetPort: 10300 - type: ClusterIP - - ---- - -apiVersion: apps/v1 -kind: Deployment -metadata: - namespace: wyoming - name: wyoming-whisper - labels: - app: wyoming-whisper -spec: - replicas: 1 - selector: - matchLabels: - app: wyoming-whisper - template: - metadata: - labels: - app: wyoming-whisper - spec: - nodeSelector: - role: worker-node - containers: - - name: wyoming-whisper - image: rhasspy/wyoming-whisper - volumeMounts: - - mountPath: /data - name: data - args: - - --model - - small-int8 - - --language - - pt - - --beam-size - - "4" - - --debug - ports: - - name: tcp-whisper - containerPort: 10300 - volumes: - - name: data - persistentVolumeClaim: - claimName: wyoming-whisper - ---- - -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: wyoming-whisper - namespace: wyoming -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 8Gi ---- - -# dns: piper.wyoming.svc.cluster.local -apiVersion: v1 -kind: Service -metadata: - name: piper - namespace: wyoming - labels: - app: wyoming-piper -spec: - selector: - app: wyoming-piper - ports: - - name: tcp-piper - protocol: TCP - port: 10200 - targetPort: 10200 - type: ClusterIP - ---- - -apiVersion: apps/v1 -kind: Deployment -metadata: - namespace: wyoming - name: wyoming-piper - labels: - app: wyoming-piper -spec: - replicas: 1 - selector: - matchLabels: - app: wyoming-piper - template: - metadata: - labels: - app: wyoming-piper - spec: - nodeSelector: - role: worker-node - containers: - - name: wyoming-piper - image: rhasspy/wyoming-piper - volumeMounts: - - mountPath: /data - name: data - args: - - --voice - - en-gb-southern_english_female-low - ports: - - containerPort: 10200 - volumes: - - name: data - persistentVolumeClaim: - claimName: wyoming-piper - ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: wyoming-piper - namespace: wyoming -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 2Gi \ No newline at end of file