From 940de05d13b9595af699b10a9eb71ef01286fbc6 Mon Sep 17 00:00:00 2001 From: bp99 Date: Sun, 8 Sep 2024 18:38:02 +0200 Subject: [PATCH] chart-seafile: add --- .gitignore | 1 + charts/seafile/.helmignore | 23 +++ charts/seafile/Chart.lock | 9 + charts/seafile/Chart.yaml | 27 +++ charts/seafile/README.md | 86 +++++++++ charts/seafile/templates/NOTES.txt | 22 +++ charts/seafile/templates/_helpers.tpl | 72 ++++++++ charts/seafile/templates/deployment.yaml | 83 +++++++++ charts/seafile/templates/hpa.yaml | 32 ++++ charts/seafile/templates/ingress.yaml | 61 +++++++ charts/seafile/templates/pvc.yaml | 27 +++ charts/seafile/templates/service.yaml | 16 ++ charts/seafile/templates/serviceaccount.yaml | 14 ++ .../templates/tests/test-connection.yaml | 15 ++ charts/seafile/values.yaml | 163 ++++++++++++++++++ 15 files changed, 651 insertions(+) create mode 100644 .gitignore create mode 100644 charts/seafile/.helmignore create mode 100644 charts/seafile/Chart.lock create mode 100644 charts/seafile/Chart.yaml create mode 100644 charts/seafile/README.md create mode 100644 charts/seafile/templates/NOTES.txt create mode 100644 charts/seafile/templates/_helpers.tpl create mode 100644 charts/seafile/templates/deployment.yaml create mode 100644 charts/seafile/templates/hpa.yaml create mode 100644 charts/seafile/templates/ingress.yaml create mode 100644 charts/seafile/templates/pvc.yaml create mode 100644 charts/seafile/templates/service.yaml create mode 100644 charts/seafile/templates/serviceaccount.yaml create mode 100644 charts/seafile/templates/tests/test-connection.yaml create mode 100644 charts/seafile/values.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..37be15b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +charts/*/charts/ diff --git a/charts/seafile/.helmignore b/charts/seafile/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/seafile/.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/charts/seafile/Chart.lock b/charts/seafile/Chart.lock new file mode 100644 index 0000000..66b8597 --- /dev/null +++ b/charts/seafile/Chart.lock @@ -0,0 +1,9 @@ +dependencies: +- name: mariadb + repository: oci://registry-1.docker.io/bitnamicharts + version: 19.0.5 +- name: memcached + repository: oci://registry-1.docker.io/bitnamicharts + version: 7.4.12 +digest: sha256:c789ded21a78e56ce163b1f02b63aa54b0f8fee1c15363aa96a8ff24131e17b7 +generated: "2024-09-08T18:15:15.839569423+02:00" diff --git a/charts/seafile/Chart.yaml b/charts/seafile/Chart.yaml new file mode 100644 index 0000000..7bf956e --- /dev/null +++ b/charts/seafile/Chart.yaml @@ -0,0 +1,27 @@ +--- +apiVersion: v2 +name: seafile +description: > + An open-source, cross-platform file-hosting software system. +home: https://www.seafile.com/en/home/ +icon: https://www.seafile.com/media/img/seafile-logo.png +type: application +version: 0.1.0 +appVersion: 11.0.12 + +dependencies: + - name: mariadb + version: 19.0.5 + repository: oci://registry-1.docker.io/bitnamicharts + condition: mariadb.enabled + - name: memcached + version: 7.4.12 + repository: oci://registry-1.docker.io/bitnamicharts + condition: memcached.enabled + +sources: [https://github.com/haiwen/seafile] + +maintainers: + - name: Bertalan Zoltán Péter + email: bertalan.peter@bp99.eu + url: https://bp99.eu/ diff --git a/charts/seafile/README.md b/charts/seafile/README.md new file mode 100644 index 0000000..0f29dff --- /dev/null +++ b/charts/seafile/README.md @@ -0,0 +1,86 @@ +# seafile + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 11.0.12](https://img.shields.io/badge/AppVersion-11.0.12-informational?style=flat-square) + +An open-source, cross-platform file-hosting software system. + +**Homepage:** + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Bertalan Zoltán Péter | | | + +## Source Code + +* + +## Requirements + +| Repository | Name | Version | +|------------|------|---------| +| oci://registry-1.docker.io/bitnamicharts | mariadb | 19.0.5 | +| oci://registry-1.docker.io/bitnamicharts | memcached | 7.4.12 | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | affinity | +| autoscaling | object | `{"enabled":false,"maxReplicas":100,"minReplicas":1,"targetCPUUtilizationPercentage":80}` | autoscaling settings | +| autoscaling.enabled | boolean | `false` | whether autoscaling should be enabled | +| autoscaling.maxReplicas | int | `100` | maximum number of replicas | +| autoscaling.minReplicas | int | `1` | minimum number of replicas | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | try to utilize this much CPU [%] | +| fullnameOverride | string | `""` | override the fullname of the entire chart | +| global | object | `{"storageClass":""}` | global settings | +| global.storageClass | string | `""` | global storage class for PVCs | +| image | object | `{"pullPolicy":"IfNotPresent","repository":"seafileltd/seafile-mc","tag":""}` | seafile image configuration | +| image.pullPolicy | string | `"IfNotPresent"` | when to pull the image | +| image.repository | string | `"seafileltd/seafile-mc"` | what seafile image to use | +| image.tag | string | `""` | override image tag; default is the chart appVersion | +| imagePullSecrets | list | `[]` | secrets used to pull the image | +| ingress | object | `{"annotations":{},"className":"","enabled":false,"hosts":[{"host":"chart-example.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}],"tls":[]}` | ingress setup | +| ingress.annotations | object | `{}` | additional ingress annotations | +| ingress.className | string | `""` | override ingress class name | +| ingress.enabled | boolean | `false` | whether an ingress should be generated | +| ingress.hosts | list | `[{"host":"chart-example.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}]` | ingress hosts | +| ingress.tls | list | `[]` | TLS setup | +| livenessProbe.httpGet.path | string | `"/"` | | +| livenessProbe.httpGet.port | string | `"http"` | | +| mariadb | object | `{"auth":{"rootPassword":"changeme"},"persistence":{"enabled":true,"size":"1Gi","storageClass":""}}` | mariadb subchart configuration | +| mariadb.auth | object | `{"rootPassword":"changeme"}` | auth settings | +| mariadb.auth.rootPassword | string | `"changeme"` | root user password; DO NOT FORGET TO CHANGE THIS VALUE | +| mariadb.persistence | object | `{"enabled":true,"size":"1Gi","storageClass":""}` | DB persistence settings | +| memcached | object | `{"extraEnvVars":[{"name":"MEMCACHED_CACHE_SIZE","value":"256M"}]}` | memcached subchart configuration | +| nameOverride | string | `""` | override the name of the entire chart | +| nodeSelector | object | `{}` | node selectors | +| persistence | object | `{"accessModes":["ReadWriteOnce"],"annotations":{},"create":true,"enabled":true,"labels":{},"size":"16Gi","storageClass":""}` | persistence settings | +| persistence.accessModes | list | `["ReadWriteOnce"]` | PVC access modes | +| persistence.annotations | object | `{}` | additional PVC annotations | +| persistence.create | boolean | `true` | whether to create PVCs | +| persistence.enabled | boolean | `true` | whether to handle persistence at all | +| persistence.labels | object | `{}` | additional PVC labels | +| persistence.size | string | `"16Gi"` | limit PVC size | +| persistence.storageClass | string | `""` | override PVC storage class | +| podAnnotations | object | `{}` | additional pod annotations | +| podLabels | object | `{}` | additional pod labels | +| podSecurityContext | object | `{}` | custom pod security context | +| readinessProbe.httpGet.path | string | `"/"` | | +| readinessProbe.httpGet.port | string | `"http"` | | +| replicaCount | int | `1` | number of seafile replicas to run (only tested with 1) | +| resources | object | `{}` | custom resources | +| seafile | object | `{"admin_email":"admin@hostname.tld","admin_password":"changeme2","timezone":"Europe/Berlin"}` | seafile app configuration | +| seafile.admin_email | string | `"admin@hostname.tld"` | email address of the admin user | +| seafile.admin_password | string | `"changeme2"` | password of the admin user; DO NOT FORGET TO CHANGE THIS VALUE | +| seafile.timezone | string | `"Europe/Berlin"` | [TZ identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) | +| securityContext | object | `{}` | custom security context | +| service | object | `{"port":80,"type":"ClusterIP"}` | service setup | +| service.port | int | `80` | service port | +| service.type | string | `"ClusterIP"` | service type | +| serviceAccount.annotations | object | `{}` | service account annotations | +| serviceAccount.create | boolean | `false` | whether a service account should be created | +| serviceAccount.name | string | `""` | the name of the service account to use; if unset and create is true, a name is generated using the fullname template | +| tolerations | list | `[]` | tolerations | + diff --git a/charts/seafile/templates/NOTES.txt b/charts/seafile/templates/NOTES.txt new file mode 100644 index 0000000..c61e25b --- /dev/null +++ b/charts/seafile/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 "seafile.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 its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "seafile.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "seafile.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "seafile.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/charts/seafile/templates/_helpers.tpl b/charts/seafile/templates/_helpers.tpl new file mode 100644 index 0000000..d4f36d0 --- /dev/null +++ b/charts/seafile/templates/_helpers.tpl @@ -0,0 +1,72 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "seafile.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 "seafile.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 "seafile.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "seafile.labels" -}} +helm.sh/chart: {{ include "seafile.chart" . }} +{{ include "seafile.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "seafile.selectorLabels" -}} +app.kubernetes.io/name: {{ include "seafile.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "seafile.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "seafile.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{/* +Storage Class +*/}} +{{- define "seafile.persistence.storageClass" -}} +{{- $storageClass := (tpl ( default "" .Values.persistence.storageClass) .) | default (tpl ( default "" .Values.global.storageClass) .) }} +{{- if $storageClass }} +storageClassName: {{ $storageClass | quote }} +{{- end }} +{{- end -}} diff --git a/charts/seafile/templates/deployment.yaml b/charts/seafile/templates/deployment.yaml new file mode 100644 index 0000000..546d883 --- /dev/null +++ b/charts/seafile/templates/deployment.yaml @@ -0,0 +1,83 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "seafile.fullname" . }} + labels: + {{- include "seafile.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "seafile.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "seafile.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "seafile.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 }} + env: + - name: DB_HOST + value: {{ template "mariadb.primary.fullname" .Subcharts.mariadb }} + - name: DB_ROOT_PASSWD + value: {{ .Values.mariadb.auth.rootPassword }} + - name: TIME_ZONE + value: {{ .Values.seafile.timezone }} + - name: SEAFILE_ADMIN_EMAIL + value: {{ .Values.seafile.admin_email }} + - name: SEAFILE_ADMIN_PASSWORD + value: {{ .Values.seafile.admin_password }} + - name: SEAFILE_SERVER_LETSENCRYPT + value: 'false' + - name: SEAFILE_SERVER_HOSTNAME + value: seafile + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: {{ include "seafile.fullname" . }}-volume + mountPath: /shared + volumes: + - name: {{ include "seafile.fullname" . }}-volume + persistentVolumeClaim: + claimName: {{ include "seafile.fullname" . }}-claim + {{- 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/charts/seafile/templates/hpa.yaml b/charts/seafile/templates/hpa.yaml new file mode 100644 index 0000000..df75845 --- /dev/null +++ b/charts/seafile/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "seafile.fullname" . }} + labels: + {{- include "seafile.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "seafile.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/charts/seafile/templates/ingress.yaml b/charts/seafile/templates/ingress.yaml new file mode 100644 index 0000000..279ea62 --- /dev/null +++ b/charts/seafile/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "seafile.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 "seafile.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/charts/seafile/templates/pvc.yaml b/charts/seafile/templates/pvc.yaml new file mode 100644 index 0000000..817fc29 --- /dev/null +++ b/charts/seafile/templates/pvc.yaml @@ -0,0 +1,27 @@ +{{- if and .Values.persistence.enabled .Values.persistence.create }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "seafile.fullname" . }}-claim + namespace: {{ $.Release.Namespace }} + annotations: +{{ .Values.persistence.annotations | toYaml | indent 4}} + labels: +{{ .Values.persistence.labels | toYaml | indent 4}} +spec: + accessModes: + {{- if gt .Values.replicaCount 1.0 }} + - ReadWriteMany + {{- else }} + {{- .Values.persistence.accessModes | toYaml | nindent 4 }} + {{- end }} + volumeMode: Filesystem + {{- include "seafile.persistence.storageClass" . | nindent 2 }} + {{- with .Values.persistence.volumeName }} + volumeName: {{ . }} + {{- end }} + resources: + requests: + storage: {{ .Values.persistence.size }} +{{- end }} diff --git a/charts/seafile/templates/service.yaml b/charts/seafile/templates/service.yaml new file mode 100644 index 0000000..ba064ce --- /dev/null +++ b/charts/seafile/templates/service.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "seafile.fullname" . }} + labels: + {{- include "seafile.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - name: http + port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + selector: + {{- include "seafile.selectorLabels" . | nindent 4 }} diff --git a/charts/seafile/templates/serviceaccount.yaml b/charts/seafile/templates/serviceaccount.yaml new file mode 100644 index 0000000..952e1d6 --- /dev/null +++ b/charts/seafile/templates/serviceaccount.yaml @@ -0,0 +1,14 @@ +{{- if .Values.serviceAccount.create -}} +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "seafile.serviceAccountName" . }} + labels: + {{- include "seafile.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/charts/seafile/templates/tests/test-connection.yaml b/charts/seafile/templates/tests/test-connection.yaml new file mode 100644 index 0000000..9035d9e --- /dev/null +++ b/charts/seafile/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "seafile.fullname" . }}-test-connection" + labels: + {{- include "seafile.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "seafile.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/charts/seafile/values.yaml b/charts/seafile/values.yaml new file mode 100644 index 0000000..17f25ae --- /dev/null +++ b/charts/seafile/values.yaml @@ -0,0 +1,163 @@ +--- +# -- (int) number of seafile replicas to run (only tested with 1) +replicaCount: 1 + +# -- global settings +global: + # -- global storage class for PVCs + storageClass: '' + +# -- seafile image configuration +image: + # -- what seafile image to use + repository: seafileltd/seafile-mc + # -- when to pull the image + pullPolicy: IfNotPresent + # -- override image tag; default is the chart appVersion + tag: '' + +# -- secrets used to pull the image +imagePullSecrets: [] +# -- override the name of the entire chart +nameOverride: '' +# -- override the fullname of the entire chart +fullnameOverride: '' + +serviceAccount: + # -- (boolean) whether a service account should be created + create: false + # -- service account annotations + annotations: {} + # -- the name of the service account to use; if unset and create is true, a name is generated using the fullname template + name: '' + +# -- additional pod annotations +podAnnotations: {} +# -- additional pod labels +podLabels: {} + +# -- custom pod security context +podSecurityContext: {} + # fsGroup: 2000 + +# -- custom security context +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +# -- service setup +service: + # -- service type + type: ClusterIP + # -- (int) service port + port: 80 + +# -- ingress setup +ingress: + # -- (boolean) whether an ingress should be generated + enabled: false + # -- override ingress class name + className: '' + # -- additional ingress annotations + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + # -- ingress hosts + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + # -- TLS setup + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +# -- custom resources +resources: {} + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +livenessProbe: + httpGet: + path: / + port: http + +readinessProbe: + httpGet: + path: / + port: http + +# -- autoscaling settings +autoscaling: + # -- (boolean) whether autoscaling should be enabled + enabled: false + # -- (int) minimum number of replicas + minReplicas: 1 + # -- (int) maximum number of replicas + maxReplicas: 100 + # -- (int) try to utilize this much CPU [%] + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +# -- persistence settings +persistence: + # -- (boolean) whether to handle persistence at all + enabled: true + # -- (boolean) whether to create PVCs + create: true + # -- additional PVC annotations + annotations: {} + # -- additional PVC labels + labels: {} + # -- PVC access modes + accessModes: [ReadWriteOnce] + # -- override PVC storage class + storageClass: '' + # -- limit PVC size + size: 16Gi + +# -- node selectors +nodeSelector: {} + +# -- tolerations +tolerations: [] + +# -- affinity +affinity: {} + +# -- seafile app configuration +seafile: + # -- [TZ identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) + timezone: Europe/Berlin + # -- email address of the admin user + admin_email: admin@hostname.tld + # -- password of the admin user; DO NOT FORGET TO CHANGE THIS VALUE + admin_password: changeme2 + +# -- mariadb subchart configuration +mariadb: + # -- auth settings + auth: + # -- root user password; DO NOT FORGET TO CHANGE THIS VALUE + rootPassword: changeme + # -- DB persistence settings + persistence: + enabled: true + storageClass: '' + size: 1Gi + +# -- memcached subchart configuration +memcached: + extraEnvVars: + - name: MEMCACHED_CACHE_SIZE + value: 256M