Skip to content

Commit

Permalink
feat: app chart support multiple services (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdh authored Dec 24, 2024
1 parent 9e6cfe1 commit 5802ae9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
2 changes: 1 addition & 1 deletion stable/app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.6.9
version: 0.7.0
35 changes: 32 additions & 3 deletions stable/app/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{{- if .Values.container.enabled }}
{{- $fullName := include "app.fullname" . -}}
{{- $labels := include "app.labels" . -}}
{{- $selectorLabels := include "app.selectorLabels" . -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "app.fullname" . }}
name: {{ $fullName }}
labels:
{{- include "app.labels" . | nindent 4 }}
{{- $labels | nindent 4 }}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand All @@ -19,5 +22,31 @@ spec:
name: {{ $port.name }}
{{- end }}
selector:
{{- include "app.selectorLabels" . | nindent 4 }}
{{- $selectorLabels | nindent 4 }}
{{- if .Values.service.additionalService }}
{{- range .Values.service.additionalService }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ printf "%s-%s" $fullName .name }}
labels:
{{- $labels | nindent 4 }}
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .type }}
ports:
{{- range $port := .ports }}
- port: {{ $port.port }}
targetPort: {{ $port.targetPort }}
protocol: {{ $port.protocol }}
name: {{ $port.name }}
{{- end }}
selector:
{{- $selectorLabels | nindent 4 }}
{{- end }}
{{- end }}
{{- end -}}

0 comments on commit 5802ae9

Please sign in to comment.