Skip to content

Commit

Permalink
Merge pull request #76 from irfanhakim-as/minor-update
Browse files Browse the repository at this point in the history
Minor improvements to template
  • Loading branch information
irfanhakim-as authored Jun 23, 2024
2 parents f6bccac + 4fdfa68 commit c8544d6
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 14 deletions.
6 changes: 4 additions & 2 deletions template/chartName/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ A Helm chart for deploying ChartName.
| chartName.bar | string | `""` | The secret value of the ChartName bar. Default: `"bar"`. |
| chartName.domain | string | `""` | The ingress domain name that hosts the ChartName server. |
| chartName.foo | string | `""` | The value of the ChartName foo. Default: `"foo"`. |
| chartName.initScript | string | `""` | Custom init script to run before the ChartName container starts. |
| image.chartName.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the ChartName container image. Default: `"IfNotPresent"`. |
| image.chartName.registry | string | `""` | The registry where the ChartName container image is hosted. Default: `"docker.io"`. |
| image.chartName.registry | string | `""` | The registry where the ChartName container image is hosted. Default: `"ghcr.io"`. |
| image.chartName.repository | string | `""` | The name of the repository that contains the ChartName container image used. Default: `"chartName"`. |
| image.chartName.tag | string | `""` | The tag that specifies the version of the ChartName container image used. Default: `Chart appVersion`. |
| image.init.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Init container image. Default: `"IfNotPresent"`. |
Expand All @@ -144,8 +145,9 @@ A Helm chart for deploying ChartName.
| ingress.enabled | bool | `false` | Specifies whether Ingress should be enabled for hosting ChartName services. |
| 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.enabled | bool | `true` | Specifies whether persistent storage should be provisioned for data storage. |
| 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"`. |
| storage.data.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the data storage. Default: `"longhorn"`. |
Expand Down
9 changes: 4 additions & 5 deletions template/chartName/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{{- $foo := .Values.chartName.foo | toString }}
{{- $bar := .Values.chartName.bar | toString }}
{{- $ingress := .Values.ingress.enabled }}
{{- $domain := .Values.chartName.domain | toString }}
ChartName is now installed and configured for {{ .Release.Name | toString }}.

Shown below are some of the values that were configured for this release:
Visit the following service to get started:

Foo: {{ $foo }}
Bar: {{ $bar }}
ChartName: {{ if $ingress }}https://{{ $domain }}{{- else }}Please refer to the {{ .Release.Name }}-chartName-svc service for the right address{{- end }}

For more information on how to use and configure ChartName, please refer to the official documentation.
8 changes: 5 additions & 3 deletions template/chartName/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- $dataPersistence := .Values.storage.data.enabled }}
{{- $chartName_registry := .Values.image.chartName.registry | default "docker.io" | toString }}
{{- $chartName_registry := .Values.image.chartName.registry | default "ghcr.io" | toString }}
{{- $chartName_repository := .Values.image.chartName.repository | default "chartName" | toString }}
{{- $chartName_tag := .Values.image.chartName.tag | default .Chart.AppVersion | toString }}
{{- $chartName_pullPolicy := .Values.image.chartName.pullPolicy | default "IfNotPresent" | toString | quote }}
Expand All @@ -10,6 +10,7 @@
{{- $replica_count := .Values.replicaCount | default "1" | toString }}
{{- $dataMountPath := .Values.storage.data.mountPath | default "/config" | toString | quote }}
{{- $dataSubPath := .Values.storage.data.subPath | toString }}
{{- $initScript := .Values.chartName.initScript | toString }}
---
apiVersion: apps/v1
kind: Deployment
Expand All @@ -35,6 +36,7 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if $initScript }}
initContainers:
- name: init
image: {{ printf "%s/%s:%s" $init_registry $init_repository $init_tag | quote }}
Expand All @@ -43,8 +45,7 @@ spec:
args:
- -c
- >-
mkdir -p /config/data &&
chmod -R 777 /config
{{- $initScript | nindent 14 }}
{{- if or $dataPersistence }}
volumeMounts:
{{- if $dataPersistence }}
Expand All @@ -55,6 +56,7 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- end }}
containers:
- name: chartName
image: {{ printf "%s/%s:%s" $chartName_registry $chartName_repository $chartName_tag | quote }}
Expand Down
3 changes: 2 additions & 1 deletion template/chartName/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- $port := .Values.service.port | default "80" | toString }}
{{- $type := .Values.service.type | default "ClusterIP" | toString }}
---
apiVersion: v1
Expand All @@ -9,7 +10,7 @@ metadata:
spec:
type: {{ $type }}
ports:
- port: 80
- port: {{ int $port }}
targetPort: chartName
protocol: TCP
name: chartName
Expand Down
19 changes: 16 additions & 3 deletions template/chartName/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ image:
# Source: https://github.com/irfanhakim-as/chartName/pkgs/container/chartName
chartName:
# The registry where the ChartName container image is hosted.
# Default: "docker.io"
# Default: "ghcr.io"
registry: ""
# The name of the repository that contains the ChartName container image used.
# Default: "chartName"
Expand Down Expand Up @@ -61,6 +61,12 @@ chartName:
# Example:
# foo: "foo"
foo: ""
# Custom init script to run before the ChartName container starts.
# Example:
# initScript: >-
# echo "Hello, World!"
# echo "This is a custom init script."
initScript: ""

# Ingress configurations.
ingress:
Expand All @@ -70,10 +76,17 @@ ingress:
enabled: false
# The name of the cluster issuer for Ingress.
# Default: "letsencrypt-dns-prod"
# Example:
# clusterIssuer: "letsencrypt-http-prod"
clusterIssuer: ""

# Service configurations.
service:
# The port on which the ChartName server should listen.
# Default: "80"
# Example:
# port: "8080"
port: ""
# The type of service used for ChartName services.
# Default: "ClusterIP"
# Example:
Expand All @@ -86,8 +99,8 @@ storage:
data:
# Specifies whether persistent storage should be provisioned for data storage.
# Example:
# enabled: false
enabled: true
# enabled: true
enabled: false
# The path where the data storage should be mounted on the container.
# Default: "/config"
# Example:
Expand Down

0 comments on commit c8544d6

Please sign in to comment.