Browse Source

updated charts for local k8s deployment

features/migration-dotnet3
eiximenis 5 years ago
parent
commit
dc2e7c215b
9 changed files with 40 additions and 8 deletions
  1. +1
    -1
      k8s/helm/app.yaml
  2. +1
    -2
      k8s/helm/basket-api/templates/configmap.yaml
  3. +3
    -0
      k8s/helm/mobileshoppingagg/templates/configmap.yaml
  4. +7
    -0
      k8s/helm/mobileshoppingagg/values.yaml
  5. +1
    -2
      k8s/helm/ordering-api/templates/configmap.yaml
  6. +3
    -0
      k8s/helm/webshoppingagg/templates/configmap.yaml
  7. +8
    -0
      k8s/helm/webshoppingagg/values.yaml
  8. +4
    -3
      src/Web/WebMVC/Services/BasketService.cs
  9. +12
    -0
      src/Web/WebMVC/appsettings.Development.json

+ 1
- 1
k8s/helm/app.yaml View File

@ -25,7 +25,7 @@ app: # app global settings
webhooks: webhooks-api # ingress entry for webhooks api
webhooksweb: webhooks-web # ingress entry for webhooks web demo client
svc:
basket: basket-apo # service name for basket api
basket: basket-api # service name for basket api
catalog: catalog-api # service name for catalog api
ordering: ordering-api # service name for ordering api
orderingbackgroundtasks: ordering-backgroundtasks # service name for orderingbackgroundtasks


+ 1
- 2
k8s/helm/basket-api/templates/configmap.yaml View File

@ -1,5 +1,4 @@
{{- $name := include "basket-api.fullname" . -}}
{{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}}
apiVersion: v1
kind: ConfigMap
@ -12,7 +11,7 @@ metadata:
heritage: {{ .Release.Service }}
data:
basket__ConnectionString: {{ .Values.inf.redis.basket.constr }}
urls__IdentityUrl: http://{{ $identity }}
urls__IdentityUrl: http://{{ .Values.app.svc.identity }}
basket__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"

+ 3
- 0
k8s/helm/mobileshoppingagg/templates/configmap.yaml View File

@ -24,3 +24,6 @@ data:
internalurls__marketing__hc: http://{{ .Values.app.svc.marketing }}/hc
internalurls__payment__hc: http://{{ .Values.app.svc.payment }}/hc
internalurls__location__hc: http://{{ .Values.app.svc.locations }}/hc
internalurls__grpcBasket: "http://{{ .Values.app.svc.basket }}:{{ .Values.service.grpcPort }}"
internalurls__grpcCatalog: "http://{{ .Values.app.svc.catalog }}:{{ .Values.service.grpcPort }}"
internalurls__grpcOrdering: "http://{{ .Values.app.svc.ordering }}:{{ .Values.service.grpcPort }}"

+ 7
- 0
k8s/helm/mobileshoppingagg/values.yaml View File

@ -10,6 +10,7 @@ image:
service:
type: ClusterIP
port: 80
grpcPort: 81
ingress:
enabled: false
@ -54,6 +55,12 @@ env:
key: internalurls__payment__hc
- name: LocationUrlHC
key: internalurls__location__hc
- name: urls__grpcBasket
key: internalurls__grpcBasket
- name: urls__grpcCatalog
key: internalurls__grpcCatalog
- name: urls__grpcOrdering
key: internalurls__grpcOrdering
# values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value)
values:
- name: ASPNETCORE_ENVIRONMENT


+ 1
- 2
k8s/helm/ordering-api/templates/configmap.yaml View File

@ -1,6 +1,5 @@
{{- $name := include "ordering-api.fullname" . -}}
{{- $sqlsrv := include "sql-name" . -}}
{{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}}
apiVersion: v1
kind: ConfigMap
@ -14,7 +13,7 @@ metadata:
data:
ordering__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.ordering.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }};
ordering__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
urls__IdentityUrl: http://{{ $identity }}
urls__IdentityUrl: http://{{ .Values.app.svc.identity }}
all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"

+ 3
- 0
k8s/helm/webshoppingagg/templates/configmap.yaml View File

@ -24,3 +24,6 @@ data:
internalurls__marketing__hc: http://{{ .Values.app.svc.marketing }}/hc
internalurls__payment__hc: http://{{ .Values.app.svc.payment }}/hc
internalurls__location__hc: http://{{ .Values.app.svc.locations }}/hc
internalurls__grpcBasket: "http://{{ .Values.app.svc.basket }}:{{ .Values.service.grpcPort }}"
internalurls__grpcCatalog: "http://{{ .Values.app.svc.catalog }}:{{ .Values.service.grpcPort }}"
internalurls__grpcOrdering: "http://{{ .Values.app.svc.ordering }}:{{ .Values.service.grpcPort }}"

+ 8
- 0
k8s/helm/webshoppingagg/values.yaml View File

@ -10,6 +10,7 @@ image:
service:
type: ClusterIP
port: 80
grpcPort: 81
ingress:
enabled: false
@ -54,6 +55,13 @@ env:
key: internalurls__payment__hc
- name: LocationUrlHC
key: internalurls__location__hc
- name: urls__grpcBasket
key: internalurls__grpcBasket
- name: urls__grpcCatalog
key: internalurls__grpcCatalog
- name: urls__grpcOrdering
key: internalurls__grpcOrdering
# values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value)
values:
- name: ASPNETCORE_ENVIRONMENT


+ 4
- 3
src/Web/WebMVC/Services/BasketService.cs View File

@ -34,9 +34,10 @@ namespace Microsoft.eShopOnContainers.WebMVC.Services
public async Task<Basket> GetBasket(ApplicationUser user)
{
var uri = API.Basket.GetBasket(_basketByPassUrl, user.Id);
var responseString = await _apiClient.GetStringAsync(uri);
_logger.LogDebug($"[GetBasket] -> Calling {uri} to get the basket");
var response = await _apiClient.GetAsync(uri);
_logger.LogDebug($"[GetBasket] -> response code {response.StatusCode}");
var responseString = await response.Content.ReadAsStringAsync();
return string.IsNullOrEmpty(responseString) ?
new Basket() { BuyerId = user.Id } :
JsonConvert.DeserializeObject<Basket>(responseString);


+ 12
- 0
src/Web/WebMVC/appsettings.Development.json View File

@ -0,0 +1,12 @@
{
"Logging": {
"LogLevel": {
"Default": "Debug"
}
},
"Serilog": {
"MinimumLevel": {
"Default": "Debug"
}
}
}

Loading…
Cancel
Save