diff --git a/stable/inbucket/.helmignore b/stable/inbucket/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/stable/inbucket/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/stable/inbucket/Chart.yaml b/stable/inbucket/Chart.yaml new file mode 100644 index 0000000000..4d5fdfb52d --- /dev/null +++ b/stable/inbucket/Chart.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +description: Inbucket is an email testing application +name: inbucket +appVersion: 1.2.0 +version: 1.0.0 +keywords: + - inbucket + - mail + - smtp + - pop3 + - email + - testing + - disposable webmail +home: https://www.inbucket.org/ +sources: + - https://github.com/jhillyerd/inbucket +maintainers: + - name: cpanato + email: ctadeu@gmail.com + - name: jhillyerd + email: github@hillyerd.com diff --git a/stable/inbucket/README.md b/stable/inbucket/README.md new file mode 100644 index 0000000000..6d16e79c35 --- /dev/null +++ b/stable/inbucket/README.md @@ -0,0 +1,90 @@ +# Inbucket + +[Inbucket](https://www.inbucket.org/) is an e-mail testing tool. + +## TL;DR; + +```bash +$ helm install stable/inbucket +``` + +## Introduction + +This chart creates a [Inbucket](https://www.inbucket.org/) deployment on a [Kubernetes](http://kubernetes.io) +cluster using the [Helm](https://helm.sh) package manager. + +## Prerequisites + +- Kubernetes 1.8+ with Beta APIs enabled + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```bash +$ helm install --name my-release stable/inbucket +``` + +The command deploys Inbucket on the Kubernetes cluster in the default configuration. The [configuration](#configuration) +section lists the parameters that can be configured during installation. + +## Uninstalling the Chart + +To uninstall/delete the `my-release` deployment: + +```bash +$ helm delete my-release +``` +The command removes all the Kubernetes components associated with the chart and deletes the release. + +## Configuration + +The following table lists the configurable parameters of the Inbucket chart and their default values. + +Parameter | Description | Default +--- | --- | --- +`image.repository` | container image repository | `jhillyerd/inbucket` +`image.tag` | container image tag | `release-1.2.0` +`image.pullPolicy` | container image pull policy | `IfNotPresent` +`nodeSelector` | node labels for pod assignment | `{}` +`podAnnotations` | annotations to be added to pods | `{}` +`resources` | pod resource requests & limits | `{}` +`service.annotations` | annotations for the service | `{}` +`service.clusterIP` | internal cluster service IP | `""` +`service.externalIPs` | service external IP addresses | `[]` +`service.loadBalancerIP` | IP address to assign to load balancer (if supported) | `""` +`service.loadBalancerSourceRanges` | list of IP CIDRs allowed access to load balancer (if supported) | `[]` +`service.type` | type of service to create | `ClusterIP` +`service.node.http` | http port of service | `""` +`service.node.smtp` | smtp port of service | `""` +`service.node.pop3` | pop3 port of service | `""` +`service.nodePort.http` | if `service.type` is `NodePort` and this is non-empty, sets the http node port of the service | `""` +`service.nodePort.smtp` | if `service.type` is `NodePort` and this is non-empty, sets the smtp node port of the service | `""` +`service.nodePort.pop3` | if `service.type` is `NodePort` and this is non-empty, sets the pop3 node port of the service | `""` +`ingress.enabled` | if `true`, an ingress is created | `false` +`ingress.annotations` | annotations for the ingress | `{}` +`ingress.path` | if `true`, an ingress is created | `/` +`ingress.hosts` | a list of ingress hosts | `[inbucket.example.com]` +`ingress.tls` | a list of [IngressTLS](https://v1-8.docs.kubernetes.io/docs/api-reference/v1.8/#ingresstls-v1beta1-extensions) items | `[]` + + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, + +```bash +$ helm install --name my-release \ + --set image.tag=release-1.2.0 \ + stable/inbucket +``` + +Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, + +```bash +$ helm install --name my-release -f values.yaml stable/inbucket +``` + +## Limitations + + +## Thanks + +This chart was inspired in the Mailhog tool, which is another testing email tool, for more [Mailhog](https://github.com/kubernetes/charts/tree/master/stable/mailhog). diff --git a/stable/inbucket/templates/NOTES.txt b/stable/inbucket/templates/NOTES.txt new file mode 100644 index 0000000000..992883ea76 --- /dev/null +++ b/stable/inbucket/templates/NOTES.txt @@ -0,0 +1,22 @@ +Inbucket can be accessed via ports {{ .Values.service.port.http }} (HTTP) and {{ .Values.service.port.smtp }} (SMTP) on the following DNS name from within your cluster: +{{ template "inbucket.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local + +If you'd like to test your instance, forward the ports locally: + +Web UI: +======= + +export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "inbucket.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") +kubectl port-forward --namespace {{ .Release.Namespace }} $POD_NAME 10080 + +SMTP Server: +============ + +export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "inbucket.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") +kubectl port-forward --namespace {{ .Release.Namespace }} $POD_NAME 10025 + +POP3 Server: +============ + +export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "inbucket.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") +kubectl port-forward --namespace {{ .Release.Namespace }} $POD_NAME 10110 \ No newline at end of file diff --git a/stable/inbucket/templates/_helpers.tpl b/stable/inbucket/templates/_helpers.tpl new file mode 100644 index 0000000000..0ceb5961f5 --- /dev/null +++ b/stable/inbucket/templates/_helpers.tpl @@ -0,0 +1,43 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "inbucket.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 "inbucket.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 "inbucket.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create the name for the tls secret. +*/}} +{{- define "inbucket.tlsSecret" -}} + {{- if .Values.ingress.tls.existingSecret -}} + {{- .Values.ingress.tls.existingSecret -}} + {{- else -}} + {{- template "inbucket.fullname" . -}}-tls + {{- end -}} +{{- end -}} diff --git a/stable/inbucket/templates/deployment.yaml b/stable/inbucket/templates/deployment.yaml new file mode 100644 index 0000000000..c71354552b --- /dev/null +++ b/stable/inbucket/templates/deployment.yaml @@ -0,0 +1,57 @@ +apiVersion: apps/v1beta2 +kind: Deployment +metadata: + labels: + app: {{ template "inbucket.name" . }} + chart: {{ template "inbucket.chart" . }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "inbucket.fullname" . }} +spec: + selector: + matchLabels: + app: {{ template "inbucket.name" . }} + release: {{ .Release.Name | quote }} + template: + metadata: + {{- if .Values.podAnnotations }} + annotations: +{{ toYaml .Values.podAnnotations | indent 8 }} + {{- end }} + labels: + app: {{ template "inbucket.name" . }} + release: {{ .Release.Name | quote }} + spec: + containers: + - name: {{ template "inbucket.name" . }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: "{{ .Values.image.pullPolicy }}" + env: + {{- range $key, $value := .Values.env }} + - name: "{{ $key }}" + value: "{{ $value }}" + {{- end }} + ports: + - name: http + containerPort: 10080 + protocol: TCP + - name: smtp + containerPort: 10025 + protocol: TCP + - name: pop3 + containerPort: 10110 + protocol: TCP + livenessProbe: + tcpSocket: + port: smtp + initialDelaySeconds: 10 + timeoutSeconds: 1 + readinessProbe: + tcpSocket: + port: smtp + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} + {{- end }} diff --git a/stable/inbucket/templates/ingress.yaml b/stable/inbucket/templates/ingress.yaml new file mode 100644 index 0000000000..272c0bbff5 --- /dev/null +++ b/stable/inbucket/templates/ingress.yaml @@ -0,0 +1,38 @@ +{{- if .Values.ingress.enabled }} +{{- $fullName := include "inbucket.fullname" . -}} +{{- $path := .Values.ingress.path -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: +{{- if .Values.ingress.annotations }} + annotations: +{{ toYaml .Values.ingress.annotations | indent 4 }} +{{- end }} + labels: + app: {{ template "inbucket.name" . }} + chart: {{ template "inbucket.chart" . }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ $fullName }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $path }} + backend: + serviceName: {{ $fullName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/stable/inbucket/templates/service.yaml b/stable/inbucket/templates/service.yaml new file mode 100644 index 0000000000..d38ed2b59f --- /dev/null +++ b/stable/inbucket/templates/service.yaml @@ -0,0 +1,45 @@ +apiVersion: v1 +kind: Service +metadata: +{{- if .Values.service.annotations }} + annotations: +{{ toYaml .Values.service.annotations | indent 4 }} +{{- end }} + labels: + app: {{ template "inbucket.name" . }} + chart: {{ template "inbucket.chart" . }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "inbucket.fullname" . }} +spec: + type: "{{ .Values.service.type }}" + clusterIP: "{{ .Values.service.clusterIP }}" +{{- if .Values.service.externalIPs }} + externalIPs: +{{ toYaml .Values.service.externalIPs | indent 4 }} +{{- end }} +{{- if .Values.service.loadBalancerIP }} + loadBalancerIP: "{{ .Values.service.loadBalancerIP }}" +{{- end }} +{{- if .Values.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: +{{ toYaml .Values.service.loadBalancerSourceRanges | indent 4 }} +{{- end }} + ports: + - name: http + port: {{ .Values.service.port.http }} + protocol: TCP + targetPort: http + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort.http))) }} + nodePort: {{ .Values.service.nodePort.http }} + {{- end }} + - name: smtp + port: {{ .Values.service.port.smtp }} + protocol: TCP + targetPort: smtp + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort.smtp))) }} + nodePort: {{ .Values.service.nodePort.smtp }} + {{- end }} + selector: + app: {{ template "inbucket.name" . }} + release: {{ .Release.Name }} diff --git a/stable/inbucket/values.yaml b/stable/inbucket/values.yaml new file mode 100644 index 0000000000..71160c47f5 --- /dev/null +++ b/stable/inbucket/values.yaml @@ -0,0 +1,34 @@ +image: + repository: jhillyerd/inbucket + tag: release-1.2.0 + pullPolicy: IfNotPresent + +service: + annotations: {} + clusterIP: "" + externalIPs: [] + loadBalancerIP: "" + loadBalancerSourceRanges: [] + type: ClusterIP + port: + http: 10080 + smtp: 10025 + pop: 10110 + nodePort: + http: "" + smtp: "" + pop: "" + +ingress: + enabled: false + annotations: {} + path: / + hosts: + - inbucket.example.com + tls: [] + # - hosts: + # - inbucket.example.com + # secretName: tls-inbucket + +podAnnotations: {} +resources: {}