From fbf89f8fc77c039eeef952a4b651948933894934 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Tue, 17 Jul 2018 11:04:29 +0200 Subject: [PATCH 1/5] 1st devspaces test --- .../aggregator/Dockerfile.develop | 16 +++++ .../aggregator/Properties/launchSettings.json | 7 ++ .../Mobile.Bff.Shopping/aggregator/azds.yaml | 36 ++++++++++ .../Catalog/Catalog.API/Dockerfile.develop | 25 +++++++ .../Properties/launchSettings.json | 7 ++ src/Services/Catalog/Catalog.API/azds.yaml | 36 ++++++++++ .../Catalog.API/charts/catalogapi/.helmignore | 21 ++++++ .../Catalog.API/charts/catalogapi/Chart.yaml | 5 ++ .../charts/catalogapi/templates/NOTES.txt | 19 +++++ .../charts/catalogapi/templates/_helpers.tpl | 32 +++++++++ .../catalogapi/templates/deployment.yaml | 72 +++++++++++++++++++ .../charts/catalogapi/templates/ingress.yaml | 39 ++++++++++ .../charts/catalogapi/templates/secrets.yaml | 12 ++++ .../charts/catalogapi/templates/service.yaml | 19 +++++ .../Catalog.API/charts/catalogapi/values.yaml | 60 ++++++++++++++++ 15 files changed, 406 insertions(+) create mode 100644 src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop create mode 100644 src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml create mode 100644 src/Services/Catalog/Catalog.API/Dockerfile.develop create mode 100644 src/Services/Catalog/Catalog.API/azds.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml create mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop new file mode 100644 index 000000000..e34f6ac1d --- /dev/null +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop @@ -0,0 +1,16 @@ +FROM microsoft/dotnet:2.1-sdk +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true + +EXPOSE 80 + +WORKDIR /src +COPY ["eShopOnContainers-ServicesAndWebApps.sln", "./"] +COPY ["src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj", "src/ApiGateways/Mobile.Bff.Shopping/aggregator/"] + +RUN dotnet restore -nowarn:msb3202,nu1503 +COPY . . +WORKDIR "/src/src/ApiGateways/Mobile.Bff.Shopping/aggregator" +RUN dotnet build "Mobile.Shopping.HttpAggregator.csproj" + +CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json index 925e70b0d..c259d5094 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json @@ -24,6 +24,13 @@ "ASPNETCORE_ENVIRONMENT": "Development" }, "applicationUrl": "http://localhost:61632/" + }, + "Azure Dev Spaces": { + "commandName": "AzureDevSpaces", + "launchBrowser": true, + "resourceGroup": "eshoptestedu", + "aksName": "eshoptestedu", + "subscriptionId": "e3035ac1-c06c-4daf-8939-57b3c5f1f759" } } } \ No newline at end of file diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml new file mode 100644 index 000000000..dca11afbf --- /dev/null +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml @@ -0,0 +1,36 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: charts/aggregator + values: + - values.dev.yaml? + - secrets.dev.yaml? + set: + image: + tag: $(tag) + pullPolicy: Never + disableProbes: true + ingress: + hosts: + # This expands to [space.s.]aggregator...aksapp.io + - $(spacePrefix)aggregator$(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + container: + syncTarget: /src + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${Configuration:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${Configuration:-Debug}"] diff --git a/src/Services/Catalog/Catalog.API/Dockerfile.develop b/src/Services/Catalog/Catalog.API/Dockerfile.develop new file mode 100644 index 000000000..b9ec5f171 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/Dockerfile.develop @@ -0,0 +1,25 @@ +FROM microsoft/dotnet:2.1-sdk +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true + +EXPOSE 80 + +WORKDIR /src +COPY ["eShopOnContainers-ServicesAndWebApps.sln", "./"] +COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] +COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] +COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] +COPY ["src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj", "src/BuildingBlocks/EventBus/IntegrationEventLogEF/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/Microsoft.Extensions.HealthChecks.AzureStorage.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"] +COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] +COPY ["src/Services/Catalog/Catalog.API/Catalog.API.csproj", "src/Services/Catalog/Catalog.API/"] + +RUN dotnet restore -nowarn:msb3202,nu1503 +COPY . . +WORKDIR "/src/src/Services/Catalog/Catalog.API" +RUN dotnet build "Catalog.API.csproj" + +CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json index 2b21ca280..f5e2b7149 100644 --- a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json +++ b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json @@ -23,6 +23,13 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } + }, + "Azure Dev Spaces": { + "commandName": "AzureDevSpaces", + "launchBrowser": true, + "resourceGroup": "eshoptestedu", + "aksName": "eshoptestedu", + "subscriptionId": "e3035ac1-c06c-4daf-8939-57b3c5f1f759" } } } \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/azds.yaml b/src/Services/Catalog/Catalog.API/azds.yaml new file mode 100644 index 000000000..34397b646 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/azds.yaml @@ -0,0 +1,36 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: charts/catalogapi + values: + - values.dev.yaml? + - secrets.dev.yaml? + set: + image: + tag: $(tag) + pullPolicy: Never + disableProbes: true + ingress: + hosts: + # This expands to [space.s.]catalogapi...aksapp.io + - $(spacePrefix)catalogapi$(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + container: + syncTarget: /src + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${Configuration:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${Configuration:-Debug}"] diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore b/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore new file mode 100644 index 000000000..f0c131944 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml new file mode 100644 index 000000000..1c221148d --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +description: A Helm chart for Kubernetes +name: catalogapi +version: 0.1.0 diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt new file mode 100644 index 000000000..ed8159763 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt @@ -0,0 +1,19 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "catalogapi.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ template "catalogapi.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "catalogapi.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "catalogapi.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:80 +{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl new file mode 100644 index 000000000..908f9d8a3 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "catalogapi.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "catalogapi.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "catalogapi.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml new file mode 100644 index 000000000..1b3777856 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml @@ -0,0 +1,72 @@ +apiVersion: apps/v1beta2 +kind: Deployment +metadata: + name: {{ template "catalogapi.fullname" . }} + labels: + app: {{ template "catalogapi.name" . }} + chart: {{ template "catalogapi.chart" . }} + draft: {{ default "draft-app" .Values.draft }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ template "catalogapi.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ template "catalogapi.name" . }} + draft: {{ default "draft-app" .Values.draft }} + release: {{ .Release.Name }} + annotations: + buildID: {{ .Values.buildID }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + {{- if not .Values.disableProbes }} + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + {{- end }} + env: + {{- $root := . }} + {{- range $ref, $values := .Values.secrets }} + {{- range $key, $value := $values }} + - name: {{ $ref }}_{{ $key }} + valueFrom: + secretKeyRef: + name: {{ template "catalogapi.fullname" $root }}-{{ $ref | lower }} + key: {{ $key }} + {{- end }} + {{- end }} + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- with .Values.imagePullSecrets }} + imagePullSecrets: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml new file mode 100644 index 000000000..b52fc0f37 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml @@ -0,0 +1,39 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "catalogapi.fullname" . -}} +{{- $servicePort := .Values.service.port -}} +{{- $ingressPath := .Values.ingress.path -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + app: {{ template "catalogapi.name" . }} + chart: {{ template "catalogapi.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: + {{- range .hosts }} + - {{ . }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $fullName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml new file mode 100644 index 000000000..e13fb46d3 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml @@ -0,0 +1,12 @@ +{{- $root := . }} +{{- range $name, $values := .Values.secrets }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "catalogapi.fullname" $root }}-{{ $name | lower }} +data: + {{- range $key, $value := $values }} + {{ $key }}: {{ $value | b64enc }} + {{- end }} +--- +{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml new file mode 100644 index 000000000..1c3572dec --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "catalogapi.fullname" . }} + labels: + app: {{ template "catalogapi.name" . }} + chart: {{ template "catalogapi.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + app: {{ template "catalogapi.name" . }} + release: {{ .Release.Name }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml new file mode 100644 index 000000000..5159ffa6e --- /dev/null +++ b/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml @@ -0,0 +1,60 @@ +# Default values for catalogapi. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +fullnameOverride: catalogapi +replicaCount: 1 +image: + repository: catalogapi + tag: stable + pullPolicy: IfNotPresent +imagePullSecrets: [] + # Optionally specify an array of imagePullSecrets. + # Secrets must be manually created in the namespace. + # ref: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod + # + # This uses credentials from secret "myRegistryKeySecretName". + # - name: myRegistryKeySecretName +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + annotations: + kubernetes.io/ingress.class: addon-http-application-routing + # kubernetes.io/tls-acme: "true" + path: / + # hosts: + # - chart-example.local + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local +secrets: {} + # Optionally specify a set of secret objects whose values + # will be injected as environment variables by default. + # You should add this section to a file like secrets.yaml + # that is explicitly NOT committed to source code control + # and then include it as part of your helm install step. + # ref: https://kubernetes.io/docs/concepts/configuration/secret/ + # + # This creates a secret "mysecret" and injects "mypassword" + # as the environment variable mysecret_mypassword=password. + # mysecret: + # mypassword: password +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi +nodeSelector: {} + +tolerations: [] + +affinity: {} \ No newline at end of file From 91d06af314be6f57dcc4cae16ce1a65d6506db0f Mon Sep 17 00:00:00 2001 From: eiximenis Date: Tue, 31 Jul 2018 17:22:27 +0200 Subject: [PATCH 2/5] starting deploys to devspaces --- src/Services/Basket/Basket.API/.dockerignore | 14 ++++ .../Basket/Basket.API/Dockerfile.develop | 21 ++++++ src/Services/Basket/Basket.API/app.yaml | 43 +++++++++++ src/Services/Basket/Basket.API/azds.yaml | 39 ++++++++++ src/Services/Basket/Basket.API/inf.yaml | 18 +++++ .../Catalog/Catalog.API/Dockerfile.develop | 2 +- .../Properties/launchSettings.json | 4 +- src/Services/Catalog/Catalog.API/app.yaml | 39 ++++++++++ src/Services/Catalog/Catalog.API/azds.yaml | 9 ++- .../Catalog.API/charts/catalogapi/.helmignore | 21 ------ .../Catalog.API/charts/catalogapi/Chart.yaml | 5 -- .../charts/catalogapi/templates/NOTES.txt | 19 ----- .../charts/catalogapi/templates/_helpers.tpl | 32 --------- .../catalogapi/templates/deployment.yaml | 72 ------------------- .../charts/catalogapi/templates/ingress.yaml | 39 ---------- .../charts/catalogapi/templates/secrets.yaml | 12 ---- .../charts/catalogapi/templates/service.yaml | 19 ----- .../Catalog.API/charts/catalogapi/values.yaml | 60 ---------------- src/Services/Catalog/Catalog.API/inf.yaml | 25 +++++++ .../Identity/Identity.API/.dockerignore | 14 ++++ .../Identity/Identity.API/Dockerfile.develop | 17 +++++ src/Services/Identity/Identity.API/app.yaml | 39 ++++++++++ src/Services/Identity/Identity.API/azds.yaml | 42 +++++++++++ src/Services/Identity/Identity.API/inf.yaml | 29 ++++++++ .../Ordering/Ordering.API/.dockerignore | 14 ++++ .../Ordering/Ordering.API/Dockerfile.develop | 26 +++++++ src/Services/Ordering/Ordering.API/app.yaml | 43 +++++++++++ src/Services/Ordering/Ordering.API/azds.yaml | 43 +++++++++++ src/Services/Ordering/Ordering.API/inf.yaml | 22 ++++++ 29 files changed, 498 insertions(+), 284 deletions(-) create mode 100644 src/Services/Basket/Basket.API/.dockerignore create mode 100644 src/Services/Basket/Basket.API/Dockerfile.develop create mode 100644 src/Services/Basket/Basket.API/app.yaml create mode 100644 src/Services/Basket/Basket.API/azds.yaml create mode 100644 src/Services/Basket/Basket.API/inf.yaml create mode 100644 src/Services/Catalog/Catalog.API/app.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml delete mode 100644 src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml create mode 100644 src/Services/Catalog/Catalog.API/inf.yaml create mode 100644 src/Services/Identity/Identity.API/.dockerignore create mode 100644 src/Services/Identity/Identity.API/Dockerfile.develop create mode 100644 src/Services/Identity/Identity.API/app.yaml create mode 100644 src/Services/Identity/Identity.API/azds.yaml create mode 100644 src/Services/Identity/Identity.API/inf.yaml create mode 100644 src/Services/Ordering/Ordering.API/.dockerignore create mode 100644 src/Services/Ordering/Ordering.API/Dockerfile.develop create mode 100644 src/Services/Ordering/Ordering.API/app.yaml create mode 100644 src/Services/Ordering/Ordering.API/azds.yaml create mode 100644 src/Services/Ordering/Ordering.API/inf.yaml diff --git a/src/Services/Basket/Basket.API/.dockerignore b/src/Services/Basket/Basket.API/.dockerignore new file mode 100644 index 000000000..04f7b133d --- /dev/null +++ b/src/Services/Basket/Basket.API/.dockerignore @@ -0,0 +1,14 @@ +.dockerignore +.git +.gitignore +.vs +.vscode +**/*.*proj.user +**/azds.yaml +**/bin +**/charts +**/Dockerfile +**/Dockerfile.develop +**/obj +**/secrets.dev.yaml +**/values.dev.yaml \ No newline at end of file diff --git a/src/Services/Basket/Basket.API/Dockerfile.develop b/src/Services/Basket/Basket.API/Dockerfile.develop new file mode 100644 index 000000000..b7d715b28 --- /dev/null +++ b/src/Services/Basket/Basket.API/Dockerfile.develop @@ -0,0 +1,21 @@ +FROM microsoft/dotnet:2.1-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src + +COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] +COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] +COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"] +COPY ["src/Services/Basket/Basket.API/Basket.API.csproj", "src/Services/Basket/Basket.API/"] + +RUN dotnet restore src/Services/Basket/Basket.API/Basket.API.csproj -nowarn:msb3202,nu1503 +COPY . . +WORKDIR /src/src/Services/Basket/Basket.API +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION + +CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file diff --git a/src/Services/Basket/Basket.API/app.yaml b/src/Services/Basket/Basket.API/app.yaml new file mode 100644 index 000000000..6ca5d9d31 --- /dev/null +++ b/src/Services/Basket/Basket.API/app.yaml @@ -0,0 +1,43 @@ +# This heml values file defines app-based settings +# Charts use those values, so this file **MUST** be included in all chart releases + + +app: # app global settings + name: "my-eshop" # Override for custom app name + ingress: # ingress related settings + entries: + basket: basket-api # ingress entry for basket api + catalog: catalog-api # ingress entry for catalog api + ordering: ordering-api # ingress entry for ordering api + identity: identity # ingress entry for identity api + mvc: webmvc # ingress entry for web mvc + spa: "" # ingress entry for web spa + status: webstatus # ingress entry for web status + webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw + webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw + webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator + payment: payment-api # ingress entry for payment api + locations: locations-api # ingress entry for locations api + marketing: marketing-api # ingress entry for marketing api + svc: + basket: basket # service name for basket api + catalog: catalog # service name for catalog api + ordering: ordering # service name for ordering api + orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks + orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub + identity: identity # service name for identity api + mvc: webmvc # service name for web mvc + spa: webspa # service name for web spa + status: webstatus # service name for web status + webshoppingapigw: webshoppingapigw # service name for web shopping Agw + webmarketingapigw: webmarketingapigw # service name for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw + webshoppingagg: webshoppingagg # service name for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator + payment: payment # service name for payment api + locations: locations # service name for locations api + marketing: marketing # service name for marketing ap diff --git a/src/Services/Basket/Basket.API/azds.yaml b/src/Services/Basket/Basket.API/azds.yaml new file mode 100644 index 000000000..597c79d8c --- /dev/null +++ b/src/Services/Basket/Basket.API/azds.yaml @@ -0,0 +1,39 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: ../../../../k8s/helm/basket-api + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + ingress: + hosts: + # This expands to [space.s.]basketapi...aksapp.io + - $(spacePrefix)basketapi$(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] diff --git a/src/Services/Basket/Basket.API/inf.yaml b/src/Services/Basket/Basket.API/inf.yaml new file mode 100644 index 000000000..3e3e143da --- /dev/null +++ b/src/Services/Basket/Basket.API/inf.yaml @@ -0,0 +1,18 @@ +# This heml values file defines all infrastructure used by eShopOnContainers. +# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment + +inf: + redis: # inf.redis defines the redis' connection strings + basket: + svc: basket-data # Name of k8s svc for basket redis + constr: basket-data # Connection string to Redis used by Basket API + eventbus: + svc: rabbitmq # Name of k8s svc for rabbitmq + constr: rabbitmq # Event bus connection string + useAzure: false # true if use Azure Service Bus. False if RabbitMQ + appinsights: + key: "" # App insights to use + k8s: {} + misc: # inf.misc contains miscellaneous configuration related to infrastructure + useLoadTest: false # If running under loading test or not + useAzureStorage: false # If catalog api uses azure storage or not diff --git a/src/Services/Catalog/Catalog.API/Dockerfile.develop b/src/Services/Catalog/Catalog.API/Dockerfile.develop index b9ec5f171..b62c7f6e3 100644 --- a/src/Services/Catalog/Catalog.API/Dockerfile.develop +++ b/src/Services/Catalog/Catalog.API/Dockerfile.develop @@ -17,7 +17,7 @@ COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Mic COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] COPY ["src/Services/Catalog/Catalog.API/Catalog.API.csproj", "src/Services/Catalog/Catalog.API/"] -RUN dotnet restore -nowarn:msb3202,nu1503 +RUN dotnet restore src/Services/Catalog/Catalog.API/Catalog.API.csproj -nowarn:msb3202,nu1503 COPY . . WORKDIR "/src/src/Services/Catalog/Catalog.API" RUN dotnet build "Catalog.API.csproj" diff --git a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json index f5e2b7149..598254915 100644 --- a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json +++ b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json @@ -27,8 +27,8 @@ "Azure Dev Spaces": { "commandName": "AzureDevSpaces", "launchBrowser": true, - "resourceGroup": "eshoptestedu", - "aksName": "eshoptestedu", + "resourceGroup": "edu-devspaces3", + "aksName": "edu-devspaces3", "subscriptionId": "e3035ac1-c06c-4daf-8939-57b3c5f1f759" } } diff --git a/src/Services/Catalog/Catalog.API/app.yaml b/src/Services/Catalog/Catalog.API/app.yaml new file mode 100644 index 000000000..c6209da47 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/app.yaml @@ -0,0 +1,39 @@ +app: # app global settings + name: "my-eshop" # Override for custom app name + ingress: # ingress related settings + entries: + basket: basket-api # ingress entry for basket api + catalog: catalog-api # ingress entry for catalog api + ordering: ordering-api # ingress entry for ordering api + identity: identity # ingress entry for identity api + mvc: webmvc # ingress entry for web mvc + spa: "" # ingress entry for web spa + status: webstatus # ingress entry for web status + webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw + webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw + webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator + payment: payment-api # ingress entry for payment api + locations: locations-api # ingress entry for locations api + marketing: marketing-api # ingress entry for marketing api + svc: + basket: basket # service name for basket api + catalog: catalog # service name for catalog api + ordering: ordering # service name for ordering api + orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks + orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub + identity: identity # service name for identity api + mvc: webmvc # service name for web mvc + spa: webspa # service name for web spa + status: webstatus # service name for web status + webshoppingapigw: webshoppingapigw # service name for web shopping Agw + webmarketingapigw: webmarketingapigw # service name for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw + webshoppingagg: webshoppingagg # service name for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator + payment: payment # service name for payment api + locations: locations # service name for locations api + marketing: marketing # service name for marketing api \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/azds.yaml b/src/Services/Catalog/Catalog.API/azds.yaml index 34397b646..7ea0ae087 100644 --- a/src/Services/Catalog/Catalog.API/azds.yaml +++ b/src/Services/Catalog/Catalog.API/azds.yaml @@ -4,19 +4,24 @@ build: context: ..\..\..\.. dockerfile: Dockerfile install: - chart: charts/catalogapi + chart: ../../../../k8s/helm/catalog-api values: - values.dev.yaml? - secrets.dev.yaml? + - inf.yaml + - app.yaml set: image: tag: $(tag) pullPolicy: Never + inf: + k8s: + dns: "$(spacePrefix)basketapi$(hostSuffix)" disableProbes: true ingress: hosts: # This expands to [space.s.]catalogapi...aksapp.io - - $(spacePrefix)catalogapi$(hostSuffix) + - $(spacePrefix)basketapi$(hostSuffix) configurations: develop: build: diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore b/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore deleted file mode 100644 index f0c131944..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml deleted file mode 100644 index 1c221148d..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -appVersion: "1.0" -description: A Helm chart for Kubernetes -name: catalogapi -version: 0.1.0 diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt deleted file mode 100644 index ed8159763..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/NOTES.txt +++ /dev/null @@ -1,19 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range .Values.ingress.hosts }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "catalogapi.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get svc -w {{ template "catalogapi.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "catalogapi.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "catalogapi.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl deleted file mode 100644 index 908f9d8a3..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/_helpers.tpl +++ /dev/null @@ -1,32 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "catalogapi.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "catalogapi.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "catalogapi.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml deleted file mode 100644 index 1b3777856..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/deployment.yaml +++ /dev/null @@ -1,72 +0,0 @@ -apiVersion: apps/v1beta2 -kind: Deployment -metadata: - name: {{ template "catalogapi.fullname" . }} - labels: - app: {{ template "catalogapi.name" . }} - chart: {{ template "catalogapi.chart" . }} - draft: {{ default "draft-app" .Values.draft }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app: {{ template "catalogapi.name" . }} - release: {{ .Release.Name }} - template: - metadata: - labels: - app: {{ template "catalogapi.name" . }} - draft: {{ default "draft-app" .Values.draft }} - release: {{ .Release.Name }} - annotations: - buildID: {{ .Values.buildID }} - spec: - containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: http - containerPort: 80 - protocol: TCP - {{- if not .Values.disableProbes }} - livenessProbe: - httpGet: - path: / - port: http - readinessProbe: - httpGet: - path: / - port: http - {{- end }} - env: - {{- $root := . }} - {{- range $ref, $values := .Values.secrets }} - {{- range $key, $value := $values }} - - name: {{ $ref }}_{{ $key }} - valueFrom: - secretKeyRef: - name: {{ template "catalogapi.fullname" $root }}-{{ $ref | lower }} - key: {{ $key }} - {{- end }} - {{- end }} - resources: -{{ toYaml .Values.resources | indent 12 }} - {{- with .Values.imagePullSecrets }} - imagePullSecrets: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: -{{ toYaml . | indent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: -{{ toYaml . | indent 8 }} - {{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml deleted file mode 100644 index b52fc0f37..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/ingress.yaml +++ /dev/null @@ -1,39 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "catalogapi.fullname" . -}} -{{- $servicePort := .Values.service.port -}} -{{- $ingressPath := .Values.ingress.path -}} -apiVersion: extensions/v1beta1 -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - app: {{ template "catalogapi.name" . }} - chart: {{ template "catalogapi.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: - {{- range .hosts }} - - {{ . }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ . }} - http: - paths: - - path: {{ $ingressPath }} - backend: - serviceName: {{ $fullName }} - servicePort: http - {{- end }} -{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml deleted file mode 100644 index e13fb46d3..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/secrets.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- $root := . }} -{{- range $name, $values := .Values.secrets }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ template "catalogapi.fullname" $root }}-{{ $name | lower }} -data: - {{- range $key, $value := $values }} - {{ $key }}: {{ $value | b64enc }} - {{- end }} ---- -{{- end }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml deleted file mode 100644 index 1c3572dec..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/templates/service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "catalogapi.fullname" . }} - labels: - app: {{ template "catalogapi.name" . }} - chart: {{ template "catalogapi.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - app: {{ template "catalogapi.name" . }} - release: {{ .Release.Name }} diff --git a/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml b/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml deleted file mode 100644 index 5159ffa6e..000000000 --- a/src/Services/Catalog/Catalog.API/charts/catalogapi/values.yaml +++ /dev/null @@ -1,60 +0,0 @@ -# Default values for catalogapi. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. -fullnameOverride: catalogapi -replicaCount: 1 -image: - repository: catalogapi - tag: stable - pullPolicy: IfNotPresent -imagePullSecrets: [] - # Optionally specify an array of imagePullSecrets. - # Secrets must be manually created in the namespace. - # ref: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod - # - # This uses credentials from secret "myRegistryKeySecretName". - # - name: myRegistryKeySecretName -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - annotations: - kubernetes.io/ingress.class: addon-http-application-routing - # kubernetes.io/tls-acme: "true" - path: / - # hosts: - # - chart-example.local - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local -secrets: {} - # Optionally specify a set of secret objects whose values - # will be injected as environment variables by default. - # You should add this section to a file like secrets.yaml - # that is explicitly NOT committed to source code control - # and then include it as part of your helm install step. - # ref: https://kubernetes.io/docs/concepts/configuration/secret/ - # - # This creates a secret "mysecret" and injects "mypassword" - # as the environment variable mysecret_mypassword=password. - # mysecret: - # mypassword: password -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi -nodeSelector: {} - -tolerations: [] - -affinity: {} \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/inf.yaml b/src/Services/Catalog/Catalog.API/inf.yaml new file mode 100644 index 000000000..74a7762c4 --- /dev/null +++ b/src/Services/Catalog/Catalog.API/inf.yaml @@ -0,0 +1,25 @@ +# This heml values file defines all infrastructure used by eShopOnContainers. +# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment + +inf: + sql: # inf.sql defines the sql server databases & logins +# host: my-sql-server # Uncomment to specify a custom sql-server to be used. By default "sql-data-" will be used + common: + user: sa # SQL user + pwd: Pass@word # SQL pwd + pid: Developer + catalog: # inf.sql.catalog: settings for the catalog-api sql (user, pwd, db) + db: CatalogDb # Catalog API SQL db name + keystore: + svc: keystore-data # Name of k8s svc for keystore-data redis + constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) + eventbus: + svc: rabbitmq # Name of k8s svc for rabbitmq + constr: rabbitmq # Event bus connection string + useAzure: false # true if use Azure Service Bus. False if RabbitMQ + appinsights: + key: "" # App insights to use + k8s: {} + misc: # inf.misc contains miscellaneous configuration related to infrastructure + useLoadTest: false # If running under loading test or not + useAzureStorage: false # If catalog api uses azure storage or not \ No newline at end of file diff --git a/src/Services/Identity/Identity.API/.dockerignore b/src/Services/Identity/Identity.API/.dockerignore new file mode 100644 index 000000000..04f7b133d --- /dev/null +++ b/src/Services/Identity/Identity.API/.dockerignore @@ -0,0 +1,14 @@ +.dockerignore +.git +.gitignore +.vs +.vscode +**/*.*proj.user +**/azds.yaml +**/bin +**/charts +**/Dockerfile +**/Dockerfile.develop +**/obj +**/secrets.dev.yaml +**/values.dev.yaml \ No newline at end of file diff --git a/src/Services/Identity/Identity.API/Dockerfile.develop b/src/Services/Identity/Identity.API/Dockerfile.develop new file mode 100644 index 000000000..e2083dd40 --- /dev/null +++ b/src/Services/Identity/Identity.API/Dockerfile.develop @@ -0,0 +1,17 @@ +FROM microsoft/dotnet:2.1-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src +COPY ["src/Services/Identity/Identity.API/Identity.API.csproj", "src/Services/Identity/Identity.API/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/"] +COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] +RUN dotnet restore src/Services/Identity/Identity.API/Identity.API.csproj +COPY . . +WORKDIR "/src/src/Services/Identity/Identity.API" +RUN dotnet build "Identity.API.csproj" + +CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] diff --git a/src/Services/Identity/Identity.API/app.yaml b/src/Services/Identity/Identity.API/app.yaml new file mode 100644 index 000000000..c6209da47 --- /dev/null +++ b/src/Services/Identity/Identity.API/app.yaml @@ -0,0 +1,39 @@ +app: # app global settings + name: "my-eshop" # Override for custom app name + ingress: # ingress related settings + entries: + basket: basket-api # ingress entry for basket api + catalog: catalog-api # ingress entry for catalog api + ordering: ordering-api # ingress entry for ordering api + identity: identity # ingress entry for identity api + mvc: webmvc # ingress entry for web mvc + spa: "" # ingress entry for web spa + status: webstatus # ingress entry for web status + webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw + webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw + webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator + payment: payment-api # ingress entry for payment api + locations: locations-api # ingress entry for locations api + marketing: marketing-api # ingress entry for marketing api + svc: + basket: basket # service name for basket api + catalog: catalog # service name for catalog api + ordering: ordering # service name for ordering api + orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks + orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub + identity: identity # service name for identity api + mvc: webmvc # service name for web mvc + spa: webspa # service name for web spa + status: webstatus # service name for web status + webshoppingapigw: webshoppingapigw # service name for web shopping Agw + webmarketingapigw: webmarketingapigw # service name for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw + webshoppingagg: webshoppingagg # service name for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator + payment: payment # service name for payment api + locations: locations # service name for locations api + marketing: marketing # service name for marketing api \ No newline at end of file diff --git a/src/Services/Identity/Identity.API/azds.yaml b/src/Services/Identity/Identity.API/azds.yaml new file mode 100644 index 000000000..7d1a00460 --- /dev/null +++ b/src/Services/Identity/Identity.API/azds.yaml @@ -0,0 +1,42 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: ../../../../k8s/helm/identity-api + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + inf: + k8s: + dns: "$(spacePrefix)identity$(hostSuffix)" + ingress: + hosts: + # This expands to [space.s.]identity...aksapp.io + - $(spacePrefix)identity(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] diff --git a/src/Services/Identity/Identity.API/inf.yaml b/src/Services/Identity/Identity.API/inf.yaml new file mode 100644 index 000000000..a4c4b08ef --- /dev/null +++ b/src/Services/Identity/Identity.API/inf.yaml @@ -0,0 +1,29 @@ +# This heml values file defines all infrastructure used by eShopOnContainers. +# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment + +inf: + sql: # inf.sql defines the sql server databases & logins +# host: my-sql-server # Uncomment to specify a custom sql-server to be used. By default "sql-data-" will be used + common: + user: sa # SQL user + pwd: Pass@word # SQL pwd + pid: Developer + identity: + db: IdentityDb # Ordering API SQL db name + keystore: + svc: keystore-data # Name of k8s svc for keystore-data redis + constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) + redis: # inf.redis defines the redis' connection strings + keystore: + svc: keystore-data # Name of k8s svc for keystore-data redis + constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) + eventbus: + svc: rabbitmq # Name of k8s svc for rabbitmq + constr: rabbitmq # Event bus connection string + useAzure: false # true if use Azure Service Bus. False if RabbitMQ + appinsights: + key: "" # App insights to use + k8s: {} + misc: # inf.misc contains miscellaneous configuration related to infrastructure + useLoadTest: false # If running under loading test or not + useAzureStorage: false # If catalog api uses azure storage or not \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/.dockerignore b/src/Services/Ordering/Ordering.API/.dockerignore new file mode 100644 index 000000000..04f7b133d --- /dev/null +++ b/src/Services/Ordering/Ordering.API/.dockerignore @@ -0,0 +1,14 @@ +.dockerignore +.git +.gitignore +.vs +.vscode +**/*.*proj.user +**/azds.yaml +**/bin +**/charts +**/Dockerfile +**/Dockerfile.develop +**/obj +**/secrets.dev.yaml +**/values.dev.yaml \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/Dockerfile.develop b/src/Services/Ordering/Ordering.API/Dockerfile.develop new file mode 100644 index 000000000..5f4cd3486 --- /dev/null +++ b/src/Services/Ordering/Ordering.API/Dockerfile.develop @@ -0,0 +1,26 @@ +FROM microsoft/dotnet:2.1-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src +COPY ["Ordering.API.csproj", "./"] +COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] +COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] +COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] +COPY ["src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj", "src/BuildingBlocks/EventBus/IntegrationEventLogEF/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"] +COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"] +COPY ["src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj", "src/Services/Ordering/Ordering.Domain/"] +COPY ["src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj", "src/Services/Ordering/Ordering.Infrastructure/"] +COPY ["src/Services/Ordering/Ordering.API/Ordering.API.csproj", "src/Services/Ordering/Ordering.API/"] + +RUN dotnet restore src/Services/Ordering/Ordering.API/Ordering.API.csproj +COPY . . +WORKDIR /src/src/Services/Ordering/Ordering.API +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION + +CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/app.yaml b/src/Services/Ordering/Ordering.API/app.yaml new file mode 100644 index 000000000..6ca5d9d31 --- /dev/null +++ b/src/Services/Ordering/Ordering.API/app.yaml @@ -0,0 +1,43 @@ +# This heml values file defines app-based settings +# Charts use those values, so this file **MUST** be included in all chart releases + + +app: # app global settings + name: "my-eshop" # Override for custom app name + ingress: # ingress related settings + entries: + basket: basket-api # ingress entry for basket api + catalog: catalog-api # ingress entry for catalog api + ordering: ordering-api # ingress entry for ordering api + identity: identity # ingress entry for identity api + mvc: webmvc # ingress entry for web mvc + spa: "" # ingress entry for web spa + status: webstatus # ingress entry for web status + webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw + webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw + webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator + payment: payment-api # ingress entry for payment api + locations: locations-api # ingress entry for locations api + marketing: marketing-api # ingress entry for marketing api + svc: + basket: basket # service name for basket api + catalog: catalog # service name for catalog api + ordering: ordering # service name for ordering api + orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks + orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub + identity: identity # service name for identity api + mvc: webmvc # service name for web mvc + spa: webspa # service name for web spa + status: webstatus # service name for web status + webshoppingapigw: webshoppingapigw # service name for web shopping Agw + webmarketingapigw: webmarketingapigw # service name for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw + webshoppingagg: webshoppingagg # service name for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator + payment: payment # service name for payment api + locations: locations # service name for locations api + marketing: marketing # service name for marketing ap diff --git a/src/Services/Ordering/Ordering.API/azds.yaml b/src/Services/Ordering/Ordering.API/azds.yaml new file mode 100644 index 000000000..b81f9d773 --- /dev/null +++ b/src/Services/Ordering/Ordering.API/azds.yaml @@ -0,0 +1,43 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\.. + dockerfile: Dockerfile +install: + chart: ../../../../k8s/helm/ordering-api + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml + + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + inf: + k8s: + dns: "$(spacePrefix)orderingapi$(hostSuffix)" + ingress: + hosts: + # This expands to [space.s.]orderingapi...aksapp.io + - $(spacePrefix)orderingapi$(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] diff --git a/src/Services/Ordering/Ordering.API/inf.yaml b/src/Services/Ordering/Ordering.API/inf.yaml new file mode 100644 index 000000000..943ec99fb --- /dev/null +++ b/src/Services/Ordering/Ordering.API/inf.yaml @@ -0,0 +1,22 @@ +# This heml values file defines all infrastructure used by eShopOnContainers. +# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment + +inf: + sql: # inf.sql defines the sql server databases & logins +# host: my-sql-server # Uncomment to specify a custom sql-server to be used. By default "sql-data-" will be used + common: + user: sa # SQL user + pwd: Pass@word # SQL pwd + pid: Developer + ordering: # inf.sql.ordering: settings for the ordering-api sql (user, pwd, db) + db: OrderingDb # Ordering API SQL db name + eventbus: + svc: rabbitmq # Name of k8s svc for rabbitmq + constr: rabbitmq # Event bus connection string + useAzure: false # true if use Azure Service Bus. False if RabbitMQ + appinsights: + key: "" # App insights to use + k8s: {} + misc: # inf.misc contains miscellaneous configuration related to infrastructure + useLoadTest: false # If running under loading test or not + useAzureStorage: false # If catalog api uses azure storage or not From cfc1df7c564dc889be95fb371d5bc4b9ab81e618 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Thu, 2 Aug 2018 17:05:11 +0200 Subject: [PATCH 3/5] odering.api dockerfile.develop --- src/Services/Ordering/Ordering.API/Dockerfile.develop | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Services/Ordering/Ordering.API/Dockerfile.develop b/src/Services/Ordering/Ordering.API/Dockerfile.develop index 5f4cd3486..2106ff3da 100644 --- a/src/Services/Ordering/Ordering.API/Dockerfile.develop +++ b/src/Services/Ordering/Ordering.API/Dockerfile.develop @@ -5,7 +5,6 @@ ENV DOTNET_USE_POLLING_FILE_WATCHER=true EXPOSE 80 WORKDIR /src -COPY ["Ordering.API.csproj", "./"] COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"] COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"] COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"] From 1b89edec1517080293f5773fd08ec9a40e958a64 Mon Sep 17 00:00:00 2001 From: eiximenis Date: Wed, 29 Aug 2018 11:27:03 +0200 Subject: [PATCH 4/5] mvc devspace --- k8s/helm/webmvc/templates/configmap.yaml | 1 - src/Services/Catalog/Catalog.API/inf.yaml | 1 + src/Services/Identity/Identity.API/inf.yaml | 3 -- src/Web/WebMVC/.dockerignore | 14 +++++++ src/Web/WebMVC/Dockerfile.develop | 16 ++++++++ src/Web/WebMVC/app.yaml | 39 +++++++++++++++++++ src/Web/WebMVC/azds.yaml | 42 +++++++++++++++++++++ src/Web/WebMVC/inf.yaml | 24 ++++++++++++ src/Web/WebMVC/package-lock.json | 2 +- 9 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 src/Web/WebMVC/.dockerignore create mode 100644 src/Web/WebMVC/Dockerfile.develop create mode 100644 src/Web/WebMVC/app.yaml create mode 100644 src/Web/WebMVC/azds.yaml create mode 100644 src/Web/WebMVC/inf.yaml diff --git a/k8s/helm/webmvc/templates/configmap.yaml b/k8s/helm/webmvc/templates/configmap.yaml index 9d120fe7b..871f6c24e 100644 --- a/k8s/helm/webmvc/templates/configmap.yaml +++ b/k8s/helm/webmvc/templates/configmap.yaml @@ -2,7 +2,6 @@ {{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}} {{- $webshoppingapigw := include "url-of" (list .Values.app.ingress.entries.webshoppingapigw .) -}} {{- $mvc := include "url-of" (list .Values.app.ingress.entries.mvc .) -}} -{{- $mongo := include "mongo-name" . -}} apiVersion: v1 diff --git a/src/Services/Catalog/Catalog.API/inf.yaml b/src/Services/Catalog/Catalog.API/inf.yaml index 74a7762c4..18e2c04bf 100644 --- a/src/Services/Catalog/Catalog.API/inf.yaml +++ b/src/Services/Catalog/Catalog.API/inf.yaml @@ -10,6 +10,7 @@ inf: pid: Developer catalog: # inf.sql.catalog: settings for the catalog-api sql (user, pwd, db) db: CatalogDb # Catalog API SQL db name + redis: keystore: svc: keystore-data # Name of k8s svc for keystore-data redis constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) diff --git a/src/Services/Identity/Identity.API/inf.yaml b/src/Services/Identity/Identity.API/inf.yaml index a4c4b08ef..dba30032b 100644 --- a/src/Services/Identity/Identity.API/inf.yaml +++ b/src/Services/Identity/Identity.API/inf.yaml @@ -10,9 +10,6 @@ inf: pid: Developer identity: db: IdentityDb # Ordering API SQL db name - keystore: - svc: keystore-data # Name of k8s svc for keystore-data redis - constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) redis: # inf.redis defines the redis' connection strings keystore: svc: keystore-data # Name of k8s svc for keystore-data redis diff --git a/src/Web/WebMVC/.dockerignore b/src/Web/WebMVC/.dockerignore new file mode 100644 index 000000000..04f7b133d --- /dev/null +++ b/src/Web/WebMVC/.dockerignore @@ -0,0 +1,14 @@ +.dockerignore +.git +.gitignore +.vs +.vscode +**/*.*proj.user +**/azds.yaml +**/bin +**/charts +**/Dockerfile +**/Dockerfile.develop +**/obj +**/secrets.dev.yaml +**/values.dev.yaml \ No newline at end of file diff --git a/src/Web/WebMVC/Dockerfile.develop b/src/Web/WebMVC/Dockerfile.develop new file mode 100644 index 000000000..16041dc97 --- /dev/null +++ b/src/Web/WebMVC/Dockerfile.develop @@ -0,0 +1,16 @@ +FROM microsoft/dotnet:2.1-sdk +ARG BUILD_CONFIGURATION=Debug +ENV ASPNETCORE_ENVIRONMENT=Development +ENV DOTNET_USE_POLLING_FILE_WATCHER=true +EXPOSE 80 + +WORKDIR /src +COPY ["src/Web/WebMVC/WebMVC.csproj", "src/Web/WebMVC/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/"] +COPY ["src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj", "src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/"] +RUN dotnet restore "src/Web/WebMVC/WebMVC.csproj" +COPY . . +WORKDIR "/src/src/Web/WebMVC" +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION + +ENTRYPOINT ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"] \ No newline at end of file diff --git a/src/Web/WebMVC/app.yaml b/src/Web/WebMVC/app.yaml new file mode 100644 index 000000000..c6209da47 --- /dev/null +++ b/src/Web/WebMVC/app.yaml @@ -0,0 +1,39 @@ +app: # app global settings + name: "my-eshop" # Override for custom app name + ingress: # ingress related settings + entries: + basket: basket-api # ingress entry for basket api + catalog: catalog-api # ingress entry for catalog api + ordering: ordering-api # ingress entry for ordering api + identity: identity # ingress entry for identity api + mvc: webmvc # ingress entry for web mvc + spa: "" # ingress entry for web spa + status: webstatus # ingress entry for web status + webshoppingapigw: webshoppingapigw # ingress entry for web shopping Agw + webmarketingapigw: webmarketingapigw # ingress entry for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # ingress entry for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # ingress entry for mobile shopping Agw + webshoppingagg: webshoppingagg # ingress entry for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # ingress entry for mobile shopping aggregator + payment: payment-api # ingress entry for payment api + locations: locations-api # ingress entry for locations api + marketing: marketing-api # ingress entry for marketing api + svc: + basket: basket # service name for basket api + catalog: catalog # service name for catalog api + ordering: ordering # service name for ordering api + orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks + orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub + identity: identity # service name for identity api + mvc: webmvc # service name for web mvc + spa: webspa # service name for web spa + status: webstatus # service name for web status + webshoppingapigw: webshoppingapigw # service name for web shopping Agw + webmarketingapigw: webmarketingapigw # service name for web mkg Agw + mobilemarketingapigw: mobilemarketingapigw # service name for mobile mkg Agw + mobileshoppingapigw: mobileshoppingapigw # service name for mobile shopping Agw + webshoppingagg: webshoppingagg # service name for web shopping aggregator + mobileshoppingagg: mobileshoppingagg # service name for mobile shopping aggregator + payment: payment # service name for payment api + locations: locations # service name for locations api + marketing: marketing # service name for marketing api \ No newline at end of file diff --git a/src/Web/WebMVC/azds.yaml b/src/Web/WebMVC/azds.yaml new file mode 100644 index 000000000..438b36f0d --- /dev/null +++ b/src/Web/WebMVC/azds.yaml @@ -0,0 +1,42 @@ +kind: helm-release +apiVersion: 1.0 +build: + context: ..\..\..\ + dockerfile: Dockerfile +install: + chart: ../../../k8s/helm/webmvc + values: + - values.dev.yaml? + - secrets.dev.yaml? + - inf.yaml + - app.yaml + set: + replicaCount: 1 + image: + tag: $(tag) + pullPolicy: Never + inf: + k8s: + dns: "$(spacePrefix)webmvc$(hostSuffix)" + ingress: + hosts: + # This expands to [space.s.]webmvc...aksapp.io + - $(spacePrefix)webmvc$(hostSuffix) +configurations: + develop: + build: + dockerfile: Dockerfile.develop + useGitIgnore: true + args: + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug} + container: + sync: + - "**/Pages/**" + - "**/Views/**" + - "**/wwwroot/**" + - "!**/*.{sln,csproj}" + command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"] + iterate: + processesToKill: [dotnet, vsdbg] + buildCommands: + - [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"] diff --git a/src/Web/WebMVC/inf.yaml b/src/Web/WebMVC/inf.yaml new file mode 100644 index 000000000..9df900bae --- /dev/null +++ b/src/Web/WebMVC/inf.yaml @@ -0,0 +1,24 @@ +# This heml values file defines all infrastructure used by eShopOnContainers. +# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment + +inf: + redis: + keystore: + svc: keystore-data # Name of k8s svc for keystore-data redis + constr: keystore-data # Connection string to Redis used as a Keystore (by Identity API) + appinsights: + key: "" # App insights to use + k8s: {} + eventbus: + svc: rabbitmq # Name of k8s svc for rabbitmq + constr: rabbitmq # Event bus connection string + useAzure: false # true if use Azure Service Bus. False if RabbitMQ + misc: # inf.misc contains miscellaneous configuration related to infrastructure + useLoadTest: false # If running under loading test or not + useAzureStorage: false # If catalog api uses azure storage or not + +ingress: + annotations: + kubernetes.io/ingress.class: addon-http-application-routing + ingress.kubernetes.io/ssl-redirect: "false" + nginx.ingress.kubernetes.io/ssl-redirect: "false" \ No newline at end of file diff --git a/src/Web/WebMVC/package-lock.json b/src/Web/WebMVC/package-lock.json index a94ca154f..785fd8273 100644 --- a/src/Web/WebMVC/package-lock.json +++ b/src/Web/WebMVC/package-lock.json @@ -19,7 +19,7 @@ "resolved": "https://registry.npmjs.org/toastr/-/toastr-2.1.4.tgz", "integrity": "sha1-i0O+ZPudDEFIcURvLbjoyk6V8YE=", "requires": { - "jquery": "3.3.1" + "jquery": ">=1.12.0" } } } From b95a4874495040d5eae2297d5794a5df67e6b3aa Mon Sep 17 00:00:00 2001 From: eiximenis Date: Mon, 1 Oct 2018 17:32:53 +0200 Subject: [PATCH 5/5] WIP on devspaces --- .../Mobile.Bff.Shopping/aggregator/Dockerfile.develop | 5 ++--- .../Mobile.Bff.Shopping/aggregator/azds.yaml | 11 ++++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop index e34f6ac1d..10ef2c3d4 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop @@ -5,12 +5,11 @@ ENV DOTNET_USE_POLLING_FILE_WATCHER=true EXPOSE 80 WORKDIR /src -COPY ["eShopOnContainers-ServicesAndWebApps.sln", "./"] COPY ["src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj", "src/ApiGateways/Mobile.Bff.Shopping/aggregator/"] -RUN dotnet restore -nowarn:msb3202,nu1503 +RUN dotnet restore src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj -nowarn:msb3202,nu1503 COPY . . WORKDIR "/src/src/ApiGateways/Mobile.Bff.Shopping/aggregator" -RUN dotnet build "Mobile.Shopping.HttpAggregator.csproj" +RUN dotnet build --no-restore -c $BUILD_CONFIGURATION CMD ["dotnet", "run", "--no-restore", "--no-build", "--no-launch-profile"] \ No newline at end of file diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml index dca11afbf..6537b476e 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml @@ -4,19 +4,24 @@ build: context: ..\..\..\.. dockerfile: Dockerfile install: - chart: charts/aggregator + chart: ../../../../k8s/helm/apigwms values: - values.dev.yaml? - secrets.dev.yaml? + - ..\..\..\..\k8s\helm\app.yaml + - ..\..\..\..\k8s\helm\inf.yaml set: image: tag: $(tag) pullPolicy: Never + inf: + k8s: + dns: "$(spacePrefix)apigwms$(hostSuffix)" disableProbes: true ingress: hosts: - # This expands to [space.s.]aggregator...aksapp.io - - $(spacePrefix)aggregator$(hostSuffix) + # This expands to [space.s.]apigwms...aksapp.io + - $(spacePrefix)apigwms$(hostSuffix) configurations: develop: build: