diff --git a/HelmCharts/navidrome-chart/.helmignore b/HelmCharts/navidrome-chart/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/HelmCharts/navidrome-chart/.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/HelmCharts/navidrome-chart/Chart.yaml b/HelmCharts/navidrome-chart/Chart.yaml new file mode 100644 index 00000000..51c3ac4f --- /dev/null +++ b/HelmCharts/navidrome-chart/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: navidrome-chart +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/HelmCharts/navidrome-chart/templates/navidrome-deployment.yaml b/HelmCharts/navidrome-chart/templates/navidrome-deployment.yaml new file mode 100644 index 00000000..3c3fdab1 --- /dev/null +++ b/HelmCharts/navidrome-chart/templates/navidrome-deployment.yaml @@ -0,0 +1,87 @@ +apiVersion: v1 +kind: Service +metadata: + name: navidrome + namespace: navidrome +spec: + type: NodePort + ports: + - name: http + port: 4533 + nodePort: 30781 + targetPort: navidrome-http + selector: + app: navidrome +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: navidrome-data-claim + namespace: navidrome + labels: + app: navidrome +spec: + accessModes: + - ReadWriteMany + storageClassName: "" + resources: + requests: + storage: 2Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: navidrome-music-claim + namespace: navidrome + labels: + app: navidrome +spec: + accessModes: + - ReadWriteMany + storageClassName: "" + resources: + requests: + storage: 20Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: navidrome + namespace: navidrome + labels: + app: navidrome +spec: + selector: + matchLabels: + app: navidrome + tier: frontend + strategy: + type: Recreate + template: + metadata: + labels: + app: navidrome + tier: frontend + spec: + containers: + - env: + - name: JAVA_OPTS + value: -Dserver.port=4533 + name: navidrome + image: deluan/navidrome:latest + imagePullPolicy: IfNotPresent + ports: + - containerPort: 4533 + name: "navidrome-http" + volumeMounts: + - name: navidrome-data-folder + mountPath: /data + - name: navidrome-music-folder + mountPath: /music + volumes: + - name: navidrome-data-folder + persistentVolumeClaim: + claimName: navidrome-data-claim + - name: navidrome-music-folder + persistentVolumeClaim: + claimName: navidrome-music-claim diff --git a/HelmCharts/navidrome-chart/templates/pv-local-navidrome.yaml b/HelmCharts/navidrome-chart/templates/pv-local-navidrome.yaml new file mode 100644 index 00000000..811359d5 --- /dev/null +++ b/HelmCharts/navidrome-chart/templates/pv-local-navidrome.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: navidrome-data-folder +spec: + capacity: + storage: 2Gi + accessModes: + - ReadWriteMany + hostPath: + path: "/mnt/Externo/navidrome/data" +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: navidrome-music-folder +spec: + capacity: + storage: 20Gi + accessModes: + - ReadWriteMany + hostPath: + path: "/mnt/Externo/navidrome/music" diff --git a/HelmCharts/navidrome-chart/values.yaml b/HelmCharts/navidrome-chart/values.yaml new file mode 100644 index 00000000..79f8932c --- /dev/null +++ b/HelmCharts/navidrome-chart/values.yaml @@ -0,0 +1,82 @@ +# Default values for navidrome-chart. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/HelmCharts/navidrome.sh b/HelmCharts/navidrome.sh new file mode 100644 index 00000000..79ceecec --- /dev/null +++ b/HelmCharts/navidrome.sh @@ -0,0 +1 @@ +helm install navidrome ./navidrome-chart --namespace=navidrome --create-namespace diff --git a/Navidrome/navidrome-deployment.yaml b/Navidrome/navidrome-deployment.yaml index 27197a7b..3c3fdab1 100644 --- a/Navidrome/navidrome-deployment.yaml +++ b/Navidrome/navidrome-deployment.yaml @@ -16,7 +16,7 @@ spec: apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: navidrome-pv-claim + name: navidrome-data-claim namespace: navidrome labels: app: navidrome @@ -28,6 +28,21 @@ spec: requests: storage: 2Gi --- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: navidrome-music-claim + namespace: navidrome + labels: + app: navidrome +spec: + accessModes: + - ReadWriteMany + storageClassName: "" + resources: + requests: + storage: 20Gi +--- apiVersion: apps/v1 kind: Deployment metadata: @@ -59,11 +74,14 @@ spec: - containerPort: 4533 name: "navidrome-http" volumeMounts: - - name: navidrome-www-folder + - name: navidrome-data-folder mountPath: /data - - name: navidrome-www-folder + - name: navidrome-music-folder mountPath: /music volumes: - - name: navidrome-www-folder + - name: navidrome-data-folder + persistentVolumeClaim: + claimName: navidrome-data-claim + - name: navidrome-music-folder persistentVolumeClaim: - claimName: navidrome-pv-claim + claimName: navidrome-music-claim diff --git a/Navidrome/pv-local-navidrome.yaml b/Navidrome/pv-local-navidrome.yaml index 687f994c..811359d5 100644 --- a/Navidrome/pv-local-navidrome.yaml +++ b/Navidrome/pv-local-navidrome.yaml @@ -8,4 +8,16 @@ spec: accessModes: - ReadWriteMany hostPath: - path: "/mnt/Externo/navidrome" + path: "/mnt/Externo/navidrome/data" +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: navidrome-music-folder +spec: + capacity: + storage: 20Gi + accessModes: + - ReadWriteMany + hostPath: + path: "/mnt/Externo/navidrome/music"