Skip to content

Commit 631696c

Browse files
committed
Updated helm charts to support devspaces
1 parent e310a52 commit 631696c

10 files changed

Lines changed: 45 additions & 19 deletions

File tree

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,4 +265,9 @@ pub/
265265
.mfractor
266266

267267
# Ignore HealthCheckdb
268-
*healthchecksdb*
268+
*healthchecksdb*
269+
270+
# Ignores all extra inf.yaml and app.yaml that are copied by prepare-devspaces.ps1
271+
src/**/app.yaml
272+
src/**/inf.yaml
273+

k8s/helm/apigwmm/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ spec:
6161
imagePullPolicy: {{ .Values.image.pullPolicy }}
6262
volumeMounts:
6363
- name: config
64-
mountPath: /app/configuration
64+
mountPath: {{ .Values.ocelot.configPath }}
6565
env:
6666
- name: PATH_BASE
6767
value: {{ include "pathBase" (list .Values.app.ingress.entries.mobilemarketingapigw .) }}

k8s/helm/apigwmm/templates/ingress.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{- if .Values.ingress.enabled -}}
22
{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.mobilemarketingapigw .) -}}
3+
{{- $serviceName := .Values.app.svc.mobilemarketingapigw -}}
34
apiVersion: extensions/v1beta1
45
kind: Ingress
56
metadata:
@@ -23,11 +24,13 @@ spec:
2324
{{- end }}
2425
{{- end }}
2526
rules:
26-
- host: {{ .Values.inf.k8s.dns }}
27+
{{- range .Values.ingress.hosts }}
28+
- host: {{ . }}
2729
http:
2830
paths:
2931
- path: {{ $ingressPath }}
3032
backend:
31-
serviceName: {{ .Values.app.svc.mobilemarketingapigw }}
33+
serviceName: {{ $serviceName }}
3234
servicePort: http
35+
{{- end }}
3336
{{- end }}

k8s/helm/apigwmm/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,5 @@ probes:
6262
initialDelaySeconds: 90
6363
periodSeconds: 60
6464
port: 80
65+
ocelot:
66+
configPath: /app/configuration

k8s/helm/apigwms/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ spec:
6161
imagePullPolicy: {{ .Values.image.pullPolicy }}
6262
volumeMounts:
6363
- name: config
64-
mountPath: /app/configuration
64+
mountPath: {{ .Values ocelot.configPath }}
6565
env:
6666
- name: PATH_BASE
6767
value: {{ include "pathBase" (list .Values.app.ingress.entries.mobileshoppingapigw .) }}

k8s/helm/apigwms/values.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,6 @@ probes:
6161
timeoutSeconds: 5
6262
initialDelaySeconds: 90
6363
periodSeconds: 60
64-
port: 80
64+
port: 80
65+
ocelot:
66+
configPath: /app/configuration

k8s/helm/apigwwm/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ spec:
6161
imagePullPolicy: {{ .Values.image.pullPolicy }}
6262
volumeMounts:
6363
- name: config
64-
mountPath: /app/configuration
64+
mountPath: {{ .Values ocelot.configPath }}
6565
env:
6666
- name: PATH_BASE
6767
value: {{ include "pathBase" (list .Values.app.ingress.entries.webmarketingapigw .) }}

k8s/helm/apigwwm/values.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,6 @@ probes:
6161
timeoutSeconds: 5
6262
initialDelaySeconds: 90
6363
periodSeconds: 60
64-
port: 80
64+
port: 80
65+
ocelot:
66+
configPath: /app/configuration

k8s/helm/deploy-all.ps1

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Param(
55
[parameter(Mandatory=$false)][string]$externalDns,
66
[parameter(Mandatory=$false)][string]$appName="eshop",
77
[parameter(Mandatory=$false)][bool]$deployInfrastructure=$true,
8+
[parameter(Mandatory=$false)][bool]$deployCharts=$true,
89
[parameter(Mandatory=$false)][bool]$clean=$true,
910
[parameter(Mandatory=$false)][string]$aksName="",
1011
[parameter(Mandatory=$false)][string]$aksRg="",
@@ -66,21 +67,29 @@ $charts = ("eshop-common", "apigwmm", "apigwms", "apigwwm", "apigwws", "basket-a
6667
if ($deployInfrastructure) {
6768
foreach ($infra in $infras) {
6869
Write-Host "Installing infrastructure: $infra" -ForegroundColor Green
69-
helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --name="$appName-$infra" $infra
70+
helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set ingress.hosts={$dns} --name="$appName-$infra" $infra
7071
}
7172
}
73+
else {
74+
Write-Host "eShopOnContainers infrastructure (bbdd, redis, ...) charts aren't installed (-deployCharts is false)" -ForegroundColor Yellow
75+
}
7276

73-
foreach ($chart in $charts) {
74-
Write-Host "Installing: $chart" -ForegroundColor Green
75-
if ($useCustomRegistry) {
76-
helm install --set inf.registry.server=$registry --set inf.registry.login=$dockerUser --set inf.registry.pwd=$dockerPassword --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set image.tag=$imageTag --set image.pullPolicy=Always --name="$appName-$chart" $chart
77-
}
78-
else {
79-
if ($chart -ne "eshop-common") { # eshop-common is ignored when no secret must be deployed
80-
helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set image.tag=$imageTag --set image.pullPolicy=Always --name="$appName-$chart" $chart
77+
if ($deployCharts) {
78+
foreach ($chart in $charts) {
79+
Write-Host "Installing: $chart" -ForegroundColor Green
80+
if ($useCustomRegistry) {
81+
helm install --set inf.registry.server=$registry --set inf.registry.login=$dockerUser --set inf.registry.pwd=$dockerPassword --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set ingress.hosts={$dns} --set image.tag=$imageTag --set image.pullPolicy=Always --name="$appName-$chart" $chart
82+
}
83+
else {
84+
if ($chart -ne "eshop-common") { # eshop-common is ignored when no secret must be deployed
85+
helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set ingress.hosts={$dns} --set image.tag=$imageTag --set image.pullPolicy=Always --name="$appName-$chart" $chart
86+
}
8187
}
8288
}
8389
}
90+
else {
91+
Write-Host "eShopOnContainers non-infrastructure charts aren't installed (-deployCharts is false)" -ForegroundColor Yellow
92+
}
8493

8594
Write-Host "helm charts installed." -ForegroundColor Green
8695

k8s/helm/webmvc/templates/ingress.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{- if .Values.ingress.enabled -}}
22
{{- $ingressPath := include "pathBase" . -}}
3+
{{- $serviceName := .Values.app.svc.mvc -}}
34
apiVersion: extensions/v1beta1
45
kind: Ingress
56
metadata:
@@ -23,11 +24,13 @@ spec:
2324
{{- end }}
2425
{{- end }}
2526
rules:
26-
- host: {{ .Values.inf.k8s.dns }}
27+
{{- range .Values.ingress.hosts }}
28+
- host: {{ . }}
2729
http:
2830
paths:
2931
- path: {{ $ingressPath }}
3032
backend:
31-
serviceName: {{ .Values.app.svc.mvc }}
33+
serviceName: {{ $serviceName }}
3234
servicePort: http
35+
{{- end }}
3336
{{- end }}

0 commit comments

Comments
 (0)