From 73df77deca48ae3605db8abcca64cd6dbd9d84a6 Mon Sep 17 00:00:00 2001 From: Moritz Sanden Date: Tue, 18 Jul 2023 22:09:59 +0200 Subject: [PATCH 1/3] Make accessMode for volumes configurable in Samba Signed-off-by: Moritz Sanden --- charts/samba/README.md | 1 + charts/samba/templates/pvc.yaml | 2 +- charts/samba/values.yaml | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/samba/README.md b/charts/samba/README.md index 4d129cf..075f344 100644 --- a/charts/samba/README.md +++ b/charts/samba/README.md @@ -35,6 +35,7 @@ Refer to [dperson/samba](https://github.com/dperson/samba) on how to do this. | imagePullSecrets | list | `[]` | | | nameOverride | string | `""` | | | nodeSelector | object | `{}` | | +| persistence.accessMode | string | `"ReadWriteMany"` | Access mode for the PV | | persistence.annotations | object | `{}` | Additional annotations to add to the PVC | | persistence.enabled | bool | `false` | Whether a PVC shall be created | | persistence.mountPath | string | `"/data"` | | diff --git a/charts/samba/templates/pvc.yaml b/charts/samba/templates/pvc.yaml index 7898d87..7fe08c1 100644 --- a/charts/samba/templates/pvc.yaml +++ b/charts/samba/templates/pvc.yaml @@ -11,7 +11,7 @@ metadata: {{- end }} spec: accessModes: - - ReadWriteMany + - {{ .Values.persistence.accessMode }} resources: requests: storage: {{ .Values.persistence.size }} diff --git a/charts/samba/values.yaml b/charts/samba/values.yaml index 5e0ab74..0c99fb6 100644 --- a/charts/samba/values.yaml +++ b/charts/samba/values.yaml @@ -52,6 +52,8 @@ persistence: selector: {} # -- Storage Class name of the PV storageClass: "" + # -- Access mode for the PV + accessMode: ReadWriteMany # -- Additional annotations to add to the PVC annotations: {} From 3b218bd37ffad02cb63d836c2cce62cde0e9874d Mon Sep 17 00:00:00 2001 From: Moritz Sanden Date: Wed, 19 Jul 2023 22:58:22 +0200 Subject: [PATCH 2/3] Enable usage of existingSecret for Samba users Signed-off-by: Moritz Sanden --- charts/samba/README.md | 1 + charts/samba/templates/deployment.yaml | 4 ++-- charts/samba/templates/secret.yaml | 2 +- charts/samba/values.yaml | 3 +++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/charts/samba/README.md b/charts/samba/README.md index 075f344..b82bfb3 100644 --- a/charts/samba/README.md +++ b/charts/samba/README.md @@ -51,6 +51,7 @@ Refer to [dperson/samba](https://github.com/dperson/samba) on how to do this. | resources.requests.cpu | string | `"30m"` | | | resources.requests.memory | string | `"64Mi"` | | | samba.args | list | `[]` | Container args to pass | +| samba.existingSecretName | string | `""` | Name of an existing secret with USER env var(s). Refer to `templates/secret.yaml` for the format. | | samba.rawEnv | object | `{}` | A dict with KEY: VALUE entries to directly define environment variables. | | samba.shares | list | `[]` | A list of Samba shares. Convenience wrapper around SHARE env var(s). See [values.yaml](values.yaml) for an example. | | samba.users | list | `[]` | A list of users as a convenience wrapper around USER env var(s). See [values.yaml](values.yaml) for an example. | diff --git a/charts/samba/templates/deployment.yaml b/charts/samba/templates/deployment.yaml index 1c499af..92f8694 100644 --- a/charts/samba/templates/deployment.yaml +++ b/charts/samba/templates/deployment.yaml @@ -42,9 +42,9 @@ spec: - configMapRef: name: {{ include "samba.fullname" . }} {{- end }} - {{- if .Values.samba.users }} + {{- if or .Values.samba.users .Values.samba.existingSecretName }} - secretRef: - name: {{ include "samba.fullname" . }} + name: {{ .Values.samba.existingSecretName | default (include "samba.fullname" .) }} {{- end }} ports: - name: smb diff --git a/charts/samba/templates/secret.yaml b/charts/samba/templates/secret.yaml index 42d982a..65e02cc 100644 --- a/charts/samba/templates/secret.yaml +++ b/charts/samba/templates/secret.yaml @@ -1,4 +1,4 @@ -{{- if .Values.samba.users }} +{{- if and .Values.samba.users (not .Values.samba.existingSecretName) }} apiVersion: v1 kind: Secret metadata: diff --git a/charts/samba/values.yaml b/charts/samba/values.yaml index 0c99fb6..c01e639 100644 --- a/charts/samba/values.yaml +++ b/charts/samba/values.yaml @@ -16,6 +16,9 @@ samba: # group: smbusers # group name # gid: 1000 # group id + # -- Name of an existing secret with USER env var(s). Refer to `templates/secret.yaml` for the format. + existingSecretName: "" + # -- A list of Samba shares. Convenience wrapper around SHARE env var(s). See [values.yaml](values.yaml) for an example. shares: [] # - name: share # is how it's called for clients, REQUIRED From 5c4c6764fa35b6de3bf9e787d89522f7ba1dcae6 Mon Sep 17 00:00:00 2001 From: Moritz Sanden Date: Wed, 19 Jul 2023 23:06:39 +0200 Subject: [PATCH 3/3] Increment Samba chart version Signed-off-by: Moritz Sanden --- README.md | 2 +- charts/samba/Chart.yaml | 2 +- charts/samba/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 README.md diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 98487df..8c96cdf --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ | [![chart downloads](https://img.shields.io/github/downloads/ccremer/charts/emby-0.2.3/total)](https://github.com/ccremer/charts/releases/tag/emby-0.2.3) | [emby](charts/emby/README.md) | | [![chart downloads](https://img.shields.io/github/downloads/ccremer/charts/fronius-exporter-0.8.1/total)](https://github.com/ccremer/charts/releases/tag/fronius-exporter-0.8.1) | [fronius-exporter](charts/fronius-exporter/README.md) | | [![chart downloads](https://img.shields.io/github/downloads/ccremer/charts/fronius-stack-0.1.5/total)](https://github.com/ccremer/charts/releases/tag/fronius-stack-0.1.5) | [fronius-stack](charts/fronius-stack/README.md) | -| [![chart downloads](https://img.shields.io/github/downloads/ccremer/charts/samba-0.1.1/total)](https://github.com/ccremer/charts/releases/tag/samba-0.1.1) | [samba](charts/samba/README.md) | +| [![chart downloads](https://img.shields.io/github/downloads/ccremer/charts/samba-0.2.0/total)](https://github.com/ccremer/charts/releases/tag/samba-0.2.0) | [samba](charts/samba/README.md) | | [![chart downloads](https://img.shields.io/github/downloads/ccremer/charts/stiebeleltron-exporter-0.1.1/total)](https://github.com/ccremer/charts/releases/tag/stiebeleltron-exporter-0.1.1) | [stiebeleltron-exporter](charts/stiebeleltron-exporter/README.md) | | [![chart downloads](https://img.shields.io/github/downloads/ccremer/charts/stiebeleltron-stack-0.1.2/total)](https://github.com/ccremer/charts/releases/tag/stiebeleltron-stack-0.1.2) | [stiebeleltron-stack](charts/stiebeleltron-stack/README.md) | | [![chart downloads](https://img.shields.io/github/downloads/ccremer/charts/znapzend-0.5.4/total)](https://github.com/ccremer/charts/releases/tag/znapzend-0.5.4) | [znapzend](charts/znapzend/README.md) | diff --git a/charts/samba/Chart.yaml b/charts/samba/Chart.yaml index f2c4661..82bd9af 100644 --- a/charts/samba/Chart.yaml +++ b/charts/samba/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.1 +version: 0.2.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/samba/README.md b/charts/samba/README.md index b82bfb3..55b3137 100644 --- a/charts/samba/README.md +++ b/charts/samba/README.md @@ -1,6 +1,6 @@ # samba -![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) +![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) A Helm chart for Samba server