From abf2d3b8577887317d1b269bcc5ef3e70f3a5691 Mon Sep 17 00:00:00 2001 From: auricom Date: Tue, 16 Mar 2021 12:29:07 +0100 Subject: [PATCH] [sharry] new chart (#683) --- charts/sharry/.helmignore | 26 ++++ charts/sharry/Chart.yaml | 19 +++ charts/sharry/README.md | 119 +++++++++++++++++++ charts/sharry/README.md.gotmpl | 145 +++++++++++++++++++++++ charts/sharry/README_CHANGELOG.md.gotmpl | 12 ++ charts/sharry/README_CONFIG.md.gotmpl | 9 ++ charts/sharry/templates/NOTES.txt | 1 + charts/sharry/templates/common.yaml | 1 + charts/sharry/templates/configmap.yaml | 91 ++++++++++++++ charts/sharry/values.yaml | 77 ++++++++++++ 10 files changed, 500 insertions(+) create mode 100644 charts/sharry/.helmignore create mode 100644 charts/sharry/Chart.yaml create mode 100644 charts/sharry/README.md create mode 100644 charts/sharry/README.md.gotmpl create mode 100644 charts/sharry/README_CHANGELOG.md.gotmpl create mode 100644 charts/sharry/README_CONFIG.md.gotmpl create mode 100644 charts/sharry/templates/NOTES.txt create mode 100644 charts/sharry/templates/common.yaml create mode 100644 charts/sharry/templates/configmap.yaml create mode 100644 charts/sharry/values.yaml diff --git a/charts/sharry/.helmignore b/charts/sharry/.helmignore new file mode 100644 index 00000000..2a482c10 --- /dev/null +++ b/charts/sharry/.helmignore @@ -0,0 +1,26 @@ +# 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 +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ +# OWNERS file for Kubernetes +OWNERS +# helm-docs templates +*.gotmpl \ No newline at end of file diff --git a/charts/sharry/Chart.yaml b/charts/sharry/Chart.yaml new file mode 100644 index 00000000..fa5b3277 --- /dev/null +++ b/charts/sharry/Chart.yaml @@ -0,0 +1,19 @@ +apiVersion: v2 +appVersion: 1.6.0 +description: Sharry allows to share files with others in a simple way. It is a self-hosted web application. The basic concept is to upload files and get a url back that can then be shared. +name: sharry +version: 1.0.0 +keywords: + - file sharing +home: https://github.com/k8s-at-home/charts/tree/master/charts/sharry +icon: https://github.com/eikek/sharry/blob/master/artwork/logo.svg?raw=true +sources: + - https://github.com/eikek/sharry + - https://hub.docker.com/r/eikek0/sharry +maintainers: + - name: auricom + email: k8s-at-home@xpander.eml.cc +dependencies: + - name: common + repository: https://library-charts.k8s-at-home.com + version: 1.0.0 diff --git a/charts/sharry/README.md b/charts/sharry/README.md new file mode 100644 index 00000000..cbd66ebf --- /dev/null +++ b/charts/sharry/README.md @@ -0,0 +1,119 @@ +# sharry + +![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![AppVersion: 1.6.0](https://img.shields.io/badge/AppVersion-1.6.0-informational?style=flat-square) + +Sharry allows to share files with others in a simple way. It is a self-hosted web application. The basic concept is to upload files and get a url back that can then be shared. + +**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/k8s-at-home/charts/issues/new/choose)** + +## Source Code + +* +* + +## Requirements + +## Dependencies + +| Repository | Name | Version | +|------------|------|---------| +| https://library-charts.k8s-at-home.com | common | 1.0.0 | + +## TL;DR + +```console +helm repo add k8s-at-home https://k8s-at-home.com/charts/ +helm repo update +helm install sharry k8s-at-home/sharry +``` + +## Installing the Chart + +To install the chart with the release name `sharry` + +```console +helm install sharry k8s-at-home/sharry +``` + +## Uninstalling the Chart + +To uninstall the `sharry` deployment + +```console +helm uninstall sharry +``` + +The command removes all the Kubernetes components associated with the chart **including persistent volumes** and deletes the release. + +## Configuration + +Read through the [values.yaml](./values.yaml) file. It has several commented out suggested values. +Other values may be used from the [values.yaml](../common/values.yaml) from the [common library](../common). + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. + +```console +helm install sharry \ + --set env.TZ="America/New York" \ + k8s-at-home/sharry +``` + +Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. + +```console +helm install sharry k8s-at-home/sharry -f values.yaml +``` + +## Custom configuration + +N/A + +## Values + +**Important**: When deploying an application Helm chart you can add more values from our common library chart [here](https://github.com/k8s-at-home/charts/tree/master/charts/common/) + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| additionalVolumeMounts[0].mountPath | string | `"/opt/sharry.conf"` | | +| additionalVolumeMounts[0].name | string | `"sharry-config"` | | +| additionalVolumeMounts[0].subPath | string | `"sharry.conf"` | | +| additionalVolumes[0].configMap.name | string | `"sharry-config"` | | +| additionalVolumes[0].name | string | `"sharry-config"` | | +| affinity | object | `{}` | Affinity settings for pod assignment of the GUI | +| args[0] | string | `"/opt/sharry.conf"` | | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.repository | string | `"eikek0/sharry"` | sharry image | +| image.tag | string | `"1.6.0"` | sharry image tag | +| ingress.annotations."nginx.ingress.kubernetes.io/client-body-buffer-size" | string | `"2048m"` | Nginx client Body Buffer Size | +| ingress.annotations."nginx.ingress.kubernetes.io/proxy-body-size" | string | `"2048m"` | Nginx Proxy Body Size | +| ingress.annotations."nginx.ingress.kubernetes.io/proxy-buffering" | string | `"off"` | | +| ingress.enabled | bool | `false` | | +| nodeSelector | object | `{}` | Node labels for pod assignment of the GUI | +| podAnnotations | object | `{}` | Pod annotations | +| resources | object | `{}` | | +| service.port.port | int | `9090` | Kubernetes port where the GUI is exposed | +| sharry.baseUrl | string | `"http://localhost:9090"` | This is the base URL this application is deployed to. | +| sharry.chunkSize | string | `"512K"` | When storing binary data use chunks of this size. | +| sharry.jdbcPassword | string | `""` | jdbc Password | +| sharry.jdbcUrl | string | `"jdbc:h2://\"${java.io.tmpdir}\"/sharry-demo.db;MODE=PostgreSQL;DATABASE_TO_LOWER=TRUE"` | By default a H2 file-based database is configured. You can provide a postgresql or mariadb connection here. | +| sharry.jdbcUser | string | `"sa"` | jdbc Username | +| sharry.maxSize | string | `"1.5G"` | Maximum size of a share. | +| sharry.maxValidity | string | `"365 days"` | Maximum validity for uploads. | +| sharry.signup | string | `"open"` | The mode defines if new users can signup or not. It can have three values : open, invite, closed | +| tolerations | list | `[]` | Toleration labels for pod assignment of the GUI | + +## Changelog + +All notable changes to this application Helm chart will be documented in this file but does not include changes from our common library. To read those click [here](https://github.com/k8s-at-home/charts/tree/master/charts/common/README.md#Changelog). + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## Support + +- See the [Docs](https://docs.k8s-at-home.com/our-helm-charts/getting-started/) +- Open an [issue](https://github.com/k8s-at-home/charts/issues/new/choose) +- Ask a [question](https://github.com/k8s-at-home/organization/discussions) +- Join our [Discord](https://discord.gg/sTMX7Vh) community + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.5.0](https://github.com/norwoodj/helm-docs/releases/v1.5.0) \ No newline at end of file diff --git a/charts/sharry/README.md.gotmpl b/charts/sharry/README.md.gotmpl new file mode 100644 index 00000000..8b868671 --- /dev/null +++ b/charts/sharry/README.md.gotmpl @@ -0,0 +1,145 @@ +{{- define "custom.repository.organization" -}} +k8s-at-home +{{- end -}} + +{{- define "custom.repository.url" -}} +https://github.com/k8s-at-home/charts +{{- end -}} + +{{- define "custom.helm.url" -}} +https://k8s-at-home.com/charts/ +{{- end -}} + +{{- define "custom.helm.path" -}} +{{ template "custom.repository.organization" . }}/{{ template "chart.name" . }} +{{- end -}} + +{{- define "custom.notes" -}} +**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/k8s-at-home/charts/issues/new/choose)** +{{- end -}} + +{{- define "custom.requirements" -}} +## Requirements + +{{ template "chart.kubeVersionLine" . }} +{{- end -}} + +{{- define "custom.dependencies" -}} +## Dependencies + +{{ template "chart.requirementsTable" . }} +{{- end -}} + +{{- define "custom.install.tldr" -}} +## TL;DR + +```console +helm repo add {{ template "custom.repository.organization" . }} {{ template "custom.helm.url" . }} +helm repo update +helm install {{ template "chart.name" . }} {{ template "custom.helm.path" . }} +``` +{{- end -}} + +{{- define "custom.install" -}} +## Installing the Chart + +To install the chart with the release name `{{ template "chart.name" . }}` + +```console +helm install {{ template "chart.name" . }} {{ template "custom.helm.path" . }} +``` +{{- end -}} + +{{- define "custom.uninstall" -}} +## Uninstalling the Chart + +To uninstall the `{{ template "chart.name" . }}` deployment + +```console +helm uninstall {{ template "chart.name" . }} +``` + +The command removes all the Kubernetes components associated with the chart **including persistent volumes** and deletes the release. +{{- end -}} + +{{- define "custom.configuration.header" -}} +## Configuration +{{- end -}} + +{{- define "custom.configuration.readValues" -}} +Read through the [values.yaml](./values.yaml) file. It has several commented out suggested values. +Other values may be used from the [values.yaml](../common/values.yaml) from the [common library](../common). +{{- end -}} + +{{- define "custom.configuration.example.set" -}} +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. + +```console +helm install {{ template "chart.name" . }} \ + --set env.TZ="America/New York" \ + {{ template "custom.helm.path" . }} +``` +{{- end -}} + +{{- define "custom.configuration.example.file" -}} +Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. + +```console +helm install {{ template "chart.name" . }} {{ template "custom.helm.path" . }} -f values.yaml +``` +{{- end -}} + +{{- define "custom.valuesSection" -}} +## Values + +**Important**: When deploying an application Helm chart you can add more values from our common library chart [here](https://github.com/k8s-at-home/charts/tree/master/charts/common/) + +{{ template "chart.valuesTable" . }} +{{- end -}} + +{{- define "custom.support" -}} +## Support + +- See the [Docs](https://docs.k8s-at-home.com/our-helm-charts/getting-started/) +- Open an [issue](https://github.com/k8s-at-home/charts/issues/new/choose) +- Ask a [question](https://github.com/k8s-at-home/organization/discussions) +- Join our [Discord](https://discord.gg/sTMX7Vh) community +{{- end -}} + +{{ template "chart.header" . }} + +{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} + +{{ template "chart.description" . }} + +{{ template "custom.notes" . }} + +{{ template "chart.sourcesSection" . }} + +{{ template "custom.requirements" . }} + +{{ template "custom.dependencies" . }} + +{{ template "custom.install.tldr" . }} + +{{ template "custom.install" . }} + +{{ template "custom.uninstall" . }} + +{{ template "custom.configuration.header" . }} + +{{ template "custom.configuration.readValues" . }} + +{{ template "custom.configuration.example.set" . }} + +{{ template "custom.configuration.example.file" . }} + +{{ template "custom.custom.configuration" . }} + +{{ template "custom.valuesSection" . }} + +{{ template "custom.changelog" . }} + +{{ template "custom.support" . }} + +{{ template "helm-docs.versionFooter" . }} diff --git a/charts/sharry/README_CHANGELOG.md.gotmpl b/charts/sharry/README_CHANGELOG.md.gotmpl new file mode 100644 index 00000000..99310a72 --- /dev/null +++ b/charts/sharry/README_CHANGELOG.md.gotmpl @@ -0,0 +1,12 @@ +{{- define "custom.changelog.header" -}} +## Changelog +{{- end -}} + +{{- define "custom.changelog" -}} +{{ template "custom.changelog.header" . }} + +All notable changes to this application Helm chart will be documented in this file but does not include changes from our common library. To read those click [here](https://github.com/k8s-at-home/charts/tree/master/charts/common/README.md#Changelog). + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +{{- end -}} diff --git a/charts/sharry/README_CONFIG.md.gotmpl b/charts/sharry/README_CONFIG.md.gotmpl new file mode 100644 index 00000000..e93d80bf --- /dev/null +++ b/charts/sharry/README_CONFIG.md.gotmpl @@ -0,0 +1,9 @@ +{{- define "custom.custom.configuration.header" -}} +## Custom configuration +{{- end -}} + +{{- define "custom.custom.configuration" -}} +{{ template "custom.custom.configuration.header" . }} + +N/A +{{- end -}} diff --git a/charts/sharry/templates/NOTES.txt b/charts/sharry/templates/NOTES.txt new file mode 100644 index 00000000..90f7b653 --- /dev/null +++ b/charts/sharry/templates/NOTES.txt @@ -0,0 +1 @@ +{{- include "common.notes.defaultNotes" . -}} diff --git a/charts/sharry/templates/common.yaml b/charts/sharry/templates/common.yaml new file mode 100644 index 00000000..a6613c2c --- /dev/null +++ b/charts/sharry/templates/common.yaml @@ -0,0 +1 @@ +{{ include "common.all" . }} diff --git a/charts/sharry/templates/configmap.yaml b/charts/sharry/templates/configmap.yaml new file mode 100644 index 00000000..8bea7f35 --- /dev/null +++ b/charts/sharry/templates/configmap.yaml @@ -0,0 +1,91 @@ + +{{/* +Sharry Configuration files. +*/}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: "sharry-config" + labels: + {{- include "common.labels" . | nindent 4 }} +data: + sharry.conf: | + sharry.restserver { + + {{- if .Values.sharry.baseUrl }} + base-url = "{{ .Values.sharry.baseUrl }}" + {{ end }} + bind { + address = "0.0.0.0" + port = {{- if .Values.service.port.port }}{{ .Values.service.port.port }}{{ end }} + } + + backend { + auth { + fixed.enabled = true ## enabled admin:admin access + } + + jdbc { + url = "{{- if .Values.sharry.jdbcUrl }}{{ .Values.sharry.jdbcUrl }}{{ end }}" + user = "{{- if .Values.sharry.jdbcUser }}{{ .Values.sharry.jdbcUser }}{{ end }}" + password = "{{- if .Values.sharry.jdbcPassword }}{{ .Values.sharry.jdbcPassword }}{{ end }}" + } + + webapp { + # This is shown in the top right corner of the web application + app-name = "Sharry" + + # The icon next to the app-name. Needs to be an URL to a image. + app-icon = "" + + # The login and register page displays a logo image, by default + # the Sharry logo. This can be changed here. It needs to be an URL + # to an image. + app-logo = "" + + # This is markdown that is inserted as the footer on each page in + # the ui. If left empty, a link to the project is rendered. + app-footer = "" + + # Whether to display the footer on each page in the ui. Set it to + # false to hide it. + app-footer-visible = true + + # Chunk size used for one request. The server will re-chunk the + # stream into smaller chunks. But the client can transfer more in + # one requests, resulting in faster uploads. + # + # You might need to adjust this value depending on your setup. A + # higher value usually means faster uploads. + chunk-size = "100M" + + # Number of milliseconds the client should wait before doing a new + # upload attempt after something failed. The length of the array + # denotes the number of retries. + retry-delays = [0, 3000, 6000, 12000, 24000, 48000] + + # The login page can display a welcome message that is readable by + # everyone. The text is processed as markdown. + welcome-message = "" + + } + + share { + # When storing binary data use chunks of this size. + chunk-size = "{{- if .Values.sharry.chunkSize }}{{ .Values.sharry.chunkSize }}{{ end }}" + + # Maximum size of a share. + max-size = "{{- if .Values.sharry.maxSize }}{{ .Values.sharry.maxSize }}{{ end }}" + + # Maximum validity for uploads + max-validity = {{- if .Values.sharry.maxValidity }}{{ .Values.sharry.maxValidity }}{{ end }} + } + + signup { + mode = "{{- if .Values.sharry.signup }}{{ .Values.sharry.signup }}{{ end }}" + invite-time = "3 days" + invite-password = "generate-invite" + } + } + + } \ No newline at end of file diff --git a/charts/sharry/values.yaml b/charts/sharry/values.yaml new file mode 100644 index 00000000..83cf54c1 --- /dev/null +++ b/charts/sharry/values.yaml @@ -0,0 +1,77 @@ +# Default values for sharry. + +image: + # -- sharry image + repository: eikek0/sharry + # -- sharry image tag + tag: 1.6.0 + # sharry image pull policy + pullPolicy: IfNotPresent + +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 + +service: + port: + # -- Kubernetes port where the GUI is exposed + port: 9090 + +args: +- "/opt/sharry.conf" + +sharry: + # -- This is the base URL this application is deployed to. + baseUrl: "http://localhost:9090" + # -- By default a H2 file-based database is configured. You can provide a postgresql or mariadb connection here. + jdbcUrl: "jdbc:h2://\"${java.io.tmpdir}\"/sharry-demo.db;MODE=PostgreSQL;DATABASE_TO_LOWER=TRUE" + # -- jdbc Username + jdbcUser: sa + # -- jdbc Password + jdbcPassword: "" + # -- When storing binary data use chunks of this size. + chunkSize: "512K" + # -- Maximum size of a share. + maxSize: "1.5G" + # -- Maximum validity for uploads. + maxValidity: "365 days" + # -- The mode defines if new users can signup or not. It can have three values : open, invite, closed + signup: "open" + +# -- Node labels for pod assignment of the GUI +nodeSelector: {} + +# -- Toleration labels for pod assignment of the GUI +tolerations: [] + +# -- Affinity settings for pod assignment of the GUI +affinity: {} + +# -- Pod annotations +podAnnotations: {} + +additionalVolumes: +- name: sharry-config + configMap: + name: sharry-config +additionalVolumeMounts: +- name: sharry-config + mountPath: /opt/sharry.conf + subPath: sharry.conf + +ingress: + enabled: false + annotations: + # -- Nginx client Body Buffer Size + nginx.ingress.kubernetes.io/client-body-buffer-size: "2048m" + # -- Nginx Proxy Body Size + nginx.ingress.kubernetes.io/proxy-body-size: "2048m" + nginx.ingress.kubernetes.io/proxy-buffering: "off"