Skip to content

Commit

Permalink
Merge pull request #85 from irfanhakim-as/update-tpl
Browse files Browse the repository at this point in the history
Added new params to chart template
  • Loading branch information
irfanhakim-as authored Jul 13, 2024
2 parents 19f403d + 430b0f1 commit 42a758c
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions template/chartName/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"`. |
Expand Down
4 changes: 4 additions & 0 deletions template/chartName/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand All @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions template/chartName/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- $nodePort := .Values.service.nodePort | toString }}
{{- $port := .Values.service.port | default "80" | toString }}
{{- $type := .Values.service.type | default "ClusterIP" | toString }}
---
Expand All @@ -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:
Expand Down
21 changes: 21 additions & 0 deletions template/chartName/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,34 @@ 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
www: false

# 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:
Expand Down

0 comments on commit 42a758c

Please sign in to comment.