Skip to content

Commit

Permalink
Support storage for srs-stack.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Nov 6, 2023
1 parent 4de6b55 commit 50ed6fe
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 9 deletions.
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ To install the SRS origin server, run:
helm install srs srs/srs-server
```

> Note: If enable WebRTC, please setup the [CANDIDATE](https://ossrs.io/lts/en-us/docs/v5/doc/webrtc#config-candidate)
> by `helm install srs srs/srs-server --set candidate=your-internal-public-ip`
Visit [http://localhost:8080](http://localhost:8080) to access the SRS console.

Important config for both srs-server and srs-stack:

* If enable WebRTC, please setup the [CANDIDATE](https://ossrs.io/lts/en-us/docs/v5/doc/webrtc#config-candidate) by `helm install srs srs/srs-server --set candidate=your-internal-public-ip`

Important config for srs-stack only:

* By default, use `/data` of host as storage directory, if want to change, please use `--set persistence.path=$HOME/data` for example.

For detailed information on using SRS, please refer to [https://ossrs.io](https://ossrs.io).

> Note: If you are in China, please refer to [https://ossrs.net](https://ossrs.net).
Expand Down Expand Up @@ -95,7 +100,19 @@ Now, you can utilize SRS HELM. For more information, refer to the [Usage](#usage

## Develop Repository

Serve current directory in Nginx or other HTTP server, for example:
The simplest way to develop is to build a new chart by:

```bash
helm package srs-server
```

Then install the local chart by:

```bash
helm install srs srs-server-1.0.0.tgz
```

Or, to test the repo, serve current directory in Nginx or other HTTP server, for example:

```bash
docker run --rm -it -p 3000:80 -v $(pwd):/usr/share/nginx/html \
Expand Down
10 changes: 5 additions & 5 deletions srs-stack/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: v2
name: srs-stack
appVersion: "5.11.10"
version: 1.0.2
description: SRS Stack is a one-click, open-source video solution for creating online services on
cloud or self-hosting. Built with SRS, FFmpeg, and WebRTC, it supports various protocols and offers
features like authentication, multi-platform streaming, recording, transcoding, virtual live events,
automatic HTTPS, and HTTP Open API.
version: 1.0.3
description: SRS Stack is an all-in-one, one-click, and open-source video solution for creating online
services on cloud or self-hosting. Built with SRS, FFmpeg, and WebRTC, it supports various protocols
and offers features like authentication, multi-platform streaming, recording, transcoding, virtual
live events, automatic HTTPS, and HTTP Open API.
home: https://helm.ossrs.io/stable
icon: https://ossrs.io/lts/en-us/img/srs-220x234.png
keywords:
Expand Down
8 changes: 8 additions & 0 deletions srs-stack/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ spec:
labels:
{{- include "srs.selectorLabels" . | nindent 8 }}
spec:
volumes:
- name: srs-pv-storage
persistentVolumeClaim:
claimName: srs-pv-claim
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
Expand All @@ -29,6 +33,10 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
volumeMounts:
- mountPath: "/data"
name: srs-pv-storage
subPath: {{ .Values.persistence.subPath | quote }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
Expand Down
30 changes: 30 additions & 0 deletions srs-stack/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{- if (.Values.persistence.enabled) }}
apiVersion: v1
kind: PersistentVolume
metadata:
name: srs-pv-volume
labels:
type: local
spec:
storageClassName: srs-disk-storage
capacity:
storage: {{ .Values.persistence.storage }}
accessModes:
- ReadWriteOnce
hostPath:
path: {{ .Values.persistence.path }}

---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: srs-pv-claim
spec:
storageClassName: srs-disk-storage
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.persistence.storage }}
{{- end }}
12 changes: 12 additions & 0 deletions srs-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ securityContext: {}
# runAsNonRoot: true
# runAsUser: 1000

## Persistence parameters
## ref: https://kubernetes.io/docs/concepts/storage/persistent-volumes/
persistence:
## @param persistence.enabled Enable persistence.
enabled: true
## @param persistence.path The path of the hostPath.
path: /data
## @param persistence.storage The size of the volume to allocate.
storage: 3000Gi
## @param persistence.subPath The subdirectory of the volume to mount.
subPath: "0"

service:
type: LoadBalancer
rtmp: 1935
Expand Down

0 comments on commit 50ed6fe

Please sign in to comment.