From 1f762a6bcfcb3d46c86353e6b133190d39e0bec2 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Fri, 15 Mar 2019 19:52:34 +0100 Subject: [PATCH] devspaces scripts --- k8s/helm/apigwmm/templates/_names.tpl | 11 +++--- k8s/helm/apigwmm/templates/deployment.yaml | 2 +- k8s/helm/apigwmm/templates/ingress.yaml | 2 +- k8s/helm/apigwms/templates/_names.tpl | 10 ++--- k8s/helm/apigwms/templates/deployment.yaml | 4 +- k8s/helm/apigwms/templates/ingress.yaml | 10 +++-- k8s/helm/apigwwm/templates/_names.tpl | 10 ++--- k8s/helm/apigwwm/templates/deployment.yaml | 4 +- k8s/helm/apigwwm/templates/ingress.yaml | 10 +++-- k8s/helm/apigwws/templates/_names.tpl | 11 +++--- k8s/helm/apigwws/templates/deployment.yaml | 4 +- k8s/helm/apigwws/templates/ingress.yaml | 9 +++-- k8s/helm/apigwws/values.yaml | 2 + k8s/helm/basket-api/templates/ingress.yaml | 37 +++++++++++++++++++ k8s/helm/basket-api/values.yaml | 3 ++ k8s/helm/catalog-api/templates/ingress.yaml | 37 +++++++++++++++++++ .../identity-api/templates/configmap.yaml | 3 +- k8s/helm/identity-api/values.yaml | 7 +++- k8s/helm/locations-api/templates/ingress.yaml | 36 ++++++++++++++++++ k8s/helm/marketing-api/templates/ingress.yaml | 36 ++++++++++++++++++ .../mobileshoppingagg/templates/ingress.yaml | 36 ++++++++++++++++++ .../webshoppingagg/templates/ingress.yaml | 36 ++++++++++++++++++ .../Mobile.Bff.Marketing/apigw/azds.yaml | 6 +-- .../aggregator/values.dev.yaml | 3 ++ .../Mobile.Bff.Shopping/apigw/azds.yaml | 2 +- .../Web.Bff.Marketing/apigw/azds.yaml | 6 +-- .../aggregator/values.dev.yaml | 2 + .../Basket/Basket.API/values.dev.yaml | 3 ++ .../Catalog/Catalog.API/values.dev.yaml | 3 ++ .../DevspacesRedirectUriValidator.cs | 31 ++++++++++++++++ .../IdentityDevspacesBuilderExtensions.cs | 20 ++++++++++ src/Services/Identity/Identity.API/Startup.cs | 2 + .../Identity/Identity.API/values.dev.yaml | 1 + .../Location/Locations.API/values.dev.yaml | 3 ++ .../Marketing/Marketing.API/values.dev.yaml | 3 ++ src/Web/WebMVC/azds.yaml | 3 ++ 36 files changed, 357 insertions(+), 51 deletions(-) create mode 100644 k8s/helm/basket-api/templates/ingress.yaml create mode 100644 k8s/helm/catalog-api/templates/ingress.yaml create mode 100644 k8s/helm/locations-api/templates/ingress.yaml create mode 100644 k8s/helm/marketing-api/templates/ingress.yaml create mode 100644 k8s/helm/mobileshoppingagg/templates/ingress.yaml create mode 100644 k8s/helm/webshoppingagg/templates/ingress.yaml create mode 100644 src/ApiGateways/Mobile.Bff.Shopping/aggregator/values.dev.yaml create mode 100644 src/ApiGateways/Web.Bff.Shopping/aggregator/values.dev.yaml create mode 100644 src/Services/Basket/Basket.API/values.dev.yaml create mode 100644 src/Services/Catalog/Catalog.API/values.dev.yaml create mode 100644 src/Services/Identity/Identity.API/Devspaces/DevspacesRedirectUriValidator.cs create mode 100644 src/Services/Identity/Identity.API/Devspaces/IdentityDevspacesBuilderExtensions.cs create mode 100644 src/Services/Identity/Identity.API/values.dev.yaml create mode 100644 src/Services/Location/Locations.API/values.dev.yaml create mode 100644 src/Services/Marketing/Marketing.API/values.dev.yaml diff --git a/k8s/helm/apigwmm/templates/_names.tpl b/k8s/helm/apigwmm/templates/_names.tpl index a6eeb9965..d44859fea 100644 --- a/k8s/helm/apigwmm/templates/_names.tpl +++ b/k8s/helm/apigwmm/templates/_names.tpl @@ -33,14 +33,13 @@ {{- end -}} + {{- define "pathBase" -}} -{{- $name := first .}} -{{- $ctx := last .}} -{{- if $ctx.Values.inf.k8s.suffix -}} -{{- $suffix := include "suffix-name" $ctx -}} -{{- printf "/%s-%s" $name $suffix -}} +{{- if .Values.inf.k8s.suffix -}} +{{- $suffix := include "suffix-name" . -}} +{{- printf "%s-%s" .Values.pathBase $suffix -}} {{- else -}} -{{- printf "/%s" $name -}} +{{- .Values.pathBase -}} {{- end -}} {{- end -}} diff --git a/k8s/helm/apigwmm/templates/deployment.yaml b/k8s/helm/apigwmm/templates/deployment.yaml index 46e5bee24..c9abb0b62 100644 --- a/k8s/helm/apigwmm/templates/deployment.yaml +++ b/k8s/helm/apigwmm/templates/deployment.yaml @@ -64,7 +64,7 @@ spec: mountPath: {{ .Values.ocelot.configPath }} env: - name: PATH_BASE - value: {{ include "pathBase" (list .Values.app.ingress.entries.mobilemarketingapigw .) }} + value: {{ include "pathBase" . }} - name: k8sname value: {{ .Values.clusterName }} {{- if .Values.env.values -}} diff --git a/k8s/helm/apigwmm/templates/ingress.yaml b/k8s/helm/apigwmm/templates/ingress.yaml index ec6d078bd..290aac0b3 100644 --- a/k8s/helm/apigwmm/templates/ingress.yaml +++ b/k8s/helm/apigwmm/templates/ingress.yaml @@ -1,5 +1,5 @@ {{- if .Values.ingress.enabled -}} -{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.mobilemarketingapigw .) -}} +{{- $ingressPath := include "pathBase" . -}} {{- $serviceName := .Values.app.svc.mobilemarketingapigw -}} apiVersion: extensions/v1beta1 kind: Ingress diff --git a/k8s/helm/apigwms/templates/_names.tpl b/k8s/helm/apigwms/templates/_names.tpl index 1e840c56c..d44859fea 100644 --- a/k8s/helm/apigwms/templates/_names.tpl +++ b/k8s/helm/apigwms/templates/_names.tpl @@ -35,13 +35,11 @@ {{- define "pathBase" -}} -{{- $name := first .}} -{{- $ctx := last .}} -{{- if $ctx.Values.inf.k8s.suffix -}} -{{- $suffix := include "suffix-name" $ctx -}} -{{- printf "/%s-%s" $name $suffix -}} +{{- if .Values.inf.k8s.suffix -}} +{{- $suffix := include "suffix-name" . -}} +{{- printf "%s-%s" .Values.pathBase $suffix -}} {{- else -}} -{{- printf "/%s" $name -}} +{{- .Values.pathBase -}} {{- end -}} {{- end -}} diff --git a/k8s/helm/apigwms/templates/deployment.yaml b/k8s/helm/apigwms/templates/deployment.yaml index 65522e986..b22922f89 100644 --- a/k8s/helm/apigwms/templates/deployment.yaml +++ b/k8s/helm/apigwms/templates/deployment.yaml @@ -61,10 +61,10 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} volumeMounts: - name: config - mountPath: {{ .Values ocelot.configPath }} + mountPath: {{ .Values.ocelot.configPath }} env: - name: PATH_BASE - value: {{ include "pathBase" (list .Values.app.ingress.entries.mobileshoppingapigw .) }} + value: {{ include "pathBase" . }} - name: k8sname value: {{ .Values.clusterName }} {{- if .Values.env.values -}} diff --git a/k8s/helm/apigwms/templates/ingress.yaml b/k8s/helm/apigwms/templates/ingress.yaml index 7dd50d8dd..e93ddc2c6 100644 --- a/k8s/helm/apigwms/templates/ingress.yaml +++ b/k8s/helm/apigwms/templates/ingress.yaml @@ -1,5 +1,7 @@ {{- if .Values.ingress.enabled -}} -{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.mobileshoppingapigw .) -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.mobileshoppingapigw -}} + apiVersion: extensions/v1beta1 kind: Ingress metadata: @@ -23,11 +25,13 @@ spec: {{- end }} {{- end }} rules: - - host: {{ .Values.inf.k8s.dns }} + {{- range .Values.ingress.hosts }} + - host: {{ . }} http: paths: - path: {{ $ingressPath }} backend: - serviceName: {{ .Values.app.svc.mobileshoppingapigw }} + serviceName: {{ $serviceName }} servicePort: http + {{- end }} {{- end }} diff --git a/k8s/helm/apigwwm/templates/_names.tpl b/k8s/helm/apigwwm/templates/_names.tpl index 1e840c56c..d44859fea 100644 --- a/k8s/helm/apigwwm/templates/_names.tpl +++ b/k8s/helm/apigwwm/templates/_names.tpl @@ -35,13 +35,11 @@ {{- define "pathBase" -}} -{{- $name := first .}} -{{- $ctx := last .}} -{{- if $ctx.Values.inf.k8s.suffix -}} -{{- $suffix := include "suffix-name" $ctx -}} -{{- printf "/%s-%s" $name $suffix -}} +{{- if .Values.inf.k8s.suffix -}} +{{- $suffix := include "suffix-name" . -}} +{{- printf "%s-%s" .Values.pathBase $suffix -}} {{- else -}} -{{- printf "/%s" $name -}} +{{- .Values.pathBase -}} {{- end -}} {{- end -}} diff --git a/k8s/helm/apigwwm/templates/deployment.yaml b/k8s/helm/apigwwm/templates/deployment.yaml index 4f02bc2e9..d1f39ab6c 100644 --- a/k8s/helm/apigwwm/templates/deployment.yaml +++ b/k8s/helm/apigwwm/templates/deployment.yaml @@ -61,10 +61,10 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} volumeMounts: - name: config - mountPath: {{ .Values ocelot.configPath }} + mountPath: {{ .Values.ocelot.configPath }} env: - name: PATH_BASE - value: {{ include "pathBase" (list .Values.app.ingress.entries.webmarketingapigw .) }} + value: {{ include "pathBase" . }} - name: k8sname value: {{ .Values.clusterName }} {{- if .Values.env.values -}} diff --git a/k8s/helm/apigwwm/templates/ingress.yaml b/k8s/helm/apigwwm/templates/ingress.yaml index 0a79c4660..297fea52b 100644 --- a/k8s/helm/apigwwm/templates/ingress.yaml +++ b/k8s/helm/apigwwm/templates/ingress.yaml @@ -1,5 +1,7 @@ {{- if .Values.ingress.enabled -}} -{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.webmarketingapigw .) -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.webmarketingapigw -}} + apiVersion: extensions/v1beta1 kind: Ingress metadata: @@ -23,11 +25,13 @@ spec: {{- end }} {{- end }} rules: - - host: {{ .Values.inf.k8s.dns }} + {{- range .Values.ingress.hosts }} + - host: {{ . }} http: paths: - path: {{ $ingressPath }} backend: - serviceName: {{ .Values.app.svc.webmarketingapigw }} + serviceName: {{ $serviceName }} servicePort: http + {{- end }} {{- end }} diff --git a/k8s/helm/apigwws/templates/_names.tpl b/k8s/helm/apigwws/templates/_names.tpl index a6eeb9965..d44859fea 100644 --- a/k8s/helm/apigwws/templates/_names.tpl +++ b/k8s/helm/apigwws/templates/_names.tpl @@ -33,14 +33,13 @@ {{- end -}} + {{- define "pathBase" -}} -{{- $name := first .}} -{{- $ctx := last .}} -{{- if $ctx.Values.inf.k8s.suffix -}} -{{- $suffix := include "suffix-name" $ctx -}} -{{- printf "/%s-%s" $name $suffix -}} +{{- if .Values.inf.k8s.suffix -}} +{{- $suffix := include "suffix-name" . -}} +{{- printf "%s-%s" .Values.pathBase $suffix -}} {{- else -}} -{{- printf "/%s" $name -}} +{{- .Values.pathBase -}} {{- end -}} {{- end -}} diff --git a/k8s/helm/apigwws/templates/deployment.yaml b/k8s/helm/apigwws/templates/deployment.yaml index 4912d12bb..327eb50b7 100644 --- a/k8s/helm/apigwws/templates/deployment.yaml +++ b/k8s/helm/apigwws/templates/deployment.yaml @@ -60,10 +60,10 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} volumeMounts: - name: config - mountPath: /app/configuration + mountPath: {{ .Values.ocelot.configPath }} env: - name: PATH_BASE - value: {{ include "pathBase" (list .Values.app.ingress.entries.webshoppingapigw .) }} + value: {{ include "pathBase" . }} - name: k8sname value: {{ .Values.clusterName }} {{- if .Values.env.values -}} diff --git a/k8s/helm/apigwws/templates/ingress.yaml b/k8s/helm/apigwws/templates/ingress.yaml index ee1f681ad..8bd2cfc6d 100644 --- a/k8s/helm/apigwws/templates/ingress.yaml +++ b/k8s/helm/apigwws/templates/ingress.yaml @@ -1,5 +1,6 @@ {{- if .Values.ingress.enabled -}} -{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.webshoppingapigw .) -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.webshoppingapigw -}} apiVersion: extensions/v1beta1 kind: Ingress metadata: @@ -23,11 +24,13 @@ spec: {{- end }} {{- end }} rules: - - host: {{ .Values.inf.k8s.dns }} + {{- range .Values.ingress.hosts }} + - host: {{ . }} http: paths: - path: {{ $ingressPath }} backend: - serviceName: {{ .Values.app.svc.webshoppingapigw }} + serviceName: {{ $serviceName }} servicePort: http + {{- end }} {{- end }} diff --git a/k8s/helm/apigwws/values.yaml b/k8s/helm/apigwws/values.yaml index 94b8a203f..2b047de99 100644 --- a/k8s/helm/apigwws/values.yaml +++ b/k8s/helm/apigwws/values.yaml @@ -62,3 +62,5 @@ probes: initialDelaySeconds: 90 periodSeconds: 60 port: 80 +ocelot: + configPath: /app/configuration \ No newline at end of file diff --git a/k8s/helm/basket-api/templates/ingress.yaml b/k8s/helm/basket-api/templates/ingress.yaml new file mode 100644 index 000000000..f99bd55a6 --- /dev/null +++ b/k8s/helm/basket-api/templates/ingress.yaml @@ -0,0 +1,37 @@ +{{- if .Values.ingress.enabled -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.basket -}} + +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ template "basket-api.fullname" . }} + labels: + app: {{ template "basket-api.name" . }} + chart: {{ template "basket-api.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + - {{ .Values.inf.k8s.dns }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $serviceName }} + servicePort: http + {{- end }} +{{- end }} \ No newline at end of file diff --git a/k8s/helm/basket-api/values.yaml b/k8s/helm/basket-api/values.yaml index 6c264afba..a773700fe 100644 --- a/k8s/helm/basket-api/values.yaml +++ b/k8s/helm/basket-api/values.yaml @@ -53,3 +53,6 @@ probes: initialDelaySeconds: 90 periodSeconds: 60 port: 80 + +ingress: + enabled: false \ No newline at end of file diff --git a/k8s/helm/catalog-api/templates/ingress.yaml b/k8s/helm/catalog-api/templates/ingress.yaml new file mode 100644 index 000000000..238d7b07e --- /dev/null +++ b/k8s/helm/catalog-api/templates/ingress.yaml @@ -0,0 +1,37 @@ +{{- if .Values.ingress.enabled -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.catalog -}} + +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ template "catalog-api.fullname" . }} + labels: + app: {{ template "catalog-api.name" . }} + chart: {{ template "catalog-api.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + - {{ .Values.inf.k8s.dns }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $serviceName }} + servicePort: http + {{- end }} +{{- end }} \ No newline at end of file diff --git a/k8s/helm/identity-api/templates/configmap.yaml b/k8s/helm/identity-api/templates/configmap.yaml index 24d71b699..67c0f21cb 100644 --- a/k8s/helm/identity-api/templates/configmap.yaml +++ b/k8s/helm/identity-api/templates/configmap.yaml @@ -36,5 +36,4 @@ data: xamarin_callback_e: http://{{ $xamarincallback }} webhooksapi_e: http://{{ $webhooks_url }} webhooksweb_e: http://{{ $webhooksweb_url }} - - + enableDevspaces: "{{ .Values.enableDevspaces }}" \ No newline at end of file diff --git a/k8s/helm/identity-api/values.yaml b/k8s/helm/identity-api/values.yaml index c0fd38192..7b57dfde1 100644 --- a/k8s/helm/identity-api/values.yaml +++ b/k8s/helm/identity-api/values.yaml @@ -58,6 +58,8 @@ env: key: webhooksapi_e - name: WebhooksWebClient key: webhooksweb_e + - name: EnableDevspaces + key: enableDevspaces values: - name: ASPNETCORE_ENVIRONMENT value: Development @@ -65,6 +67,7 @@ env: value: 'K8S' - name: IsClusterEnv value: 'True' + probes: liveness: path: /liveness @@ -76,4 +79,6 @@ probes: timeoutSeconds: 5 initialDelaySeconds: 90 periodSeconds: 60 - port: 80 \ No newline at end of file + port: 80 + +enableDevspaces: "false" \ No newline at end of file diff --git a/k8s/helm/locations-api/templates/ingress.yaml b/k8s/helm/locations-api/templates/ingress.yaml new file mode 100644 index 000000000..8c846944e --- /dev/null +++ b/k8s/helm/locations-api/templates/ingress.yaml @@ -0,0 +1,36 @@ +{{- if .Values.ingress.enabled -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.locations }} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ template "locations-api.fullname" . }} + labels: + app: {{ template "locations-api.name" . }} + chart: {{ template "locations-api.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + - {{ .Values.inf.k8s.dns }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $serviceName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/k8s/helm/marketing-api/templates/ingress.yaml b/k8s/helm/marketing-api/templates/ingress.yaml new file mode 100644 index 000000000..7a5b29b12 --- /dev/null +++ b/k8s/helm/marketing-api/templates/ingress.yaml @@ -0,0 +1,36 @@ +{{- if .Values.ingress.enabled -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.marketing }} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ template "marketing-api.fullname" . }} + labels: + app: {{ template "marketing-api.name" . }} + chart: {{ template "marketing-api.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + - {{ .Values.inf.k8s.dns }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $serviceName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/k8s/helm/mobileshoppingagg/templates/ingress.yaml b/k8s/helm/mobileshoppingagg/templates/ingress.yaml new file mode 100644 index 000000000..6c50a574e --- /dev/null +++ b/k8s/helm/mobileshoppingagg/templates/ingress.yaml @@ -0,0 +1,36 @@ +{{- if .Values.ingress.enabled -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.mobileshoppingagg }} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ template "mobileshoppingagg.fullname" . }} + labels: + app: {{ template "mobileshoppingagg.name" . }} + chart: {{ template "mobileshoppingagg.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + - {{ .Values.inf.k8s.dns }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $serviceName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/k8s/helm/webshoppingagg/templates/ingress.yaml b/k8s/helm/webshoppingagg/templates/ingress.yaml new file mode 100644 index 000000000..742db4d30 --- /dev/null +++ b/k8s/helm/webshoppingagg/templates/ingress.yaml @@ -0,0 +1,36 @@ +{{- if .Values.ingress.enabled -}} +{{- $ingressPath := include "pathBase" . -}} +{{- $serviceName := .Values.app.svc.webshoppingagg }} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ template "webshoppingagg.fullname" . }} + labels: + app: {{ template "webshoppingagg.name" . }} + chart: {{ template "webshoppingagg.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + - {{ .Values.inf.k8s.dns }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $serviceName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml b/src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml index 85c7a9f64..1dc21a9f1 100644 --- a/src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml +++ b/src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml @@ -2,9 +2,9 @@ kind: helm-release apiVersion: 1.1 build: context: ..\..\..\..\ - dockerfile: ..\..\..\..\ApiGateways\ApiGw-Base\Dockerfile + dockerfile: ..\..\..\ApiGateways\ApiGw-Base\Dockerfile install: - chart: ../../../../k8s/helm/apigwwm + chart: ../../../../k8s/helm/apigwmm set: replicaCount: 1 image: @@ -15,7 +15,7 @@ install: kubernetes.io/ingress.class: traefik-azds hosts: # This expands to [space.s.]webmvc...aksapp.io - - $(spacePrefix)apigwwm$(hostSuffix) + - $(spacePrefix)apigwmm$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/values.dev.yaml b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/values.dev.yaml new file mode 100644 index 000000000..eaed45149 --- /dev/null +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/values.dev.yaml @@ -0,0 +1,3 @@ +ingress: + enabled: true + tls: [] \ No newline at end of file diff --git a/src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml b/src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml index 6e64cf5cf..01a2e36d1 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml +++ b/src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml @@ -2,7 +2,7 @@ kind: helm-release apiVersion: 1.1 build: context: ..\..\..\..\ - dockerfile: ..\..\..\..\ApiGateways\ApiGw-Base\Dockerfile + dockerfile: ..\..\..\ApiGateways\ApiGw-Base\Dockerfile install: chart: ../../../../k8s/helm/apigwms set: diff --git a/src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml b/src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml index 4d36cad78..a0972d1f4 100644 --- a/src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml +++ b/src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml @@ -2,9 +2,9 @@ kind: helm-release apiVersion: 1.1 build: context: ..\..\..\..\ - dockerfile: ..\..\..\..\ApiGateways\ApiGw-Base\Dockerfile + dockerfile: ..\..\..\ApiGateways\ApiGw-Base\Dockerfile install: - chart: ../../../../k8s/helm/apigwmm + chart: ../../../../k8s/helm/apigwwm set: replicaCount: 1 image: @@ -15,7 +15,7 @@ install: kubernetes.io/ingress.class: traefik-azds hosts: # This expands to [space.s.]webmvc...aksapp.io - - $(spacePrefix)apigwmm$(hostSuffix) + - $(spacePrefix)apigwwm$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml? diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/values.dev.yaml b/src/ApiGateways/Web.Bff.Shopping/aggregator/values.dev.yaml new file mode 100644 index 000000000..45f664d6a --- /dev/null +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/values.dev.yaml @@ -0,0 +1,2 @@ +ocelot: + configPath: /app/configuration \ No newline at end of file diff --git a/src/Services/Basket/Basket.API/values.dev.yaml b/src/Services/Basket/Basket.API/values.dev.yaml new file mode 100644 index 000000000..eaed45149 --- /dev/null +++ b/src/Services/Basket/Basket.API/values.dev.yaml @@ -0,0 +1,3 @@ +ingress: + enabled: true + tls: [] \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/values.dev.yaml b/src/Services/Catalog/Catalog.API/values.dev.yaml new file mode 100644 index 000000000..eaed45149 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/values.dev.yaml @@ -0,0 +1,3 @@ +ingress: + enabled: true + tls: [] \ No newline at end of file diff --git a/src/Services/Identity/Identity.API/Devspaces/DevspacesRedirectUriValidator.cs b/src/Services/Identity/Identity.API/Devspaces/DevspacesRedirectUriValidator.cs new file mode 100644 index 000000000..53e497b59 --- /dev/null +++ b/src/Services/Identity/Identity.API/Devspaces/DevspacesRedirectUriValidator.cs @@ -0,0 +1,31 @@ +using IdentityServer4.Models; +using IdentityServer4.Validation; +using Microsoft.Extensions.Logging; +using System.Threading.Tasks; + + +namespace Microsoft.eShopOnContainers.Services.Identity.API.Devspaces +{ + public class DevspacesRedirectUriValidator : IRedirectUriValidator + { + private readonly ILogger _logger; + public DevspacesRedirectUriValidator(ILogger logger) + { + _logger = logger; + } + + public Task IsPostLogoutRedirectUriValidAsync(string requestedUri, Client client) + { + + _logger.LogInformation($"Client {client.ClientName} used post logout uri {requestedUri}."); + return Task.FromResult(true); + } + + public Task IsRedirectUriValidAsync(string requestedUri, Client client) + { + _logger.LogInformation($"Client {client.ClientName} used redirect uri {requestedUri}."); + return Task.FromResult(true); + } + + } +} \ No newline at end of file diff --git a/src/Services/Identity/Identity.API/Devspaces/IdentityDevspacesBuilderExtensions.cs b/src/Services/Identity/Identity.API/Devspaces/IdentityDevspacesBuilderExtensions.cs new file mode 100644 index 000000000..4dadb0e54 --- /dev/null +++ b/src/Services/Identity/Identity.API/Devspaces/IdentityDevspacesBuilderExtensions.cs @@ -0,0 +1,20 @@ +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.eShopOnContainers.Services.Identity.API.Devspaces +{ + static class IdentityDevspacesBuilderExtensions + { + public static IIdentityServerBuilder AddDevspacesIfNeeded(this IIdentityServerBuilder builder, bool useDevspaces) + { + if (useDevspaces) + { + builder.AddRedirectUriValidator(); + } + return builder; + } + } +} diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs index aa390779e..9f83c6128 100644 --- a/src/Services/Identity/Identity.API/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -13,6 +13,7 @@ using Microsoft.eShopOnContainers.Services.Identity.API.Certificates; using Microsoft.eShopOnContainers.Services.Identity.API.Data; using Microsoft.eShopOnContainers.Services.Identity.API.Models; using Microsoft.eShopOnContainers.Services.Identity.API.Services; +using Microsoft.eShopOnContainers.Services.Identity.API.Devspaces; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -85,6 +86,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API x.IssuerUri = "null"; x.Authentication.CookieLifetime = TimeSpan.FromHours(2); }) + .AddDevspacesIfNeeded(Configuration.GetValue("UseDevspaces", false)) .AddSigningCredential(Certificate.Get()) .AddAspNetIdentity() .AddConfigurationStore(options => diff --git a/src/Services/Identity/Identity.API/values.dev.yaml b/src/Services/Identity/Identity.API/values.dev.yaml new file mode 100644 index 000000000..1d6ef67d3 --- /dev/null +++ b/src/Services/Identity/Identity.API/values.dev.yaml @@ -0,0 +1 @@ +enableDevspaces: "true" diff --git a/src/Services/Location/Locations.API/values.dev.yaml b/src/Services/Location/Locations.API/values.dev.yaml new file mode 100644 index 000000000..eaed45149 --- /dev/null +++ b/src/Services/Location/Locations.API/values.dev.yaml @@ -0,0 +1,3 @@ +ingress: + enabled: true + tls: [] \ No newline at end of file diff --git a/src/Services/Marketing/Marketing.API/values.dev.yaml b/src/Services/Marketing/Marketing.API/values.dev.yaml new file mode 100644 index 000000000..eaed45149 --- /dev/null +++ b/src/Services/Marketing/Marketing.API/values.dev.yaml @@ -0,0 +1,3 @@ +ingress: + enabled: true + tls: [] \ No newline at end of file diff --git a/src/Web/WebMVC/azds.yaml b/src/Web/WebMVC/azds.yaml index 5c95c50ee..69e4f036a 100644 --- a/src/Web/WebMVC/azds.yaml +++ b/src/Web/WebMVC/azds.yaml @@ -16,6 +16,9 @@ install: hosts: # This expands to [space.s.]webmvc...aksapp.io - $(spacePrefix)webmvc$(hostSuffix) + inf: + k8s: + dns: $(spacePrefix)webmvc$(hostSuffix) values: - values.dev.yaml? - secrets.dev.yaml?