Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
feat: 💥 LoadBalancer Service by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mloiseleur authored Feb 14, 2024
1 parent a1d3070 commit 8b1608d
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 4 deletions.
15 changes: 15 additions & 0 deletions traefik-hub/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@


Traefik Hub {{ .Chart.AppVersion }} has been deployed successfully on {{ .Release.Namespace }} namespace!

{{- with .Values.service }}
{{- $portsList := list }}
{{- range .ports }}
{{- $portsList = append $portsList .port }}
{{- end }}
{{- $portsArray := join ", " $portsList }}
{{- $portsList := regexReplaceAll ", (\\d+)$" $portsArray " and $1" }}
{{- $portsString := len .ports | plural "port" "ports" }}
{{- if eq .type "ClusterIP" }}
ClusterIP Service is listening internally on {{ $portsString }} {{ $portsList }}.
{{- else }}
{{.type}} Service is exposed on {{ $portsString }} {{ $portsList }}.
{{- end }}
{{- end }}
39 changes: 37 additions & 2 deletions traefik-hub/tests/notes_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,46 @@ capabilities:
tests:
- it: should display default release notes
set:
rbac:
namespaced: true
asserts:
- equalRaw:
value: |2
Traefik Hub 2.3.0 has been deployed successfully on NAMESPACE namespace!
LoadBalancer Service is exposed on ports 80 and 443.
- it: should display ClusterIP Service with 3 ports
set:
service:
type: ClusterIP
ports:
- name: web
port: 80
targetPort: web
- name: websecure
port: 443
targetPort: websecure
- name: grpc
port: 8443
targetPort: grpc
asserts:
- equalRaw:
value: |2
Traefik Hub 2.3.0 has been deployed successfully on NAMESPACE namespace!
ClusterIP Service is listening internally on ports 80, 443 and 8443.
- it: should display NodePort service with 1 port
set:
service:
type: NodePort
ports:
- name: websecure
port: 443
targetPort: websecure
asserts:
- equalRaw:
value: |2
Traefik Hub 2.3.0 has been deployed successfully on NAMESPACE namespace!
NodePort Service is exposed on port 443.
2 changes: 1 addition & 1 deletion traefik-hub/tests/service_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tests:
of: Service
- equal:
path: spec.type
value: ClusterIP
value: LoadBalancer
- equal:
path: metadata.name
value: "traefik-hub"
Expand Down
2 changes: 1 addition & 1 deletion traefik-hub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extraVolumeMounts: []
## Service used in front of Traefik Hub
## See https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/
service:
type: ClusterIP
type: LoadBalancer
annotations: {}
externalTrafficPolicy:
internalTrafficPolicy:
Expand Down

0 comments on commit 8b1608d

Please sign in to comment.