diff --git a/.github/cr.yaml b/.github/cr.yaml index 4114250..b64b10c 100644 --- a/.github/cr.yaml +++ b/.github/cr.yaml @@ -1 +1,2 @@ -release-name-template: "{{ .Version }}" \ No newline at end of file +owner: jellyfin +release-name-template: "{{ .Name }}-{{ .Version }}" \ No newline at end of file diff --git a/.github/workflows/app_release.yaml b/.github/workflows/app_release.yaml new file mode 100644 index 0000000..30a0646 --- /dev/null +++ b/.github/workflows/app_release.yaml @@ -0,0 +1,71 @@ +name: Bump Helm Chart Version + +on: + push: + branches: + - main + workflow_dispatch: + inputs: + jellyfin_version: + description: 'Application version to set in Chart.yaml' + required: true + default: '1.0.0' + +jobs: + bump-version: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.x + + - name: Bump chart version and set appVersion + id: bump_version + run: | + # Read the current version from the Chart.yaml + current_version=$(grep '^version:' Chart.yaml | awk '{print $2}') + echo "Current version: $current_version" + + # Split the version by dot and increment the minor version + major=$(echo "$current_version" | cut -d '.' -f 1) + minor=$(echo "$current_version" | cut -d '.' -f 2) + patch=$(echo "$current_version" | cut -d '.' -f 3) + new_version="$major.$((minor+1)).0" + + echo "New chart version: $new_version" + + # Get the app version passed as an input + jellyfin_version="${{ github.event.inputs.jellyfin_version }}" + echo "Setting appVersion to: $jellyfin_version" + + # Update the Chart.yaml with the new version and appVersion + sed -i "s/^version:.*/version: $new_version/" Chart.yaml + sed -i "s/^appVersion:.*/appVersion: $jellyfin_version/" Chart.yaml + + # Output the new chart version for further use + echo "::set-output name=new_version::$new_version" + + - name: Commit changes + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add Chart.yaml + git commit -m "chore(jellyfin): Bump chart version to ${{ steps.bump_version.outputs.new_version }} and set appVersion to ${{ github.event.inputs.jellyfin_version }}" + + - name: Push changes + run: git push + + - name: Create Git tag + id: create_tag + run: | + new_version="${{ steps.bump_version.outputs.new_version }}" + git tag "$new_version" + echo "Tag created: $new_version" + + - name: Push tag + run: git push origin "${{ steps.bump_version.outputs.new_version }}" diff --git a/.github/workflows/docs_update.yaml b/.github/workflows/docs_update.yaml new file mode 100644 index 0000000..02e8726 --- /dev/null +++ b/.github/workflows/docs_update.yaml @@ -0,0 +1,28 @@ +name: Docs Update + +on: + push: + branches: + - master + +permissions: + contents: write + packages: write + +jobs: + generate-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + with: + fetch-depth: 0 + + - name: Helm Docs GitHub Action + uses: losisin/helm-docs-github-action@v1.3.1 + with: + git-push: true + git-commit-message: "docs(charts): :memo: write updated reademe" + + - name: Push changes + run: git push \ No newline at end of file diff --git a/.github/workflows/on_jellyfin_release.yaml b/.github/workflows/on_jellyfin_release.yaml deleted file mode 100644 index 9e70b6b..0000000 --- a/.github/workflows/on_jellyfin_release.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: OnJellyfinRelease -on: - workflow_dispatch: - inputs: - jellyfin_version: - description: 'Version of jellyfin released' - required: true - type: string - -jobs: - release: - # depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions - # see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token - permissions: - contents: write - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure Git - run: | - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - - name: yq - portable yaml processor - uses: mikefarah/yq@f15500b20a1c991c8729870ba60a4dc3524b6a94 # v4.44.2 - - - name: Update helm values - run: | - JELLYFIN_VERSION=${{ github.event.inputs.jellyfin_version }} - yq -i ".appVersion=\"${JELLYFIN_VERSION}\"" charts/jellyfin/Chart.yaml - yq -i ".version=\"${JELLYFIN_VERSION}\"" charts/jellyfin/Chart.yaml - make helm-docs - - cp charts/jellyfin/README.md README.MD - git add charts - git add README.MD - git commit -m "chore(jellyfin): Updated chart and app version to ${JELLYFIN_VERSION}}" - git push diff --git a/.github/workflows/helm_chart_release.yaml b/.github/workflows/release.yaml similarity index 97% rename from .github/workflows/helm_chart_release.yaml rename to .github/workflows/release.yaml index 2b2539e..bd26b5f 100644 --- a/.github/workflows/helm_chart_release.yaml +++ b/.github/workflows/release.yaml @@ -2,7 +2,6 @@ name: Release on: push: - # run only against tags tags: - '*' @@ -10,7 +9,7 @@ permissions: contents: write packages: write -jobs: +jobs: release: # depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions # see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token diff --git a/README.md b/README.md new file mode 100644 index 0000000..9186bc8 --- /dev/null +++ b/README.md @@ -0,0 +1,73 @@ +# Jellyfin Helm Charts Repository + +This repository contains Helm charts for the jellyfin project. + +## Repository Structure + +Each Helm chart is stored in its own directory. Each chart follows the standard Helm chart structure: + +```plaintext +hellyfin-helm/ +├── jellyfin/ +│ ├── Chart.yaml +│ ├── values.yaml +│ ├── templates/ +│ └── ... +├── chart2/ +│ ├── Chart.yaml +│ ├── values.yaml +│ ├── templates/ +│ └── ... +└── ... +``` + +- `Chart.yaml`: Contains metadata about the chart (name, version, app version, etc.). +- `values.yaml`: Default configuration values for the chart. +- `templates/`: The Kubernetes resource templates (YAML files) that Helm uses to deploy the chart. + +## How to Use the Charts + +### 1. Add this Repository + +To use the charts in this repository, first add the repository to Helm: + +```bash +helm repo add jellyfin https://.git +helm repo update +``` + +### 2. Install a Chart + +To install a chart from this repository, use the following command: + +```bash +helm install jellyfin/ +``` + +### 3. Customize Installation + +You can customize the installation by passing in custom values via the `--set` flag or by using a `values.yaml` file: + +```bash +helm install jellyfin/ --set key=value +``` + +or + +```bash +helm install jellyfin/ -f custom-values.yaml +``` + +## Contributing + +Feel free to contribute to this repository by: + +- Submitting new charts. +- Fixing bugs or issues. +- Improving documentation. + +To contribute, fork this repository, create a new branch, and submit a pull request with your changes. + +## License + +This repository is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details. diff --git a/charts/jellyfin/Chart.yaml b/charts/jellyfin/Chart.yaml index 6d9056d..010e1ed 100644 --- a/charts/jellyfin/Chart.yaml +++ b/charts/jellyfin/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "10.9.1" description: Jellyfin Media Server name: jellyfin -version: 10.9.1 +version: 1.0.0 type: application home: https://jellyfin.org/ icon: https://jellyfin.org/images/logo.svg diff --git a/charts/jellyfin/README.md b/charts/jellyfin/README.md index 0590d79..d603741 100644 --- a/charts/jellyfin/README.md +++ b/charts/jellyfin/README.md @@ -1,65 +1,95 @@ -# Jellyfin Software Media System +# jellyfin -This is a helm chart for [Jellyfin](https://github.com/jellyfin/jellyfin/) +![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 10.9.1](https://img.shields.io/badge/AppVersion-10.9.1-informational?style=flat-square) -## Prerequisites +Jellyfin Media Server -- Kubernetes 1.19+ -- Helm 3+ +**Homepage:** -## TL;DR; +## Steps to Use a Helm Chart +### 1. Add a Helm Repository -## Configuration +Helm repositories contain collections of charts. You can add an existing repository using the following command: -The following tables lists the configurable parameters of the Jellyfin chart and their default values. +```bash +helm repo add +``` -| Parameter | Description | Default | -|----------------------------|-------------------------------------|---------------------------------------------------------| -| `image.repository` | Image repository | `docker.io/jellyfin/jellyfin` | -| `image.tag` | Image tag. Possible values listed [here](https://hub.docker.com/r/jellyfin/jellyfin/tags/).| `latest`| -| `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `enableDLNA` | Enable DLNA for jellyfin | `false` | -| `Service.type` | Kubernetes service type for the jellyfin GUI | `ClusterIP` | -| `Service.port` | Kubernetes port where the jellyfin GUI is exposed| `8096` | -| `Service.annotations` | Service annotations for the jellyfin GUI | `{}` | -| `Service.labels` | Custom labels | `{}` | -| `Service.loadBalancerIP` | Loadbalance IP for the jellyfin GUI | `{}` | -| `Service.loadBalancerSourceRanges` | List of IP CIDRs allowed access to load balancer (if supported) | None -| `ingress.enabled` | Enables Ingress | `false` | -| `ingress.annotations` | Ingress annotations | `{}` | -| `ingress.labels` | Custom labels | `{}` -| `ingress.path` | Ingress path | `/` | -| `ingress.hosts` | Ingress accepted hostnames | `chart-example.local` | -| `ingress.tls` | Ingress TLS configuration | `[]` | -| `persistence.config.enabled` | Use persistent volume to store configuration data | `false` | -| `persistence.config.size` | Size of persistent volume claim | `1Gi` | -| `persistence.config.existingClaim`| Use an existing PVC to persist data | `nil` | -| `persistence.config.storageClass` | Type of persistent volume claim | `-` | -| `persistence.config.accessMode` | Persistence access mode | `ReadWriteOnce` | -| `persistence.media.enabled` | Use persistent volume to store configuration data | `true` | -| `persistence.media.size` | Size of persistent volume claim | `10Gi` | -| `persistence.media.existingClaim`| Use an existing PVC to persist data | `nil` | -| `persistence.media.storageClass` | Type of persistent volume claim | `-` | -| `persistence.media.accessMode` | Persistence access mode | `ReadWriteOnce` | -| `persistence.extraExistingClaimMounts` | Optionally add multiple existing claims | `[]` | -| `resources` | CPU/Memory resource requests/limits | `{}` | -| `nodeSelector` | Node labels for pod assignment | `{}` | -| `tolerations` | Toleration labels for pod assignment | `[]` | -| `affinity` | Affinity settings for pod assignment | `{}` | -| `livenessProbe.enabled` | Enable livenessProbe | `true` | -| `livenessProbe.failureThreshold` | Number of consecutive failures before restarting the pod | `3` | -| `livenessProbe.initialDelaySeconds` | Number of seconds after the container has started before liveness probes begin | `10` | -| `livenessProbe.periodSeconds` | How often to perform the probe | `10` | -| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | `1` | -| `livenessProbe.timeoutSeconds` | Number of seconds after which the probe times out | `1` | -| `readinessProbe.enabled` | Enable readinessProbe | `true` | -| `readinessProbe.failureThreshold` | Number of consecutive failures before restarting the pod | `3` | -| `readinessProbe.initialDelaySeconds` | Number of seconds after the container has started before liveness probes begin | `10` | -| `readinessProbe.periodSeconds` | How often to perform the probe | `10` | -| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | `1` | -| `readinessProbe.timeoutSeconds` | Number of seconds after which the probe times out | `1` | +### 2. Install the Helm Chart -Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. +To install a chart, use the following command: -Read through the [values.yaml](values.yaml) file. It has several suggested values. +```bash +helm install /jellyfin +``` + +### 3. View the Installation + +You can check the status of the release using: + +```bash +helm status +``` + +## Customizing the Chart + +Helm charts come with default values, but you can customize them by using the --set flag or by providing a custom values.yaml file. + +### 1. Using --set to Override Values +```bash +helm install --set key1=value1,key2=value2 +``` + +### 2. Using a values.yaml File +You can create a custom values.yaml file and pass it to the install command: + +```bash +helm install -f values.yaml +``` + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| enableDLNA | bool | `false` | Setting this to true enables DLNA which requires the pod to be attached to the host network in order to be useful - this can break things like ingress to the service https://jellyfin.org/docs/general/networking/dlna.html | +| extraContainers | object | `{}` | additional sidecar containers to run inside the pod. | +| extraEnvVars | list | `[]` | aditional environment variables passed to the pod | +| extraPodAnnotations | object | `{}` | additional annotations applied to the pod | +| extraPodLabels | object | `{}` | additional pod labels. Not used as a selector label. | +| extraVolumeMounts | list | `[]` | Define mount points for additional volumes. | +| extraVolumes | list | `[]` | Define additional volumes to mount to the pod. | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.repository | string | `"docker.io/jellyfin/jellyfin"` | Set cutom repository for jellyfin image | +| image.tag | string | `""` | Set jellyfin version which should be required since chart is updated with new versions automatically | +| ingress.annotations | object | `{}` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts[0] | string | `"chart-example.local"` | | +| ingress.path | string | `"/"` | | +| ingress.tls | list | `[]` | | +| livenessProbe | object | `{"enabled":true,"initialDelaySeconds":10}` | Larger libraries may need to increase the readinessProbe and livenessProbe timeouts. Start by increasing the initialDelaySeconds. | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| persistence.config.accessMode | string | `"ReadWriteOnce"` | | +| persistence.config.enabled | bool | `false` | | +| persistence.config.size | string | `"1Gi"` | | +| persistence.config.storageClass | string | `"-"` | If undefined (the default) or set to null, no storageClassName spec is set, choosing the default provisioner. | +| persistence.extraExistingClaimMounts | list | `[]` | Add aditional PVs/PVCs to our container. Check values.yaml to see an example. | +| persistence.media.accessMode | string | `"ReadWriteOnce"` | | +| persistence.media.enabled | bool | `false` | | +| persistence.media.size | string | `"10Gi"` | | +| persistence.media.storageClass | string | `"-"` | If undefined (the default) or set to null, no storageClassName spec is set, choosing the default provisioner. | +| readinessProbe | object | `{"enabled":true,"initialDelaySeconds":10}` | Larger libraries may need to increase the readinessProbe and livenessProbe timeouts. Start by increasing the initialDelaySeconds. | +| replicaCount | int | `1` | Number of jellyfin replicas to start. Should be left at 1 | +| resources | object | `{}` | | +| service.annotations | object | `{}` | | +| service.labels | object | `{}` | | +| service.loadBalancerIP | string | `nil` | | +| service.port | int | `8096` | | +| service.type | string | `"ClusterIP"` | | +| tolerations | list | `[]` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2) diff --git a/charts/jellyfin/README.md.gotmpl b/charts/jellyfin/README.md.gotmpl new file mode 100644 index 0000000..330a79a --- /dev/null +++ b/charts/jellyfin/README.md.gotmpl @@ -0,0 +1,60 @@ +{{ template "chart.header" . }} +{{ template "chart.deprecationWarning" . }} + +{{ template "chart.badgesSection" . }} + +{{ template "chart.description" . }} + +{{ template "chart.homepageLine" . }} + +## Steps to Use a Helm Chart + +### 1. Add a Helm Repository + +Helm repositories contain collections of charts. You can add an existing repository using the following command: + +```bash +helm repo add +``` + +### 2. Install the Helm Chart + +To install a chart, use the following command: + +```bash +helm install /jellyfin +``` + +### 3. View the Installation + +You can check the status of the release using: + +```bash +helm status +``` + +## Customizing the Chart + +Helm charts come with default values, but you can customize them by using the --set flag or by providing a custom values.yaml file. + +### 1. Using --set to Override Values +```bash +helm install --set key1=value1,key2=value2 +``` + +### 2. Using a values.yaml File +You can create a custom values.yaml file and pass it to the install command: + +```bash +helm install -f values.yaml +``` + +{{ template "chart.maintainersSection" . }} + +{{ template "chart.sourcesSection" . }} + +{{ template "chart.requirementsSection" . }} + +{{ template "chart.valuesSection" . }} + +{{ template "helm-docs.versionFooter" . }} diff --git a/charts/jellyfin/templates/deployment.yaml b/charts/jellyfin/templates/deployment.yaml index 9d57d94..b46de2b 100644 --- a/charts/jellyfin/templates/deployment.yaml +++ b/charts/jellyfin/templates/deployment.yaml @@ -33,7 +33,7 @@ spec: {{- end }} containers: - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} {{ if .Values.extraEnvVars }} env: diff --git a/charts/jellyfin/values.yaml b/charts/jellyfin/values.yaml index def5f6a..f0e2b75 100644 --- a/charts/jellyfin/values.yaml +++ b/charts/jellyfin/values.yaml @@ -1,20 +1,18 @@ -# Default values for jellyfin. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - +# -- Number of jellyfin replicas to start. Should be left at 1 replicaCount: 1 image: + # -- Set cutom repository for jellyfin image repository: docker.io/jellyfin/jellyfin - tag: "10.9.1" + # -- Set jellyfin version which should be required since chart is updated with new versions automatically + tag: "" pullPolicy: IfNotPresent nameOverride: "" fullnameOverride: "" -# Setting this to true enables DLNA which requires the pod to be attached to the +# -- Setting this to true enables DLNA which requires the pod to be attached to the # host network in order to be useful - this can break things like ingress to the service -# https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#hosts-namespaces # https://jellyfin.org/docs/general/networking/dlna.html enableDLNA: false @@ -55,15 +53,8 @@ ingress: persistence: config: enabled: false - ## jellyfin configuration data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - ## + # -- If undefined (the default) or set to null, no storageClassName spec is set, choosing the default provisioner. + storageClass: "-" ## If you want to reuse an existing claim, you can pass the name of the PVC using ## the existingClaim variable # existingClaim: your-claim @@ -72,21 +63,15 @@ persistence: size: 1Gi media: enabled: false - ## Directory where media is persisted - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - ## + # -- If undefined (the default) or set to null, no storageClassName spec is set, choosing the default provisioner. + storageClass: "-" ## If you want to reuse an existing claim, you can pass the name of the PVC using ## the existingClaim variable # existingClaim: your-claim # subPath: some-subpath accessMode: ReadWriteOnce size: 10Gi + # -- Add aditional PVs/PVCs to our container. Check values.yaml to see an example. extraExistingClaimMounts: [] # - name: external-mount # mountPath: /srv/external-mount @@ -113,27 +98,32 @@ tolerations: [] affinity: {} +# -- Define additional volumes to mount to the pod. extraVolumes: [] #- name: renderD129 # hostPath: # path: /dev/dri/renderD129 +# -- Define mount points for additional volumes. extraVolumeMounts: [] #- mountPath: /dev/dri/renderD129 # name: renderD129 +# -- additional pod labels. Not used as a selector label. extraPodLabels: {} +# -- aditional environment variables passed to the pod extraEnvVars: [] #- name: MY_ENV_VAR # value: my-env-var-value -# additional annotations applied to the pod +# -- additional annotations applied to the pod extraPodAnnotations: {} +# -- additional sidecar containers to run inside the pod. extraContainers: {} -# Larger libraries may need to increase the readinessProbe and livenessProbe timeouts. Start by increasing the initialDelaySeconds. +# -- Larger libraries may need to increase the readinessProbe and livenessProbe timeouts. Start by increasing the initialDelaySeconds. livenessProbe: enabled: true # failureThreshold: 3 @@ -142,6 +132,7 @@ livenessProbe: # successThreshold: 1 # timeoutSeconds: 1 +# -- Larger libraries may need to increase the readinessProbe and livenessProbe timeouts. Start by increasing the initialDelaySeconds. readinessProbe: enabled: true # failureThreshold: 3