diff --git a/template/chartName/README.md b/template/chartName/README.md index 070705a8..29fcae8e 100644 --- a/template/chartName/README.md +++ b/template/chartName/README.md @@ -143,10 +143,12 @@ A Helm chart for deploying ChartName. | 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 ChartName services. | +| ingress.www | bool | `false` | Specifies whether the WWW subdomain should be enabled. | | replicaCount | string | `""` | The desired number of running replicas for ChartName. Default: `"1"`. | | resources.chartName | object | `{}` | ChartName container resources. | | service.port | string | `""` | The port on which the ChartName server should listen. Default: `"80"`. | | service.type | string | `""` | The type of service used for ChartName services. Default: `"ClusterIP"`. | +| storage.data.accessMode | string | `""` | The access mode defining how the data storage can be mounted. Default: `"ReadWriteMany"`. | | 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: `"/config"`. | | storage.data.storage | string | `""` | The default amount of persistent storage allocated for the data storage. Default: `"1Gi"`. | diff --git a/template/chartName/templates/ingress.yaml b/template/chartName/templates/ingress.yaml index f05f9247..8527d50e 100644 --- a/template/chartName/templates/ingress.yaml +++ b/template/chartName/templates/ingress.yaml @@ -1,6 +1,8 @@ {{- $ingress := .Values.ingress.enabled }} +{{- $www := .Values.ingress.www }} {{- $clusterIssuer := .Values.ingress.clusterIssuer | default "letsencrypt-dns-prod" | toString | quote }} {{- $domain := .Values.chartName.domain | toString }} +{{- $wwwDomain := printf "www.%s" $domain | toString | quote }} {{- if and $ingress $domain }} --- apiVersion: networking.k8s.io/v1 @@ -32,8 +34,23 @@ spec: name: chartName path: / pathType: Prefix + {{- if $www }} + - host: {{ $wwwDomain }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-chartName-svc + port: + name: chartName + path: / + pathType: Prefix + {{- end }} tls: - hosts: - {{ $domain | quote }} + {{- if $www }} + - {{ $wwwDomain }} + {{- end }} secretName: {{ .Release.Name }}-chartName-tls-cert {{- end }} diff --git a/template/chartName/templates/pvc.yaml b/template/chartName/templates/pvc.yaml index 137d3050..bfd6773c 100644 --- a/template/chartName/templates/pvc.yaml +++ b/template/chartName/templates/pvc.yaml @@ -1,4 +1,5 @@ {{- $dataPersistence := .Values.storage.data.enabled }} +{{- $dataAccessMode := .Values.storage.data.accessMode | default "ReadWriteMany" | toString | quote }} {{- $dataStorage := .Values.storage.data.storage | default "1Gi" | toString | quote }} {{- $dataStorageClassName := .Values.storage.data.storageClassName | default "longhorn" | toString | quote }} {{- if $dataPersistence }} @@ -11,7 +12,7 @@ metadata: {{- include "chartName.labels" . | nindent 4 }} spec: accessModes: - - ReadWriteMany + - {{ $dataAccessMode }} resources: requests: storage: {{ $dataStorage }} diff --git a/template/chartName/values.yaml b/template/chartName/values.yaml index 1ca6ce1b..294a29cc 100644 --- a/template/chartName/values.yaml +++ b/template/chartName/values.yaml @@ -79,6 +79,10 @@ ingress: # Example: # clusterIssuer: "letsencrypt-http-prod" clusterIssuer: "" + # Specifies whether the WWW subdomain should be enabled. + # Example: + # www: true + www: false # Service configurations. service: @@ -101,6 +105,11 @@ storage: # Example: # enabled: true enabled: false + # The access mode defining how the data storage can be mounted. + # Default: "ReadWriteMany" + # Example: + # accessMode: "ReadWriteOnce" + accessMode: "" # The path where the data storage should be mounted on the container. # Default: "/config" # Example: