Browse Source

Updated helm charts to support devspaces

pull/1004/head
eiximenis 6 years ago
parent
commit
631696c4ae
10 changed files with 45 additions and 19 deletions
  1. +6
    -1
      .gitignore
  2. +1
    -1
      k8s/helm/apigwmm/templates/deployment.yaml
  3. +5
    -2
      k8s/helm/apigwmm/templates/ingress.yaml
  4. +2
    -0
      k8s/helm/apigwmm/values.yaml
  5. +1
    -1
      k8s/helm/apigwms/templates/deployment.yaml
  6. +3
    -1
      k8s/helm/apigwms/values.yaml
  7. +1
    -1
      k8s/helm/apigwwm/templates/deployment.yaml
  8. +3
    -1
      k8s/helm/apigwwm/values.yaml
  9. +18
    -9
      k8s/helm/deploy-all.ps1
  10. +5
    -2
      k8s/helm/webmvc/templates/ingress.yaml

+ 6
- 1
.gitignore View File

@ -265,4 +265,9 @@ pub/
.mfractor .mfractor
# Ignore HealthCheckdb # Ignore HealthCheckdb
*healthchecksdb*
*healthchecksdb*
# Ignores all extra inf.yaml and app.yaml that are copied by prepare-devspaces.ps1
src/**/app.yaml
src/**/inf.yaml

+ 1
- 1
k8s/helm/apigwmm/templates/deployment.yaml View File

@ -61,7 +61,7 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts: volumeMounts:
- name: config - name: config
mountPath: /app/configuration
mountPath: {{ .Values.ocelot.configPath }}
env: env:
- name: PATH_BASE - name: PATH_BASE
value: {{ include "pathBase" (list .Values.app.ingress.entries.mobilemarketingapigw .) }} value: {{ include "pathBase" (list .Values.app.ingress.entries.mobilemarketingapigw .) }}


+ 5
- 2
k8s/helm/apigwmm/templates/ingress.yaml View File

@ -1,5 +1,6 @@
{{- if .Values.ingress.enabled -}} {{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.mobilemarketingapigw .) -}} {{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.mobilemarketingapigw .) -}}
{{- $serviceName := .Values.app.svc.mobilemarketingapigw -}}
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: Ingress kind: Ingress
metadata: metadata:
@ -23,11 +24,13 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
rules: rules:
- host: {{ .Values.inf.k8s.dns }}
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http: http:
paths: paths:
- path: {{ $ingressPath }} - path: {{ $ingressPath }}
backend: backend:
serviceName: {{ .Values.app.svc.mobilemarketingapigw }}
serviceName: {{ $serviceName }}
servicePort: http servicePort: http
{{- end }}
{{- end }} {{- end }}

+ 2
- 0
k8s/helm/apigwmm/values.yaml View File

@ -62,3 +62,5 @@ probes:
initialDelaySeconds: 90 initialDelaySeconds: 90
periodSeconds: 60 periodSeconds: 60
port: 80 port: 80
ocelot:
configPath: /app/configuration

+ 1
- 1
k8s/helm/apigwms/templates/deployment.yaml View File

@ -61,7 +61,7 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts: volumeMounts:
- name: config - name: config
mountPath: /app/configuration
mountPath: {{ .Values ocelot.configPath }}
env: env:
- name: PATH_BASE - name: PATH_BASE
value: {{ include "pathBase" (list .Values.app.ingress.entries.mobileshoppingapigw .) }} value: {{ include "pathBase" (list .Values.app.ingress.entries.mobileshoppingapigw .) }}


+ 3
- 1
k8s/helm/apigwms/values.yaml View File

@ -61,4 +61,6 @@ probes:
timeoutSeconds: 5 timeoutSeconds: 5
initialDelaySeconds: 90 initialDelaySeconds: 90
periodSeconds: 60 periodSeconds: 60
port: 80
port: 80
ocelot:
configPath: /app/configuration

+ 1
- 1
k8s/helm/apigwwm/templates/deployment.yaml View File

