diff --git a/music-assistant-skill/.helmignore b/music-assistant-skill/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/music-assistant-skill/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/music-assistant-skill/Chart.yaml b/music-assistant-skill/Chart.yaml new file mode 100644 index 0000000..6876fe7 --- /dev/null +++ b/music-assistant-skill/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: music-assistant-skill +description: Music Assistant Alexa Skill +type: application +version: 0.1.0 +appVersion: "0.0.36-beta" \ No newline at end of file diff --git a/music-assistant-skill/templates/_helpers.tpl b/music-assistant-skill/templates/_helpers.tpl new file mode 100644 index 0000000..01d95ee --- /dev/null +++ b/music-assistant-skill/templates/_helpers.tpl @@ -0,0 +1,7 @@ +{{- define "music-assistant-skill.name" -}} +music-assistant-skill +{{- end }} + +{{- define "music-assistant-skill.fullname" -}} +{{ .Release.Name }}-music-assistant-skill +{{- end }} \ No newline at end of file diff --git a/music-assistant-skill/templates/deployment.yaml b/music-assistant-skill/templates/deployment.yaml new file mode 100644 index 0000000..4022424 --- /dev/null +++ b/music-assistant-skill/templates/deployment.yaml @@ -0,0 +1,43 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "music-assistant-skill.fullname" . }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ include "music-assistant-skill.name" . }} + template: + metadata: + labels: + app: {{ include "music-assistant-skill.name" . }} + spec: + containers: + - name: music-assistant-skill + image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: {{ .Values.env.PORT }} + - containerPort: {{ .Values.env.DEBUG_PORT }} + env: + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: "{{ $value }}" + {{- end }} + - name: APP_USERNAME + valueFrom: + secretKeyRef: + name: {{ include "music-assistant-skill.fullname" . }} + key: APP_USERNAME + - name: APP_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "music-assistant-skill.fullname" . }} + key: APP_PASSWORD + volumeMounts: + - name: ask-data + mountPath: /root/.ask + volumes: + - name: ask-data + persistentVolumeClaim: + claimName: {{ include "music-assistant-skill.fullname" . }}-pvc \ No newline at end of file diff --git a/music-assistant-skill/templates/ingress.yaml b/music-assistant-skill/templates/ingress.yaml new file mode 100644 index 0000000..e646daa --- /dev/null +++ b/music-assistant-skill/templates/ingress.yaml @@ -0,0 +1,35 @@ +{{- if .Values.ingress.enabled }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "music-assistant-skill.fullname" . }} + annotations: + {{- range $key, $value := .Values.ingress.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} +spec: + ingressClassName: {{ .Values.ingress.className }} + {{- if .Values.ingress.tls.enabled }} + tls: + - hosts: + {{- range .Values.ingress.hosts }} + - {{ .host }} + {{- end }} + secretName: {{ .Values.ingress.tls.secretName }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + pathType: {{ .pathType }} + backend: + service: + name: {{ include "music-assistant-skill.fullname" $ }} + port: + number: {{ $.Values.service.port }} + {{- end }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/music-assistant-skill/templates/pvc.yaml b/music-assistant-skill/templates/pvc.yaml new file mode 100644 index 0000000..3bec1f4 --- /dev/null +++ b/music-assistant-skill/templates/pvc.yaml @@ -0,0 +1,12 @@ +{{- if .Values.persistence.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "music-assistant-skill.fullname" . }}-pvc +spec: + accessModes: + - {{ .Values.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.persistence.size }} +{{- end }} \ No newline at end of file diff --git a/music-assistant-skill/templates/secret.yaml b/music-assistant-skill/templates/secret.yaml new file mode 100644 index 0000000..cad2ed4 --- /dev/null +++ b/music-assistant-skill/templates/secret.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: OnePasswordItem +metadata: + name: {{ include "music-assistant-skill.fullname" . }} +spec: + itemPath: {{ .Values.secrets.OnePw }} \ No newline at end of file diff --git a/music-assistant-skill/templates/service.yaml b/music-assistant-skill/templates/service.yaml new file mode 100644 index 0000000..34703d2 --- /dev/null +++ b/music-assistant-skill/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "music-assistant-skill.fullname" . }} +spec: + type: {{ .Values.service.type }} + selector: + app: {{ include "music-assistant-skill.name" . }} + ports: + - name: http + port: {{ .Values.service.port }} + targetPort: {{ .Values.env.PORT }} + - name: debug + port: {{ .Values.service.debugPort }} + targetPort: {{ .Values.env.DEBUG_PORT }} \ No newline at end of file diff --git a/music-assistant-skill/values.yaml b/music-assistant-skill/values.yaml new file mode 100644 index 0000000..3571daf --- /dev/null +++ b/music-assistant-skill/values.yaml @@ -0,0 +1,44 @@ +image: + repository: ghcr.io/alams154/music-assistant-skill + tag: latest + pullPolicy: IfNotPresent + +replicaCount: 1 + +env: + SKILL_HOSTNAME: skill.example.com + MA_HOSTNAME: "" + PORT: 5000 + DEBUG_PORT: 5678 + LOCALE: en-US + AWS_DEFAULT_REGION: us-east-1 + TZ: America/Chicago + +secrets: + OnePw: null + +service: + type: ClusterIP + port: 5000 + debugPort: 5678 + +persistence: + enabled: true + size: 1Gi + accessMode: ReadWriteOnce + +ingress: + enabled: true + className: nginx + annotations: + nginx.ingress.kubernetes.io/ssl-redirect: "true" + nginx.ingress.kubernetes.io/proxy-body-size: "10m" + cert-manager.io/cluster-issuer: letsencrypt-prod + hosts: + - host: skill.example.com + paths: + - path: / + pathType: Prefix + tls: + enabled: true + secretName: music-assistant-tls \ No newline at end of file