Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add service type LoadBalancer #5

Merged
merged 2 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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