@ -61,7 +61,7 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts: volumeMounts:
- name: config - name: config
mountPath: /app/configuration
mountPath: {{ .Values ocelot.configPath }}
env: env:
- name: PATH_BASE - name: PATH_BASE
value: {{ include "pathBase" (list .Values.app.ingress.entries.webmarketingapigw .) }} value: {{ include "pathBase" (list .Values.app.ingress.entries.webmarketingapigw .) }}


+ 3
- 1
k8s/helm/apigwwm/values.yaml View File

@ -61,4 +61,6 @@ probes:
timeoutSeconds: 5 timeoutSeconds: 5
initialDelaySeconds: 90 initialDelaySeconds: 90
periodSeconds: 60 periodSeconds: 60
port: 80
port: 80
ocelot:
configPath: /app/configuration

+ 18
- 9
k8s/helm/deploy-all.ps1 View File

@ -5,6 +5,7 @@ Param(
[parameter(Mandatory=$false)][string]$externalDns, [parameter(Mandatory=$false)][string]$externalDns,
[parameter(Mandatory=$false)][string]$appName="eshop", [parameter(Mandatory=$false)][string]$appName="eshop",
[parameter(Mandatory=$false)][bool]$deployInfrastructure=$true, [parameter(Mandatory=$false)][bool]$deployInfrastructure=$true,
[parameter(Mandatory=$false)][bool]$deployCharts=$true,
[parameter(Mandatory=$false)][bool]$clean=$true, [parameter(Mandatory=$false)][bool]$clean=$true,
[parameter(Mandatory=$false)][string]$aksName="", [parameter(Mandatory=$false)][string]$aksName="",
[parameter(Mandatory=$false)][string]$aksRg="", [parameter(Mandatory=$false)][string]$aksRg="",
@ -66,21 +67,29 @@ $charts = ("eshop-common", "apigwmm", "apigwms", "apigwwm", "apigwws", "basket-a
if ($deployInfrastructure) { if ($deployInfrastructure) {
foreach ($infra in $infras) { foreach ($infra in $infras) {
Write-Host "Installing infrastructure: $infra" -ForegroundColor Green Write-Host "Installing infrastructure: $infra" -ForegroundColor Green
helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --name="$appName-$infra" $infra
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
} }
} }
else {
Write-Host "eShopOnContainers infrastructure (bbdd, redis, ...) charts aren't installed (-deployCharts is false)" -ForegroundColor Yellow
}
foreach ($chart in $charts) {
Write-Host "Installing: $chart" -ForegroundColor Green
if ($useCustomRegistry) {
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
}
else {
if ($chart -ne "eshop-common") { # eshop-common is ignored when no secret must be deployed
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
if ($deployCharts) {
foreach ($chart in $charts) {
Write-Host "Installing: $chart" -ForegroundColor Green
if ($useCustomRegistry) {
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
}
else {
if ($chart -ne "eshop-common") { # eshop-common is ignored when no secret must be deployed
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
}
} }
} }
} }
else {
Write-Host "eShopOnContainers non-infrastructure charts aren't installed (-deployCharts is false)" -ForegroundColor Yellow
}
Write-Host "helm charts installed." -ForegroundColor Green Write-Host "helm charts installed." -ForegroundColor Green


+ 5
- 2
k8s/helm/webmvc/templates/ingress.yaml View File

@ -1,5 +1,6 @@
{{- if .Values.ingress.enabled -}} {{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" . -}} {{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.mvc -}}
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: Ingress kind: Ingress
metadata: metadata:
@ -23,11 +24,13 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
rules: rules:
- host: {{ .Values.inf.k8s.dns }}
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http: http:
paths: paths:
- path: {{ $ingressPath }} - path: {{ $ingressPath }}
backend: backend:
serviceName: {{ .Values.app.svc.mvc }}
serviceName: {{ $serviceName }}
servicePort: http servicePort: http
{{- end }}
{{- end }} {{- end }}

Loading…
Cancel
Save