Skip to content

Commit

Permalink
Merge pull request #77 from irfanhakim-as/update-template
Browse files Browse the repository at this point in the history
Update template chart
  • Loading branch information
irfanhakim-as authored Jun 24, 2024
2 parents c8544d6 + b09f379 commit b64d0c5
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
2 changes: 2 additions & 0 deletions template/chartName/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"`. |
Expand Down
17 changes: 17 additions & 0 deletions template/chartName/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 }}
3 changes: 2 additions & 1 deletion template/chartName/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand All @@ -11,7 +12,7 @@ metadata:
{{- include "chartName.labels" . | nindent 4 }}
spec:
accessModes:
- ReadWriteMany
- {{ $dataAccessMode }}
resources:
requests:
storage: {{ $dataStorage }}
Expand Down
9 changes: 9 additions & 0 deletions template/chartName/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit b64d0c5

Please sign in to comment.