Skip to content

Commit

Permalink
Merge pull request #41 from jouve/mailpit/lb
Browse files Browse the repository at this point in the history
[mailpit] lb for services
  • Loading branch information
jouve authored Mar 20, 2024
2 parents bb82249 + 638efb9 commit c6326a2
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 7 deletions.
6 changes: 3 additions & 3 deletions charts/mailpit/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
version: 2.15.3
digest: sha256:6e497dd048074cf051470d6ee2a2357401f18bb46afa1d515b1440014152a987
generated: "2024-02-17T13:55:40.081779373+01:00"
version: 2.19.0
digest: sha256:5eade02d974e0d4ee0ec0701dc0962e3fa57cbb75a5e13aeca334153396a6f28
generated: "2024-03-13T21:22:15.250616749+01:00"
2 changes: 1 addition & 1 deletion charts/mailpit/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: mailpit
description: An email and SMTP testing tool with API for developers
icon: https://raw.githubusercontent.com/axllent/mailpit/develop/server/ui/mailpit.svg
type: application
version: 0.14.0
version: 0.15.0
appVersion: 1.14.4
dependencies:
- name: common
Expand Down
1 change: 1 addition & 0 deletions charts/mailpit/ci/default-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
6 changes: 6 additions & 0 deletions charts/mailpit/ci/loadbalancer-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
service:
http:
type: LoadBalancer
smtp:
type: LoadBalancer
loadBalancerIP: 1.2.3.4
6 changes: 6 additions & 0 deletions charts/mailpit/ci/nodeport-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
service:
http:
type: NodePort
smtp:
type: NodePort
nodePort: 25252
11 changes: 10 additions & 1 deletion charts/mailpit/templates/http-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@ metadata:
{{- end }}
spec:
type: {{ .Values.service.http.type }}
{{- if or (eq .Values.service.http.type "LoadBalancer") (eq .Values.service.http.type "NodePort") }}
externalTrafficPolicy: {{ .Values.service.http.externalTrafficPolicy | quote }}
{{- end }}
{{- if and (eq .Values.service.http.type "LoadBalancer") (not (empty .Values.service.http.loadBalancerSourceRanges)) }}
loadBalancerSourceRanges: {{ .Values.service.http.loadBalancerSourceRanges }}
{{- end }}
{{- if and (eq .Values.service.http.type "LoadBalancer") (not (empty .Values.service.http.loadBalancerIP)) }}
loadBalancerIP: {{ .Values.service.http.loadBalancerIP }}
{{- end }}
ports:
- name: http
port: 80
{{- if and (or (eq .Values.service.http.type "NodePort") (eq .Values.service.http.type "LoadBalancer")) (not (empty .Values.service.http.nodePort)) }}
{{- if and (eq .Values.service.http.type "NodePort" "LoadBalancer") (gt (.Values.service.http.nodePort | int) 0) }}
nodePort: {{ .Values.service.http.nodePort }}
{{- end }}
targetPort: http
Expand Down
11 changes: 10 additions & 1 deletion charts/mailpit/templates/smtp-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@ metadata:
{{- end }}
spec:
type: {{ .Values.service.smtp.type }}
{{- if or (eq .Values.service.smtp.type "LoadBalancer") (eq .Values.service.smtp.type "NodePort") }}
externalTrafficPolicy: {{ .Values.service.smtp.externalTrafficPolicy | quote }}
{{- end }}
{{- if and (eq .Values.service.smtp.type "LoadBalancer") (not (empty .Values.service.smtp.loadBalancerSourceRanges)) }}
loadBalancerSourceRanges: {{ .Values.service.smtp.loadBalancerSourceRanges }}
{{- end }}
{{- if and (eq .Values.service.smtp.type "LoadBalancer") (not (empty .Values.service.smtp.loadBalancerIP)) }}
loadBalancerIP: {{ .Values.service.smtp.loadBalancerIP }}
{{- end }}
ports:
- name: smtp
port: 25
{{- if and (or (eq .Values.service.smtp.type "NodePort") (eq .Values.service.smtp.type "LoadBalancer")) (not (empty .Values.service.smtp.nodePort)) }}
{{- if and (eq .Values.service.smtp.type "NodePort" "LoadBalancer") (gt (.Values.service.smtp.nodePort | int) 0) }}
nodePort: {{ .Values.service.smtp.nodePort }}
{{- end }}
targetPort: smtp
Expand Down
37 changes: 36 additions & 1 deletion charts/mailpit/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,49 @@ service:
## @param service.http.nodePort nodeport bind for HTTP service
##
type: ClusterIP
## Node ports to expose
## @param service.http.nodePort Node port for HTTP
##
nodePort: 0
## @param service.http.loadBalancerIP %%MAIN_CONTAINER_NAME%% service Load Balancer IP
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-loadbalancer
##
loadBalancerIP: ""
## @param service.http.loadBalancerSourceRanges %%MAIN_CONTAINER_NAME%% service Load Balancer sources
## ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
## e.g:
## loadBalancerSourceRanges:
## - 10.10.10.0/24
##
loadBalancerSourceRanges: []
## @param service.http.externalTrafficPolicy %%MAIN_CONTAINER_NAME%% service external traffic policy
## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
##
externalTrafficPolicy: Cluster
smtp:
## @param service.smtp.type service type
## @param service.smtp.nodePort nodeport bind for STMP service
##
type: ClusterIP
## Node ports to expose
## @param service.smtp.nodePort Node port for HTTP
##
nodePort: 0

## @param service.smtp.loadBalancerIP %%MAIN_CONTAINER_NAME%% service Load Balancer IP
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-loadbalancer
##
loadBalancerIP: ""
## @param service.smtp.loadBalancerSourceRanges %%MAIN_CONTAINER_NAME%% service Load Balancer sources
## ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
## e.g:
## loadBalancerSourceRanges:
## - 10.10.10.0/24
##
loadBalancerSourceRanges: []
## @param service.smtp.externalTrafficPolicy %%MAIN_CONTAINER_NAME%% service external traffic policy
## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
##
externalTrafficPolicy: Cluster

## ingress parameters
## ref: http://kubernetes.io/docs/user-guide/ingress/
Expand Down

0 comments on commit c6326a2

Please sign in to comment.