Skip to content

Commit

Permalink
Merge pull request #68 from irfanhakim-as/syncthing
Browse files Browse the repository at this point in the history
Add Syncthing chart
  • Loading branch information
irfanhakim-as authored Mar 7, 2024
2 parents fb58a01 + ba66156 commit 5a7fe1d
Show file tree
Hide file tree
Showing 16 changed files with 823 additions and 15 deletions.
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@ Applications, developed or curated by [mika](https://github.com/irfanhakim-as),

| Chart Name | Description | Support | Access |
| ---------- | ----------- | ------- | ------ |
| [clog](https://github.com/irfanhakim-as/charts/tree/master/mika/clog) | Creative blog, Career blog, Coin blog, you name it. || 🔒 |
| [cloudflared](https://github.com/irfanhakim-as/charts/tree/master/mika/cloudflared) | Cloudflare Tunnel is a tunneling software that lets you quickly secure and encrypt application traffic to any type of infrastructure. |||
| [cloudflareddns](https://github.com/irfanhakim-as/charts/tree/master/mika/cloudflareddns) | Access your home network remotely via a custom domain name without a static IP! |||
| [flex](https://github.com/irfanhakim-as/charts/tree/master/mika/flex) | Flex is a collection of curated services that aims to provide a complete home media server solution. |||
| [grocy](https://github.com/irfanhakim-as/charts/tree/master/mika/grocy) | Grocy is a web-based self-hosted groceries & household management solution for your home. |||
| [kutt](https://github.com/irfanhakim-as/charts/tree/master/mika/kutt) | Kutt is a modern URL shortener with support for custom domains. Shorten URLs, manage your links and view the click rate statistics. |||
| [mango](https://github.com/irfanhakim-as/charts/tree/master/mika/mango) | Mango is an easy to use Mastodon bot framework built on top of Django. || 🔒 |
| [mariadb-agent](https://github.com/irfanhakim-as/charts/tree/master/mika/mariadb-agent) | Easily create or delete multiple pairs of databases and users in a remote MariaDB instance. |||
| [postgres](https://github.com/irfanhakim-as/charts/tree/master/mika/postgres) | Easy tool to deploy a PostgreSQL instance on Kubernetes. |||
| [postgres-agent](https://github.com/irfanhakim-as/charts/tree/master/mika/postgres-agent) | Easily create or delete a database and user pair in a remote PostgreSQL instance. |||
| [rizz](https://github.com/irfanhakim-as/charts/tree/master/mika/rizz) | Rizz is a simple web application that tracks and posts content from RSS Feeds to Mastodon. || 🔒 |
| [telego](https://github.com/irfanhakim-as/charts/tree/master/mika/telego) | Telego is an easy to use Telegram bot framework built on top of Django. || 🔒 |
| [vpbot](https://github.com/irfanhakim-as/charts/tree/master/mika/vpbot) | Vpbot is a Telegram bot with support for a number of useful features such as prayer time notifications, COVID-19 statistics, and more. || 🔒 |
| [waktusolat](https://github.com/irfanhakim-as/charts/tree/master/mika/waktusolat) | Waktu Solat is a simple web application that posts local prayer times on Mastodon. || 🔒 |
| [yuzu-multiplayer](https://github.com/irfanhakim-as/charts/tree/master/mika/yuzu-multiplayer) | Quickly stand up new dedicated multiplayer lobbies that will be broadcasted on yuzu. |||
| [clog](mika/clog) | Creative blog, Career blog, Coin blog, you name it. || 🔒 |
| [cloudflared](mika/cloudflared) | Cloudflare Tunnel is a tunneling software that lets you quickly secure and encrypt application traffic to any type of infrastructure. |||
| [cloudflareddns](mika/cloudflareddns) | Access your home network remotely via a custom domain name without a static IP! |||
| [flex](mika/flex) | Flex is a collection of curated services that aims to provide a complete home media server solution. |||
| [grocy](mika/grocy) | Grocy is a web-based self-hosted groceries & household management solution for your home. |||
| [kutt](mika/kutt) | Kutt is a modern URL shortener with support for custom domains. Shorten URLs, manage your links and view the click rate statistics. |||
| [mango](mika/mango) | Mango is an easy to use Mastodon bot framework built on top of Django. || 🔒 |
| [mariadb-agent](mika/mariadb-agent) | Easily create or delete multiple pairs of databases and users in a remote MariaDB instance. |||
| [postgres](mika/postgres) | Easy tool to deploy a PostgreSQL instance on Kubernetes. |||
| [postgres-agent](mika/postgres-agent) | Easily create or delete a database and user pair in a remote PostgreSQL instance. |||
| [rizz](mika/rizz) | Rizz is a simple web application that tracks and posts content from RSS Feeds to Mastodon. || 🔒 |
| [syncthing](mika/syncthing) | Syncthing is a continuous file synchronization program. It synchronizes files between two or more computers. |||
| [telego](mika/telego) | Telego is an easy to use Telegram bot framework built on top of Django. || 🔒 |
| [vpbot](mika/vpbot) | Vpbot is a Telegram bot with support for a number of useful features such as prayer time notifications, COVID-19 statistics, and more. || 🔒 |
| [waktusolat](mika/waktusolat) | Waktu Solat is a simple web application that posts local prayer times on Mastodon. || 🔒 |
| [yuzu-multiplayer](mika/yuzu-multiplayer) | Quickly stand up new dedicated multiplayer lobbies that will be broadcasted on yuzu. |||

---

Expand Down
Binary file added logos/syncthing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions mika/syncthing/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
18 changes: 18 additions & 0 deletions mika/syncthing/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v2
name: syncthing
description: Syncthing is a continuous file synchronization program. It synchronizes files between two or more computers.
type: application
version: 0.1.0
appVersion: "v1.27.3-ls131"
keywords:
- "syncthing"
home: "https://github.com/irfanhakim-as/charts"
icon: "https://irfanhakim-as.github.io/charts/logos/syncthing.png"
sources:
- "https://github.com/syncthing/syncthing"
- "https://github.com/linuxserver/docker-syncthing"
- "https://github.com/irfanhakim-as/charts"
maintainers:
- name: "Irfan Hakim"
email: "[email protected]"
url: "https://github.com/irfanhakim-as"
163 changes: 163 additions & 0 deletions mika/syncthing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# [Syncthing](https://github.com/syncthing/syncthing)

Syncthing is a continuous file synchronization program. It synchronizes files between two or more computers.

## Prerequisites

> [!NOTE]
> You may refer to [Orked](https://github.com/irfanhakim-as/orked) for help with setting up a Kubernetes cluster that meets all the following prerequisites.
- Kubernetes 1.19+
- Helm 3.2.0+
- Longhorn 1.4.1+
- csi-driver-smb 1.14.0+

---

## External dependencies

> [!IMPORTANT]
> The following items are required to be set up prior to installing this chart.
**This section does not apply to this chart.**

---

## Recommended configurations

> [!NOTE]
> The following configuration recommendations might not be the default settings for this chart but are **highly recommended**. Please carefully consider them before configuring your installation.
**This section does not apply to this chart.**

---

## Application configurations

> [!NOTE]
> The following configurations are expected or recommended to be set up from within the application after completing the installation.
**This section does not apply to this chart.**

---

## How to add the chart repo

1. Add the repo to your local helm client:

```sh
helm repo add mika https://irfanhakim-as.github.io/charts
```

2. Update the repo to retrieve the latest versions of the packages:

```sh
helm repo update
```

---

## How to install or upgrade a chart release

1. Get the values file of the Syncthing chart or an existing installation (release).

Get the latest Syncthing chart values file for a new installation:

```sh
helm show values mika/syncthing > values.yaml
```

Alternatively, get the values file of an existing Syncthing release:

```sh
helm get values ${releaseName} --namespace ${namespace} > values.yaml
```

Replace `${releaseName}` and `${namespace}` accordingly.

2. Edit your Syncthing values file with the intended configurations:

```sh
nano values.yaml
```

Pay extra attention to the descriptions and sample values provided in the chart values file.

3. Install a new release for Syncthing or upgrade an existing Syncthing release:

```sh
helm upgrade --install ${releaseName} mika/syncthing --namespace ${namespace} --create-namespace --values values.yaml --wait
```

Replace `${releaseName}` and `${namespace}` accordingly.

4. Verify that your Syncthing release has been installed:

```sh
helm ls --namespace ${namespace} | grep "${releaseName}"
```

Replace `${namespace}` and `${releaseName}` accordingly. This should return the release information if the release has been installed.

---

## How to uninstall a chart release

> [!CAUTION]
> Uninstalling a release will irreversibly delete all the resources associated with the release, including any persistent data.

1. Uninstall the desired release:

```sh
helm uninstall ${releaseName} --namespace ${namespace} --wait
```

Replace `${releaseName}` and `${namespace}` accordingly.

2. Verify that the release has been uninstalled:

```sh
helm ls --namespace ${namespace} | grep "${releaseName}"
```

Replace `${namespace}` and `${releaseName}` accordingly. This should return nothing if the release has been uninstalled.

---

## Chart configurations

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| image.syncthing.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Syncthing container image. Default: `"IfNotPresent"`. |
| image.syncthing.registry | string | `""` | The registry where the Syncthing container image is hosted. Default: `"lscr.io"`. |
| image.syncthing.repository | string | `""` | The name of the repository that contains the Syncthing container image used. Default: `"linuxserver/syncthing"`. |
| image.syncthing.tag | string | `""` | The tag that specifies the version of the Syncthing container image used. Default: `Chart appVersion`. |
| imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. |
| ingress.clusterIssuer | string | `""` | The name of the cluster issuer for Ingress. Default: `"letsencrypt-dns-prod"`. |
| ingress.enabled | bool | `false` | Specifies whether Ingress should be enabled for hosting Syncthing services. |
| replicaCount | string | `""` | The desired number of running replicas for Syncthing. Default: `"1"`. |
| resources.syncthing | object | `{}` | Syncthing container resources. |
| service.type | string | `""` | The type of service used for Syncthing services. Default: `"ClusterIP"`. |
| smb.enabled | bool | `false` | Specifies whether to enable persistent storage to be provisioned in the form of an SMB share. |
| smb.mountOptions | list | `[]` | The additional mount options used to mount the SMB share volume. |
| smb.pvStorage | string | `""` | The amount of persistent storage available on the SMB share volume. Default: `"100Gi"`. |
| smb.pvcStorage | string | `""` | The amount of persistent storage allocated for the SMB share storage. Default: `"1Gi"`. |
| smb.secretName | string | `""` | The name of the existing secret containing the credentials used to authenticate with the SMB share. Default: `"smbcreds"`. |
| smb.secretNamespace | string | `""` | The namespace where the secret containing the credentials used to authenticate with the SMB share is located. Default: `"default"`. |
| smb.share | string | `""` | The SMB share address and name to mount as a persistent volume. |
| smb.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the SMB share storage. Default: `"smb"`. |
| storage.config.enabled | bool | `true` | Specifies whether persistent storage should be provisioned for config storage. |
| storage.config.mountPath | string | `""` | The path where the config storage should be mounted on the container. Default: `"/config"`. |
| storage.config.storage | string | `""` | The default amount of persistent storage allocated for the config storage. Default: `"1Gi"`. |
| storage.config.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the config storage. Default: `"longhorn"`. |
| storage.config.subPath | string | `""` | The subpath within the config storage to mount to the container. Leave empty if not required. |
| storage.data.enabled | bool | `false` | Specifies whether persistent storage should be provisioned for data storage. |
| storage.data.mountPath | string | `""` | The path where the data storage should be mounted on the container. Default: `"/data"`. |
| storage.data.smb | bool | `false` | Specifies whether to use an SMB share for the data storage. |
| storage.data.storage | string | `""` | The default amount of persistent storage allocated for the data storage. Default: `"1Gi"`. |
| storage.data.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the data storage. Default: `"longhorn"`. |
| storage.data.subPath | string | `""` | The subpath within the data storage to mount to the container. Leave empty if not required. |
| syncthing.customConfigs | list | `[]` | Optional custom configurations to be mounted as a file inside the Syncthing container. |
| syncthing.domain | string | `""` | The ingress domain name that hosts the Syncthing server. |
| syncthing.gid | string | `""` | The group ID used to run the Syncthing containers. Default: `"1000"`. |
| syncthing.uid | string | `""` | The user ID used to run the Syncthing containers. Default: `"1000"`. |
10 changes: 10 additions & 0 deletions mika/syncthing/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- $ingress := .Values.ingress.enabled }}
{{- $syncthingIngress := .Values.syncthing.ingress }}
{{- $syncthingDomain := .Values.syncthing.domain | toString }}
Syncthing is now installed and configured for {{ .Release.Name | toString }}.

Visit the following service to get started:

Syncthing: {{ if and $ingress $syncthingIngress }}https://{{ $syncthingDomain }}{{- else }}Please refer to {{ .Release.Name }}-syncthing-svc for the right address{{- end }}

For more information on how to use and configure Syncthing, please refer to the official documentation.
62 changes: 62 additions & 0 deletions mika/syncthing/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "syncthing.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 "syncthing.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 "syncthing.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "syncthing.labels" -}}
helm.sh/chart: {{ include "syncthing.chart" . }}
{{ include "syncthing.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "syncthing.selectorLabels" -}}
app.kubernetes.io/name: {{ include "syncthing.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "syncthing.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "syncthing.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions mika/syncthing/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- $gid := .Values.syncthing.gid | default "1000" | toString | quote }}
{{- $uid := .Values.syncthing.uid | default "1000" | toString | quote }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-syncthing-cm
labels:
{{- include "syncthing.labels" . | nindent 4 }}
data:
PGID: {{ $gid }}
PUID: {{ $uid }}
Loading

0 comments on commit 5a7fe1d

Please sign in to comment.