diff --git a/template/chartName/README.md b/template/chartName/README.md index 29fcae8e..318e3346 100644 --- a/template/chartName/README.md +++ b/template/chartName/README.md @@ -142,10 +142,12 @@ A Helm chart for deploying ChartName. | image.init.tag | string | `""` | The tag that specifies the version of the Init container image used. Default: `"1.36.1"`. | | 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.customAnnotations | list | `[]` | Additional configuration annotations to be added to the Ingress resource. | | 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.nodePort | string | `""` | The optional node port to expose when the service type is NodePort. | | 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"`. | diff --git a/template/chartName/templates/ingress.yaml b/template/chartName/templates/ingress.yaml index 8527d50e..945267d7 100644 --- a/template/chartName/templates/ingress.yaml +++ b/template/chartName/templates/ingress.yaml @@ -1,6 +1,7 @@ {{- $ingress := .Values.ingress.enabled }} {{- $www := .Values.ingress.www }} {{- $clusterIssuer := .Values.ingress.clusterIssuer | default "letsencrypt-dns-prod" | toString | quote }} +{{- $customAnnotations := .Values.ingress.customAnnotations }} {{- $domain := .Values.chartName.domain | toString }} {{- $wwwDomain := printf "www.%s" $domain | toString | quote }} {{- if and $ingress $domain }} @@ -21,6 +22,9 @@ metadata: nginx.ingress.kubernetes.io/session-cookie-max-age: "172800" nginx.ingress.kubernetes.io/session-cookie-name: "route" nginx.org/client-max-body-size: "100m" + {{- range $customAnnotations }} + {{ printf "%s/%s" (.prefix | default "nginx.ingress.kubernetes.io") .name }}: {{ .value | quote }} + {{- end }} spec: ingressClassName: "nginx" rules: diff --git a/template/chartName/templates/service.yaml b/template/chartName/templates/service.yaml index d5cb4e27..4a57796d 100644 --- a/template/chartName/templates/service.yaml +++ b/template/chartName/templates/service.yaml @@ -1,3 +1,4 @@ +{{- $nodePort := .Values.service.nodePort | toString }} {{- $port := .Values.service.port | default "80" | toString }} {{- $type := .Values.service.type | default "ClusterIP" | toString }} --- @@ -12,6 +13,9 @@ spec: ports: - port: {{ int $port }} targetPort: chartName + {{- if and (eq $type "NodePort") $nodePort }} + nodePort: {{ int $nodePort }} + {{- end }} protocol: TCP name: chartName selector: diff --git a/template/chartName/values.yaml b/template/chartName/values.yaml index 294a29cc..6c2bc63b 100644 --- a/template/chartName/values.yaml +++ b/template/chartName/values.yaml @@ -79,6 +79,23 @@ ingress: # Example: # clusterIssuer: "letsencrypt-http-prod" clusterIssuer: "" + # Additional configuration annotations to be added to the Ingress resource. + # Example: + # customAnnotations: + # # The prefix of the annotation. + # # Default: "nginx.ingress.kubernetes.io" + # # Example: + # # - prefix: "nginx.org" + # - prefix: "" + # # The name of the annotation. + # # Example: + # # name: "proxy-connect-timeout" + # name: "" + # # The value of the annotation. + # # Example: + # # value: "120" + # value: "" + customAnnotations: [] # Specifies whether the WWW subdomain should be enabled. # Example: # www: true @@ -86,6 +103,10 @@ ingress: # Service configurations. service: + # The optional node port to expose when the service type is NodePort. + # Example: + # nodePort: "32000" + nodePort: "" # The port on which the ChartName server should listen. # Default: "80" # Example: