Skip to content

Commit

Permalink
Merge pull request #20 from mjwloch/kubeitfix
Browse files Browse the repository at this point in the history
Fixed kubeit labels kubeitDefaultHosts so that no exc is thrown for n…
  • Loading branch information
mjwloch authored Nov 29, 2022
2 parents 99a3bde + d917101 commit c3b5cb2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charts/platform-service/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
appVersion: "1.1"
description: Platform service chart
name: platform-service
version: 1.1.1
version: 1.1.2
20 changes: 17 additions & 3 deletions charts/platform-service/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,25 @@ app.kubernetes.io/name: {{ include "platform-service.name" . }}
helm.sh/chart: {{ include "platform-service.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
version: {{ .Values.version }}
{{ if $.Values.kubeit.tenantName }}
{{- if $.Values.kubeit }}
{{- if $.Values.kubeit.tenantName }}
tenant: {{ $.Values.kubeit.tenantName }}
{{- end -}}
{{- if or ( .Values.podIdentityName ) ( .Values.kubeit.tenantPodIdentityName ) }}
aadpodidbinding: {{ .Values.podIdentityName | default .Values.kubeit.tenantPodIdentityName }}
{{- end -}}

{{ $podIdentityName := "" }}
{{- if $.Values.kubeit }}
{{- if $.Values.kubeit.tenantPodIdentityName }}
{{ $podIdentityName = .Values.kubeit.tenantPodIdentityName }}
{{- end }}
{{- end }}

{{- if $.Values.podIdentityName }}
{{ $podIdentityName = .Values.podIdentityName }}
{{- end }}

{{- if $podIdentityName }}
aadpodidbinding: {{ $podIdentityName }}
{{- end }}
{{ if $.Values.volumes -}}
state: stateful
Expand Down
9 changes: 4 additions & 5 deletions charts/platform-service/templates/virtualservice.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
{{ $tenantPrefix := "" }}
{{- if $.Values.kubeitDefaultHosts.tenantPrefixEnabled }}
{{ $tenantPrefix = printf "-%s" .Values.kubeit.tenantName }}
{{- end }}

{{- define "retries" -}}
{{- if .Values.defaultRouting.retries.enabled }}
retries:
Expand Down Expand Up @@ -45,6 +40,10 @@ metadata:
spec:
hosts:
{{- if .Values.defaultRouting.kubeitDefaultHosts.enabled }}
{{ $tenantPrefix := "" }}
{{- if and $.Values.defaultRouting.kubeitDefaultHosts.enabled $.Values.defaultRouting.kubeitDefaultHosts.tenantPrefixEnabled }}
{{ $tenantPrefix = printf "-%s" .Values.kubeit.tenantName }}
{{- end }}
- "{{ .Values.defaultRouting.kubeitDefaultHosts.hostsPrefix | default .Values.app }}{{ $tenantPrefix }}.{{ .Values.kubeit.clusterSubdomain }}.{{ .Values.defaultRouting.kubeitDefaultHosts.dnsDomain }}" # Cluster specific subdomain, i.e.: dev001
- "{{ .Values.defaultRouting.kubeitDefaultHosts.hostsPrefix | default .Values.app }}{{ $tenantPrefix }}.{{ .Values.kubeit.shortRegion }}.{{ .Values.kubeit.environmentName }}.{{ .Values.defaultRouting.kubeitDefaultHosts.dnsDomain }}" # F5/Active Cluster
- "{{ .Values.defaultRouting.kubeitDefaultHosts.hostsPrefix | default .Values.app }}{{ $tenantPrefix }}.{{ .Values.kubeit.clusterColour }}.{{ .Values.kubeit.shortRegion }}.{{ .Values.kubeit.environmentName }}.{{ .Values.defaultRouting.kubeitDefaultHosts.dnsDomain }}" # Colour cluster - blue/green deployment
Expand Down
2 changes: 1 addition & 1 deletion charts/platform-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ defaultRouting:
enabled: true

kubeitDefaultHosts:
tenantPrefixEnabled: true
enabled: false
tenantPrefixEnabled: true
# hostsPrefix: # Optional - default app name

# hosts to take into account for routing rules (ignored if allHosts = true)
Expand Down

0 comments on commit c3b5cb2

Please sign in to comment.