Skip to content

Commit

Permalink
Merge pull request #5 from ohioit/cs/service-load-balancer
Browse files Browse the repository at this point in the history
Add service type LoadBalancer
  • Loading branch information
alluen authored Apr 26, 2024
2 parents 68affc4 + d23685f commit 11d6dd2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/maildev/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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.1.0
version: 1.1.1
appVersion: "2.1.0"
home: https://github.com/alluen/maildev-helm
maintainers:
Expand Down
13 changes: 9 additions & 4 deletions charts/maildev/templates/smtp/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@ kind: Service
metadata:
name: {{ include "maildev.smtp.serviceName" . }}
labels:
{{- include "maildev.labels" . | nindent 4 }}s
{{- include "maildev.labels" . | nindent 4 }}
{{- if .Values.services.smtp.annotations }}
annotations:
{{- toYaml .Values.services.smtp.annotations | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.services.smtp.type }}
ports:
- port: {{ .Values.services.smtp.port }}
targetPort: smtp
protocol: TCP
name: smtp
{{- if (eq .Values.services.smtp.type "NodePort") }}
{{- if .Values.services.smtp.nodePort }}
{{- if and (eq .Values.services.smtp.type "NodePort") .Values.services.smtp.nodePort }}
nodePort: {{ .Values.services.smtp.nodePort }}
{{- end }}
{{- end }}
{{- if and (eq .Values.services.smtp.type "LoadBalancer") .Values.services.smtp.loadBalancerIP }}
loadBalancerIP: {{ .Values.services.smtp.loadBalancerIP | quote }}
{{- end }}
selector:
{{- include "maildev.selectorLabels" . | nindent 4 }}
8 changes: 7 additions & 1 deletion charts/maildev/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,19 @@
"type": "object",
"properties": {
"nodePort": {
"type": "integer"
"type": "string"
},
"port": {
"type": "integer"
},
"type": {
"type": "string"
},
"loadBalancerIP": {
"type": "string"
},
"annotations": {
"type": "object"
}
}
},
Expand Down
8 changes: 6 additions & 2 deletions charts/maildev/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,16 @@ services:
# -- Kubernetes port to use for the web GUI
port: 1080
smtp:
# -- Kubernetes service type for the SMTP server
# -- Kubernetes service type for the SMTP server. One of NodePort, LoadBalancer, or ClusterIP
type: ClusterIP
# -- Kubernetes port to use for the internal SMTP server
port: 1025
# -- You can set the node port for the external SMTP server that should be used or leave it blank to get a random node port. Only active if `services.smtp.type == NodePort`
nodePort:
nodePort: ""
# -- Annotations to be added to the service
annotations: {}
# -- loadBalancerIP if services.smtp.type is LoadBalancer
loadBalancerIP: ""

ingress:
# -- Enable ingress record generation
Expand Down

0 comments on commit 11d6dd2

Please sign in to comment.