Skip to content
This repository has been archived by the owner on Sep 8, 2021. It is now read-only.

Added Kubernetes install example and instructions #1841

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions install/kubernetes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Airsonic on Kubernetes

## Prerequisites

- A Kubernets Cluster (v1.18 or later)
- `kubectl` is configured

## Deploy

1. Copy the file [airsonic-kubernetes.yaml](airsonic-kubernetes.yaml) locally.

1. Edit `airsonic-kubernetes.yaml` to configure access to your media share.

> Note: See this document for additional volume types: https://kubernetes.io/docs/concepts/storage/volumes/

1. Deploy

```shell
kubectl create namespace airsonic
kubectl apply -f airsonic-kubernetes.yaml --namespace airsonic
```

## Access

1. Determine the external IP address given to the Airsonic service
```shell
kubectl get services --namespace airsonic
```

Output should look similar to this

```
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
airsonic LoadBalancer 10.XXX.XXX.XXX 73.XXX.XXX.XXX 80:30413/TCP 100m
```

1. Open that IP address in a web browser.

```shell
open http://73.XXX.XXX.XXX
```

1. Login

> Note: the prompt will tell you then default username and password for initial installs

1. [Configure your Airsonic server](https://airsonic.github.io/docs/first-start/)

## TO DO

- Expose with an ingress proxy with TLS

- Supply configuration using a `ConfigMap`

- Deploy with an external database
98 changes: 98 additions & 0 deletions install/kubernetes/airsonic-kubernetes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
### Note: you must configure access to your media folder. This example uses an NFS mount ###

apiVersion: apps/v1
kind: Deployment
metadata:
name: airsonic
spec:
replicas: 1
selector:
matchLabels:
app: airsonic
template:
metadata:
labels:
app: airsonic
spec:
containers:
- image: airsonic/airsonic:latest #tested with airsonic/airsonic:10.6.2-RELEASE
env:
- name: AIRSONIC_PORT
value: "4040"
- name: JAVA_OPTS
value: -Xmx512m
name: airsonic
ports:
- containerPort: 4040
readinessProbe:
exec:
command:
- /bin/sh
- -c
- wget -q http://localhost:"$AIRSONIC_PORT""$CONTEXT_PATH"rest/ping -O /dev/null || exit 1
periodSeconds: 15
timeoutSeconds: 3
resources:
requests:
memory: "200Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "2"
volumeMounts:
- mountPath: /airsonic/data
name: data
- mountPath: /airsonic/music
name: music
- mountPath: /airsonic/playlists
name: playlists
restartPolicy: Always
volumes:
- name: data
persistentVolumeClaim:
claimName: airsonic-data
- name: playlists
persistentVolumeClaim:
claimName: airsonic-playlists

# Please configure for your media share
# See this document for additional volume types: https://kubernetes.io/docs/concepts/storage/volumes/
- name: music
nfs:
server: <nfs.server.address>
path: <nfs.share.path>
---
apiVersion: v1
kind: Service
metadata:
name: airsonic
spec:
type: LoadBalancer
ports:
- name: http
port: 80
targetPort: 4040
selector:
app: airsonic
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: airsonic-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: airsonic-playlists
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi