Browse Source

Airsonic como helm chart

main
Celestino Rey 2 years ago
parent
commit
bd71fd13e2
8 changed files with 244 additions and 0 deletions
  1. +23
    -0
      HelmCharts/airsonic-chart/.helmignore
  2. +24
    -0
      HelmCharts/airsonic-chart/Chart.yaml
  3. +77
    -0
      HelmCharts/airsonic-chart/templates/airsonic-deployment.yaml
  4. +11
    -0
      HelmCharts/airsonic-chart/templates/registry-secrets.yaml
  5. +82
    -0
      HelmCharts/airsonic-chart/values.yaml
  6. +12
    -0
      HelmCharts/helmAirsonic.sh
  7. +4
    -0
      HelmCharts/preparaAirsonic/as-namespace.yaml
  8. +11
    -0
      HelmCharts/preparaAirsonic/pv-local-airsonic.yaml

+ 23
- 0
HelmCharts/airsonic-chart/.helmignore View File

@ -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/

+ 24
- 0
HelmCharts/airsonic-chart/Chart.yaml View File

@ -0,0 +1,24 @@
apiVersion: v2
name: airsonic-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"

+ 77
- 0
HelmCharts/airsonic-chart/templates/airsonic-deployment.yaml View File

@ -0,0 +1,77 @@
apiVersion: v1
kind: Service
metadata:
name: airsonic
namespace: airsonic
spec:
type: NodePort
ports:
- name: http
port: 4040
nodePort: 30780
targetPort: airsonic-http
selector:
app: airsonic
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: airsonic-pv-claim
namespace: airsonic
labels:
app: airsonic
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
resources:
requests:
storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: airsonic
namespace: airsonic
labels:
app: airsonic
spec:
selector:
matchLabels:
app: airsonic
tier: frontend
strategy:
type: Recreate
template:
metadata:
labels:
app: airsonic
tier: frontend
spec:
containers:
- env:
- name: JAVA_OPTS
value: -Dserver.port=4040
name: airsonic
#image: airsonic/airsonic
image: docker-registry:32000/airsonic:1.0
ports:
- containerPort: 4040
name: "airsonic-http"
volumeMounts:
- name: airsonic-www-folder
mountPath: /airsonic/data
- name: airsonic-www-folder
mountPath: /airsonic/music
#- name: airsonic-www-folder
#mountPath: /airsonic/luisa
- name: airsonic-www-folder
mountPath: /airsonic/playlists
- name: airsonic-www-folder
mountPath: /airsonic/podcasts
imagePullSecrets:
- name: reg-cred-secret
volumes:
- name: airsonic-www-folder
persistentVolumeClaim:
claimName: airsonic-pv-claim

+ 11
- 0
HelmCharts/airsonic-chart/templates/registry-secrets.yaml View File

@ -0,0 +1,11 @@
apiVersion: v1
data:
.dockerconfigjson: eyJhdXRocyI6eyJkb2NrZXItcmVnaXN0cnk6MzIwMDAiOnsidXNlcm5hbWUiOiJjcmV5bG9wZXoiLCJwYXNzd29yZCI6IlJleS0xMTc2IiwiYXV0aCI6IlkzSmxlV3h2Y0dWNk9sSmxlUzB4TVRjMiJ9fX0=
kind: Secret
metadata:
creationTimestamp: "2023-01-29T10:54:14Z"
name: reg-cred-secret
namespace: airsonic
resourceVersion: "19890385"
uid: 66b3b7c5-26c1-4e5a-af4e-dc973aaafe4b
type: kubernetes.io/dockerconfigjson

+ 82
- 0
HelmCharts/airsonic-chart/values.yaml View File

@ -0,0 +1,82 @@
# Default values for airsonic-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: [reg-cred-secret]
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: NodePort
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: {}

+ 12
- 0
HelmCharts/helmAirsonic.sh View File

@ -0,0 +1,12 @@
#!/bin/bash
if [ "$1" = "i" ]
then
kubectl apply -f ./preparaAirsonic/as-namespace.yaml
kubectl apply -f ./preparaAirsonic/pv-local-airsonic.yaml
helm install airsonic airsonic-chart/
else
helm uninstall airsonic
kubectl delete -f ./preparaAirsonic/as-namespace.yaml
kubectl delete -f ./preparaAirsonic/pv-local-airsonic.yaml
fi

+ 4
- 0
HelmCharts/preparaAirsonic/as-namespace.yaml View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: airsonic

+ 11
- 0
HelmCharts/preparaAirsonic/pv-local-airsonic.yaml View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: airsonic-data-folder
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteMany
hostPath:
path: "/mnt/Externo/airsonic"

Loading…
Cancel
Save