Skip to content

Commit

Permalink
added helm dir
Browse files Browse the repository at this point in the history
  • Loading branch information
alluen committed Apr 16, 2024
1 parent 59418ff commit b865c5d
Show file tree
Hide file tree
Showing 18 changed files with 1,313 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.6.0
with:
charts_dir: .
charts_dir: helm
mark_as_latest: true
packages_with_index: true
pages_branch: gh-pages
Expand Down
29 changes: 29 additions & 0 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v2
name: maildev
description: MailDev is a simple way to test your emails during development with an easy to use web interface.
type: application
version: 1.0.3
appVersion: "2.1.0"
home: https://github.com/alluen/maildev-helm
maintainers:
- name: chent1
email: chent1@ohio.edu
sources:
- https://maildev.github.io/maildev
- https://github.com/maildev/maildev
- https://hub.docker.com/r/maildev/maildev
annotations:
artifacthub.io/changes: |
- kind: changed
description: image version to 2.1.0
artifacthub.io/screenshots: |
- title: SMTP server & web interface for viewing and testing emails during development.
url: https://maildev.github.io/maildev/assets/img/original/maildev-light.png
- title: Resizable viewport to test your emails at different sizes.
url: https://maildev.github.io/maildev/assets/img/original/responsive.png
- title: View email HTML, plain text, headers or raw source.
url: https://maildev.github.io/maildev/assets/img/original/formats.png
- title: Convenient search feature to quickly find any email.
url: https://maildev.github.io/maildev/assets/img/original/search.png
- title: View your emails in an eye-friendly dark interface.
url: https://maildev.github.io/maildev/assets/img/original/maildev-dark.png
22 changes: 22 additions & 0 deletions helm/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.services.web.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "maildev.fullname" . }}-http)
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.services.web.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "maildev.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "maildev.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.services.web.port }}
{{- else if contains "ClusterIP" .Values.services.web.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "maildev.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
127 changes: 127 additions & 0 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "maildev.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "maildev.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "maildev.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "maildev.labels" -}}
helm.sh/chart: {{ include "maildev.chart" . }}
{{ include "maildev.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "maildev.selectorLabels" -}}
app.kubernetes.io/name: {{ include "maildev.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "maildev.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "maildev.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Get the name of the persistent volume claim
*/}}
{{- define "maildev.pvcName" -}}
{{- if .Values.maildev.persistence.existingClaim -}}
{{- printf "%s" (tpl .Values.maildev.persistence.existingClaim $) -}}
{{- else -}}
{{- printf "%s" (include "maildev.fullname" .) -}}
{{- end -}}
{{- end -}}

{{/*
Get the name of the secret containing the web user password
*/}}
{{- define "maildev.web.secretName" -}}
{{- if .Values.maildev.config.web.existingSecret -}}
{{- printf "%s" .Values.maildev.config.web.existingSecret -}}
{{- else -}}
{{- printf "%s" (include "maildev.fullname" .) -}}-web
{{- end -}}
{{- end -}}

{{/*
Get the name of the secret containing the password for the incoming SMTP traffic
*/}}
{{- define "maildev.smtp.incoming.secretName" -}}
{{- if .Values.maildev.config.smtp.incoming.existingSecret -}}
{{- printf "%s" .Values.maildev.config.smtp.incoming.existingSecret -}}
{{- else -}}
{{- printf "%s" (include "maildev.fullname" .) -}}-smtp-incoming
{{- end -}}
{{- end -}}

{{/*
Get the name of the secret containing the password for the outgoing SMTP traffic
*/}}
{{- define "maildev.smtp.outgoing.secretName" -}}
{{- if .Values.maildev.config.smtp.outgoing.existingSecret -}}
{{- printf "%s" .Values.maildev.config.smtp.outgoing.existingSecret -}}
{{- else -}}
{{- printf "%s" (include "maildev.fullname" .) -}}-smtp-outgoing
{{- end -}}
{{- end -}}

{{/*
Get the name of the configmap containing the relay rules for the SMTP traffic
*/}}
{{- define "maildev.smtp.outgoing.autoRelay.configMapName" -}}
{{- printf "%s" (include "maildev.fullname" .) -}}-smtp-relay-rules
{{- end -}}

{{/*
Get the name of the service for the SMTP traffic
*/}}
{{- define "maildev.smtp.serviceName" -}}
{{- printf "%s" (include "maildev.fullname" .) -}}-smtp
{{- end -}}

{{/*
Get the name of the service for the Web GUI
*/}}
{{- define "maildev.web.serviceName" -}}
{{- printf "%s" (include "maildev.fullname" .) -}}-web
{{- end -}}
Loading

0 comments on commit b865c5d

Please sign in to comment.