From fbf1b567014f4d805fff777315ce4a5622e8f92e Mon Sep 17 00:00:00 2001 From: winlin Date: Fri, 27 Oct 2023 23:02:22 +0800 Subject: [PATCH] srs-stack: Support SRS Stack HELM. v1.0.1 --- README.md | 12 +- auto/srs-server.sh | 18 +-- auto/srs-stack.sh | 93 +++++++++++++++ srs-server/Chart.yaml | 2 +- srs-stack/.helmignore | 23 ++++ srs-stack/Chart.yaml | 28 +++++ srs-stack/charts/.gitkeep | 0 srs-stack/templates/NOTES.txt | 22 ++++ srs-stack/templates/_helpers.tpl | 62 ++++++++++ srs-stack/templates/deployment.yaml | 105 +++++++++++++++++ srs-stack/templates/hpa.yaml | 28 +++++ srs-stack/templates/ingress.yaml | 61 ++++++++++ srs-stack/templates/service.yaml | 31 +++++ srs-stack/templates/serviceaccount.yaml | 12 ++ .../templates/tests/test-connection.yaml | 15 +++ srs-stack/values.schema.json | 26 +++++ srs-stack/values.yaml | 109 ++++++++++++++++++ stable/index.yaml | 48 ++++++-- stable/srs-stack-1.0.1.tgz | Bin 0 -> 5133 bytes 19 files changed, 678 insertions(+), 17 deletions(-) create mode 100755 auto/srs-stack.sh create mode 100644 srs-stack/.helmignore create mode 100644 srs-stack/Chart.yaml create mode 100644 srs-stack/charts/.gitkeep create mode 100644 srs-stack/templates/NOTES.txt create mode 100644 srs-stack/templates/_helpers.tpl create mode 100644 srs-stack/templates/deployment.yaml create mode 100644 srs-stack/templates/hpa.yaml create mode 100644 srs-stack/templates/ingress.yaml create mode 100644 srs-stack/templates/service.yaml create mode 100644 srs-stack/templates/serviceaccount.yaml create mode 100644 srs-stack/templates/tests/test-connection.yaml create mode 100644 srs-stack/values.schema.json create mode 100644 srs-stack/values.yaml create mode 100644 stable/srs-stack-1.0.1.tgz diff --git a/README.md b/README.md index 9050680..8204e06 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ For detailed information on using SRS, please refer to [https://ossrs.io](https: > Note: If you are in China, please refer to [https://ossrs.net](https://ossrs.net). -## Features +## Features: srs-server Note all features of SRS and SRS Stack are supported by the HELM charts, however, we're working to migrate them to HELM. @@ -51,6 +51,10 @@ migrate them to HELM. - [ ] Support HTTPS server and API for WebRTC publisher. - [ ] Integrate Prometheus and grafana dashboard. +## Features: srs-stack + +- [x] v1.0.0: Support RTMP, HTTP, HTTPS, SRT, and WebRTC in SRS Stack. + ## Local Repository You can also set up the local HELM repository by executing the following command: @@ -117,6 +121,12 @@ file by following command: ./auto/srs-server.sh -target v1.0.6 ``` +And, maybe also release a new version of srs-stack v1.0.7, run: + +```bash +./auto/srs-stack.sh -target v1.0.7 +``` + Then, release the chart web server image and refresh official website by: ```bash diff --git a/auto/srs-server.sh b/auto/srs-server.sh index 36b3b9d..221f6e0 100755 --- a/auto/srs-server.sh +++ b/auto/srs-server.sh @@ -46,14 +46,16 @@ if [[ $refresh == yes ]]; then fi VERSION=$(echo $RELEASE |sed 's/v//g') TAG=$RELEASE -echo "RELEASE=$RELEASE, VERSION=$VERSION, TAG=$TAG, REVISION=$REVISION, NEXT=$NEXT" +echo "For srs-server, RELEASE=$RELEASE, VERSION=$VERSION, TAG=$TAG, REVISION=$REVISION, NEXT=$NEXT" if [[ $(grep -q "version: $VERSION" srs-server/Chart.yaml || echo no) == no ]]; then VERSION0="sed -i '' 's/^version:.*/version: $VERSION/g' srs-server/Chart.yaml" + VERSION1="sed -i '' 's|v1.*/srs-server|$TAG/srs-server|g' srs-server/Chart.yaml" fi -if [[ ! -z $VERSION0 ]]; then +if [[ ! -z $VERSION0 || ! -z $VERSION1 ]]; then echo "Please update version to $VERSION" if [[ ! -z $VERSION0 ]]; then echo " $VERSION0 &&"; fi + if [[ ! -z $VERSION1 ]]; then echo " $VERSION1 &&"; fi echo " echo ok" exit 1 fi @@ -80,12 +82,12 @@ if [[ $(git status |grep -q 'Your branch is up to date' || echo 'no') == no ]]; fi echo "Sync OK" -git tag -d $TAG 2>/dev/null; git push origin :$TAG 2>/dev/null -echo "Delete tag OK: $TAG" +git tag -d srs-server-$TAG 2>/dev/null; git push origin :srs-server-$TAG 2>/dev/null +echo "Delete tag OK: srs-server-$TAG" -git tag $TAG && git push origin $TAG -echo "Publish OK: $TAG" +git tag srs-server-$TAG && git push origin srs-server-$TAG +echo "Publish OK: srs-server-$TAG" echo -e "\n\n" -echo "Publication ok, please visit" -echo " Please test it after https://github.com/ossrs/srs-helm/actions/workflows/docker.yml done" +echo "Chart srs-server $VERSION ok, please release to official website by:" +echo " ./auto/pub.sh" diff --git a/auto/srs-stack.sh b/auto/srs-stack.sh new file mode 100755 index 0000000..ac0c122 --- /dev/null +++ b/auto/srs-stack.sh @@ -0,0 +1,93 @@ +#!/bin/bash + +# Execute by: bash xxx.sh or bash zzz/yyy/xxx.sh or ./xxx.sh or ./zzz/yyy/xxx.sh source xxx.sh +REALPATH=$(realpath ${BASH_SOURCE[0]}) +SCRIPT_DIR=$(cd $(dirname ${REALPATH}) && pwd) +WORK_DIR=$(cd $(dirname ${REALPATH})/.. && pwd) +echo "BASH_SOURCE=${BASH_SOURCE}, REALPATH=${REALPATH}, SCRIPT_DIR=${SCRIPT_DIR}, WORK_DIR=${WORK_DIR}" +cd ${WORK_DIR} + +help=false +refresh=false +target= + +while [[ "$#" -gt 0 ]]; do + case $1 in + -h|--help) help=true; shift ;; + -refresh|--refresh) refresh=true; shift ;; + -target|--target) target="$2"; shift 2;; + *) echo "Unknown parameter passed: $1"; exit 1 ;; + esac +done + +if [ "$help" = true ]; then + echo "Usage: $0 [OPTIONS]" + echo "Options:" + echo " -h, --help Show this help message and exit" + echo " -refresh, --refresh Refresh current tag. Default: false" + echo " -target, --target The target version to release, for example, v5.7.28" + exit 0 +fi + +if [[ ! -z $target ]]; then + RELEASE=$target + refresh=yes +else + RELEASE=$(git describe --tags --abbrev=0 --match srs-stack-v* |sed 's/srs-stack-//g') +fi +if [[ $? -ne 0 ]]; then echo "Release failed"; exit 1; fi + +REVISION=$(echo $RELEASE |awk -F . '{print $3}') +if [[ $? -ne 0 ]]; then echo "Release failed"; exit 1; fi + +let NEXT=$REVISION+1 +if [[ $refresh == yes ]]; then + let NEXT=$REVISION +fi +VERSION=$(echo $RELEASE |sed 's/v//g') +TAG=$RELEASE +echo "For srs-stack, RELEASE=$RELEASE, VERSION=$VERSION, TAG=$TAG, REVISION=$REVISION, NEXT=$NEXT" + +if [[ $(grep -q "version: $VERSION" srs-stack/Chart.yaml || echo no) == no ]]; then + VERSION0="sed -i '' 's/^version:.*/version: $VERSION/g' srs-stack/Chart.yaml" + VERSION1="sed -i '' 's|v1.*/srs-stack|$TAG/srs-stack|g' srs-stack/Chart.yaml" +fi +if [[ ! -z $VERSION0 || ! -z $VERSION1 ]]; then + echo "Please update version to $VERSION" + if [[ ! -z $VERSION0 ]]; then echo " $VERSION0 &&"; fi + if [[ ! -z $VERSION1 ]]; then echo " $VERSION1 &&"; fi + echo " echo ok" + exit 1 +fi + +if [[ ! -f stable/srs-stack-$VERSION.tgz ]]; then + echo "Failed: No package at stable/srs-stack-$VERSION.tgz" + echo "Please run:" + echo " helm package srs-stack -d stable && \\" + echo " helm repo index stable" + exit 1 +fi + +git st |grep -q 'nothing to commit' +if [[ $? -ne 0 ]]; then + echo "Failed: Please commit before release"; + exit 1 +fi + +git fetch origin +if [[ $(git status |grep -q 'Your branch is up to date' || echo 'no') == no ]]; then + git status + echo "Failed: Please sync before release"; + exit 1 +fi +echo "Sync OK" + +git tag -d srs-stack-$TAG 2>/dev/null; git push origin :srs-stack-$TAG 2>/dev/null +echo "Delete tag OK: srs-stack-$TAG" + +git tag srs-stack-$TAG && git push origin srs-stack-$TAG +echo "Publish OK: srs-stack-$TAG" + +echo -e "\n\n" +echo "Chart srs-stack $VERSION ok, please release to official website by:" +echo " ./auto/pub.sh" diff --git a/srs-server/Chart.yaml b/srs-server/Chart.yaml index b1c1ed3..8d0beb1 100644 --- a/srs-server/Chart.yaml +++ b/srs-server/Chart.yaml @@ -15,7 +15,7 @@ keywords: - webrtc - srt sources: - - https://github.com/ossrs/srs-helm/tree/v1.0.0/srs-server + - https://github.com/ossrs/srs-helm/tree/v1.0.5/srs-server maintainers: - name: Winlin email: winlinvip@gmail.com diff --git a/srs-stack/.helmignore b/srs-stack/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/srs-stack/.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/srs-stack/Chart.yaml b/srs-stack/Chart.yaml new file mode 100644 index 0000000..2b76d70 --- /dev/null +++ b/srs-stack/Chart.yaml @@ -0,0 +1,28 @@ +apiVersion: v2 +name: srs-stack +appVersion: "5.11.5" +version: 1.0.1 +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. +home: https://helm.ossrs.io/stable +icon: https://ossrs.io/lts/en-us/img/srs-220x234.png +keywords: + - srs + - media + - video + - rtmp + - hls + - webrtc + - srt +sources: + - https://github.com/ossrs/srs-helm/tree/v1.0.1/srs-stack +maintainers: + - name: Winlin + email: winlinvip@gmail.com + url: https://github.com/ossrs/srs-helm +type: application +annotations: + category: Infrastructure + licenses: MIT diff --git a/srs-stack/charts/.gitkeep b/srs-stack/charts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/srs-stack/templates/NOTES.txt b/srs-stack/templates/NOTES.txt new file mode 100644 index 0000000..c33ee83 --- /dev/null +++ b/srs-stack/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "srs.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "srs.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "srs.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.http }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "srs.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/srs-stack/templates/_helpers.tpl b/srs-stack/templates/_helpers.tpl new file mode 100644 index 0000000..3bfd015 --- /dev/null +++ b/srs-stack/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "srs.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "srs.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "srs.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "srs.labels" -}} +helm.sh/chart: {{ include "srs.chart" . }} +{{ include "srs.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "srs.selectorLabels" -}} +app.kubernetes.io/name: {{ include "srs.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "srs.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "srs.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/srs-stack/templates/deployment.yaml b/srs-stack/templates/deployment.yaml new file mode 100644 index 0000000..c38d261 --- /dev/null +++ b/srs-stack/templates/deployment.yaml @@ -0,0 +1,105 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "srs.fullname" . }} + labels: + {{- include "srs.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "srs.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "srs.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "srs.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + command: ["./bootstrap"] + ports: + - name: rtmp + containerPort: 1935 + protocol: TCP + - name: http + containerPort: 2022 + protocol: TCP + - name: https + containerPort: 2443 + protocol: TCP + - name: srt + containerPort: 10080 + protocol: UDP + - name: rtc + containerPort: 8000 + protocol: UDP + env: + # The general default config. + - name: SRS_PLATFORM + value: "helm" + # Overwrite the config by conf. + {{- range $key, $value := .Values.conf }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + # Overwrite the config by env. + {{- range .Values.env }} + - name: {{ .name }} + value: {{ .value | quote }} + {{- end }} + # Overwrite by special item. + {{- if .Values.candidate }} + - name: SRS_RTC_SERVER_CANDIDATE + value: {{ .Values.candidate | quote }} + {{- end }} + # Enable dns name lookup. + - name: NAME_LOOKUP + value: "on" + # For SRS Stack, we resolve the ip in platform. + - name: SRS_RTC_SERVER_API_AS_CANDIDATES + value: "off" + # For SRS Stack, never detect network ip, because it runs in docker, and the ip is private. + - name: SRS_RTC_SERVER_USE_AUTO_DETECT_NETWORK_IP + value: "off" + # For SRS Stack, should always enable daemon. + - name: SRS_DAEMON + value: "on" + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/srs-stack/templates/hpa.yaml b/srs-stack/templates/hpa.yaml new file mode 100644 index 0000000..7e1ebc6 --- /dev/null +++ b/srs-stack/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "srs.fullname" . }} + labels: + {{- include "srs.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "srs.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/srs-stack/templates/ingress.yaml b/srs-stack/templates/ingress.yaml new file mode 100644 index 0000000..ae65628 --- /dev/null +++ b/srs-stack/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "srs.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "srs.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/srs-stack/templates/service.yaml b/srs-stack/templates/service.yaml new file mode 100644 index 0000000..cf45905 --- /dev/null +++ b/srs-stack/templates/service.yaml @@ -0,0 +1,31 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "srs.fullname" . }} + labels: + {{- include "srs.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - name: rtmp + port: {{ .Values.service.rtmp }} + targetPort: 1935 + protocol: TCP + - name: http + port: {{ .Values.service.http }} + targetPort: 2022 + protocol: TCP + - name: https + port: {{ .Values.service.https }} + targetPort: 2443 + protocol: TCP + - name: srt + port: {{ .Values.service.srt }} + targetPort: 10080 + protocol: UDP + - name: rtc + port: {{ .Values.service.rtc }} + targetPort: 8000 + protocol: UDP + selector: + {{- include "srs.selectorLabels" . | nindent 4 }} diff --git a/srs-stack/templates/serviceaccount.yaml b/srs-stack/templates/serviceaccount.yaml new file mode 100644 index 0000000..0fad2bb --- /dev/null +++ b/srs-stack/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "srs.serviceAccountName" . }} + labels: + {{- include "srs.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/srs-stack/templates/tests/test-connection.yaml b/srs-stack/templates/tests/test-connection.yaml new file mode 100644 index 0000000..a1729d6 --- /dev/null +++ b/srs-stack/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "srs.fullname" . }}-test-connection" + labels: + {{- include "srs.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "srs.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/srs-stack/values.schema.json b/srs-stack/values.schema.json new file mode 100644 index 0000000..b83143b --- /dev/null +++ b/srs-stack/values.schema.json @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/schema#", + "type": "object", + "properties": { + "image": { + "type": "object", + "properties": { + "repository": { + "type": "string" + }, + "tag": { + "type": "string", + "description": "Overrides the image tag whose default is the chart appVersion." + }, + "pullPolicy": { + "type": "string" + } + } + }, + "replicaCount": { + "type": "integer", + "const": 1, + "description": "Warning: Only support 1 replica right now." + } + } +} \ No newline at end of file diff --git a/srs-stack/values.yaml b/srs-stack/values.yaml new file mode 100644 index 0000000..aeb19df --- /dev/null +++ b/srs-stack/values.yaml @@ -0,0 +1,109 @@ +# Copyright ossrs, Inc. +# SPDX-License-Identifier: MIT + +## @section Global parameters +## Global Docker image parameters +## Please, note that this will override the image parameters, including dependencies, configured to use the global value +## + +## @section Common parameters +## + +image: + repository: ossrs/srs-stack + tag: "" + pullPolicy: IfNotPresent + +replicaCount: 1 + +# The configuration for SRS can be overridden by environment variables. +# See https://github.com/ossrs/srs/blob/develop/trunk/conf/full.conf +conf: + SRS_LOG_TANK: "console" + +# The environment variables to set in the container. +# See https://github.com/ossrs/srs/blob/develop/trunk/conf/full.conf +env: [] + #- name: SRS_LOG_TANK + # value: "file" + +# The WebRTC candidate, which is your server's public IP address, can be accessed by the client. +# See https://ossrs.io/lts/en-us/docs/v5/doc/webrtc#config-candidate for details. +# Note that if this value is not empty, it will override the SRS_RTC_SERVER_CANDIDATE value in +# both the {{.Values.conf}} and {{.Values.env}}. +candidate: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: false + # 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: LoadBalancer + rtmp: 1935 + http: 80 + https: 443 + srt: 10080 + rtc: 8000 + +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/stable/index.yaml b/stable/index.yaml index adc2ce0..739bab6 100644 --- a/stable/index.yaml +++ b/stable/index.yaml @@ -6,7 +6,7 @@ entries: licenses: MIT apiVersion: v2 appVersion: 5.0.166 - created: "2023-10-27T19:16:55.104368+08:00" + created: "2023-10-29T08:32:18.484801+08:00" description: SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181. digest: 07dbb278f814a39b3362e2e626fc0a2204ea1458867fd9480fa6050e1b8d1fa6 @@ -36,7 +36,7 @@ entries: licenses: MIT apiVersion: v2 appVersion: 5.0.166 - created: "2023-10-27T19:16:55.103627+08:00" + created: "2023-10-29T08:32:18.483436+08:00" description: SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181. digest: 2ac770b72abee9cf5b21e62e84574cb6c9a88151117849a8256c7836564a2201 @@ -66,7 +66,7 @@ entries: licenses: MIT apiVersion: v2 appVersion: 5.0.166 - created: "2023-10-27T19:16:55.10225+08:00" + created: "2023-10-29T08:32:18.482313+08:00" description: SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181. digest: 7038959be27113ad9735d44a005894803d5a0b7c8dde107b09748e82811b57a8 @@ -96,7 +96,7 @@ entries: licenses: MIT apiVersion: v2 appVersion: 5.0.166 - created: "2023-10-27T19:16:55.100782+08:00" + created: "2023-10-29T08:32:18.481184+08:00" description: SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181. digest: abb3f581543235edd805262b010f3d8d2759b844848dab0f8206082d6c4f161c @@ -126,7 +126,7 @@ entries: licenses: MIT apiVersion: v2 appVersion: 5.0.157 - created: "2023-10-27T19:16:55.099423+08:00" + created: "2023-10-29T08:32:18.480149+08:00" description: SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181. digest: b944d81f7b850934282bcf7f7696b90d78ea40e0d0dabfcb7ccc0e698e8ab6e8 @@ -156,7 +156,7 @@ entries: licenses: MIT apiVersion: v2 appVersion: 5.0.157 - created: "2023-10-27T19:16:55.097679+08:00" + created: "2023-10-29T08:32:18.479078+08:00" description: SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181. digest: 11be4afbdab3f1ab8fa0f96cacca6a39a2db1087b0e4b68abdf0fb1a08ccb615 @@ -181,4 +181,38 @@ entries: urls: - srs-server-1.0.0.tgz version: 1.0.0 -generated: "2023-10-27T19:16:55.093361+08:00" + srs-stack: + - annotations: + category: Infrastructure + licenses: MIT + apiVersion: v2 + appVersion: 5.11.5 + created: "2023-10-29T08:32:18.485363+08:00" + 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. + digest: c218a70fd4f23c83b7e9df05fe67610ef454c6b19968af86e9b5197d964d9811 + home: https://helm.ossrs.io/stable + icon: https://ossrs.io/lts/en-us/img/srs-220x234.png + keywords: + - srs + - media + - video + - rtmp + - hls + - webrtc + - srt + maintainers: + - email: winlinvip@gmail.com + name: Winlin + url: https://github.com/ossrs/srs-helm + name: srs-stack + sources: + - https://github.com/ossrs/srs-helm/tree/v1.0.1/srs-stack + type: application + urls: + - srs-stack-1.0.1.tgz + version: 1.0.1 +generated: "2023-10-29T08:32:18.47764+08:00" diff --git a/stable/srs-stack-1.0.1.tgz b/stable/srs-stack-1.0.1.tgz new file mode 100644 index 0000000000000000000000000000000000000000..7bc7641fc2b05212a8718c88a62bfab3aa1fffe8 GIT binary patch literal 5133 zcmV+o6!PmIiwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH+#bK5wQ^O?V*Pxe+GXHk+LNmf<4TCeTNx{}x`%Smo)YRUzX zEeT^1-~ym*jmP)fuNvS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