From 1c55f85a8e447f1cb44cb92158677c448d7f79f9 Mon Sep 17 00:00:00 2001 From: Adam Rush Date: Fri, 11 Sep 2020 07:11:03 +0100 Subject: [PATCH 1/2] Added storageClass helper --- charts/sonatype-nexus/templates/_helpers.tpl | 13 +++++++++++++ charts/sonatype-nexus/templates/statefulset.yaml | 3 +-- charts/sonatype-nexus/values.yaml | 14 +++++++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/charts/sonatype-nexus/templates/_helpers.tpl b/charts/sonatype-nexus/templates/_helpers.tpl index f5d9f23..001b338 100644 --- a/charts/sonatype-nexus/templates/_helpers.tpl +++ b/charts/sonatype-nexus/templates/_helpers.tpl @@ -60,3 +60,16 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* +Return the proper Storage Class +*/}} +{{- define "nexus.storageClass" -}} +{{- if .Values.nexus.storageClass -}} + {{- if (eq "-" .Values.nexus.storageClass) -}} + {{- printf "storageClassName: \"\"" -}} + {{- else }} + {{- printf "storageClassName: %s" .Values.nexus.storageClass -}} + {{- end -}} +{{- end -}} +{{- end }} diff --git a/charts/sonatype-nexus/templates/statefulset.yaml b/charts/sonatype-nexus/templates/statefulset.yaml index 19e2b76..24751ad 100644 --- a/charts/sonatype-nexus/templates/statefulset.yaml +++ b/charts/sonatype-nexus/templates/statefulset.yaml @@ -77,8 +77,7 @@ spec: name: {{ template "sonatype-nexus.fullname" . }}-data spec: accessModes: [ "ReadWriteOnce" ] - # GitHub Action helm/kind-action uses: storageClassName: "standard" - # storageClassName: "" + {{ include "nexus.storageClass" . }} resources: requests: # minimum is 4Gi, but 8Gi recommended during testing diff --git a/charts/sonatype-nexus/values.yaml b/charts/sonatype-nexus/values.yaml index ed564e8..9b42e5f 100644 --- a/charts/sonatype-nexus/values.yaml +++ b/charts/sonatype-nexus/values.yaml @@ -4,13 +4,25 @@ nexus: baseDomain: domain.com + # certEmail is a valid email address used by Let's Encrypt. It does not have to be at the baseDomain. certEmail: certadmin@domain.com - storageSize: 8Gi + # The ports should only be changed if the nexus image uses a different port dockerPort: 5000 nexusPort: 8081 + storageSize: 8Gi + ## 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) + ## + # GitHub Action helm/kind-action uses: storageClassName: "standard" + # storageClass: "standard" + + # https://hub.docker.com/r/sonatype/nexus3/tags image: repository: sonatype/nexus3 From 88a40b72979e6938c6edf1d76beb458fb38086bf Mon Sep 17 00:00:00 2001 From: Adam Rush Date: Fri, 11 Sep 2020 07:16:49 +0100 Subject: [PATCH 2/2] Bumped chart to v0.2.6 --- charts/sonatype-nexus/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/sonatype-nexus/Chart.yaml b/charts/sonatype-nexus/Chart.yaml index cf348b1..1369222 100644 --- a/charts/sonatype-nexus/Chart.yaml +++ b/charts/sonatype-nexus/Chart.yaml @@ -3,7 +3,7 @@ name: sonatype-nexus description: Sonatype Nexus is an open source repository manager type: application # This is the chart version -version: 0.2.5 +version: 0.2.6 # This is the version number of the application being deployed appVersion: 3.27.0 keywords: