Browse Source

Included tracing for WebMVC

pull/1663/head
Sumit Ghosh 3 years ago
parent
commit
ef548da132
5 changed files with 24 additions and 4 deletions
  1. +2
    -0
      deploy/k8s/helm/app.yaml
  2. +12
    -0
      deploy/k8s/helm/deploy-all.ps1
  3. +2
    -0
      deploy/k8s/helm/webmvc/templates/configmap.yaml
  4. +4
    -0
      deploy/k8s/helm/webmvc/values.yaml
  5. +4
    -4
      deploy/k8s/nginx-ingress/mandatory.yaml

+ 2
- 0
deploy/k8s/helm/app.yaml View File

@ -19,6 +19,7 @@ app: # app global settings
payment: payment-api # ingress entry for payment api
webhooks: webhooks-api # ingress entry for webhooks api
webhooksweb: webhooks-web # ingress entry for webhooks web demo client
zipkin: zipkin # ingress entry for the Zipkin tracing tool.
svc:
basket: basket-api # service name for basket api
catalog: catalog-api # service name for catalog api
@ -36,3 +37,4 @@ app: # app global settings
payment: payment-api # service name for payment api
webhooks: webhooks-api # service name for webhooks api
webhooksweb: webhooks-client # service name for webhooks web
zipkin: zipkin # service name for Zipkin

+ 12
- 0
deploy/k8s/helm/deploy-all.ps1 View File

@ -12,6 +12,7 @@ Param(
[parameter(Mandatory=$false)][string]$imageTag="latest",
[parameter(Mandatory=$false)][bool]$useLocalk8s=$false,
[parameter(Mandatory=$false)][bool]$useMesh=$false,
[parameter(Mandatory=$false)][bool]$enableTrace=$false,
[parameter(Mandatory=$false)][string][ValidateSet('Always','IfNotPresent','Never', IgnoreCase=$false)]$imagePullPolicy="Always",
[parameter(Mandatory=$false)][string][ValidateSet('prod','staging','none','custom', IgnoreCase=$false)]$sslSupport = "none",
[parameter(Mandatory=$false)][string]$tlsSecretName = "eshop-tls-custom",
@ -119,6 +120,7 @@ if (-not [string]::IsNullOrEmpty($registry)) {
Write-Host "Begin eShopOnContainers installation using Helm" -ForegroundColor Green
$infras = ("sql-data", "nosql-data", "rabbitmq", "keystore-data", "basket-data")
$traceTools = ("zipkin")
$charts = ("eshop-common", "basket-api","catalog-api", "identity-api", "mobileshoppingagg","ordering-api","ordering-backgroundtasks","ordering-signalrhub", "payment-api", "webmvc", "webshoppingagg", "webspa", "webstatus", "webhooks-api", "webhooks-web")
$gateways = ("apigwms", "apigwws")
@ -132,6 +134,16 @@ else {
Write-Host "eShopOnContainers infrastructure (bbdd, redis, ...) charts aren't installed (-deployCharts is false)" -ForegroundColor Yellow
}
if ($enableTrace) {
Write-Host "Enabling traces : $traceTools" -ForegroundColor Green
#helm install "$appName-$traceTools" --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" $traceTools
Install-Chart $traceTools "-f app.yaml --values inf.yaml -f $ingressValuesFile -f $ingressMeshAnnotationsFile --set app.name=$appName --set inf.k8s.dns=$dns --set ingress.hosts={$dns} --set image.tag=latest --set image.pullPolicy=$imagePullPolicy --set inf.tls.enabled=$sslEnabled --set inf.mesh.enabled=$false --set inf.k8s.local=$useLocalk8s" $false
}
else {
Write-Host "OpenTelemetry Trace is not enabled. Charts isn't installed (-enableTrace is false)" -ForegroundColor Yellow
}
if ($deployCharts) {
foreach ($chart in $charts) {
if ($chartsToDeploy -eq "*" -or $chartsToDeploy.Contains($chart)) {


+ 2
- 0
deploy/k8s/helm/webmvc/templates/configmap.yaml View File

@ -3,6 +3,7 @@
{{- $webshoppingapigw := include "url-of" (list .Values.app.ingress.entries.webshoppingapigw .) -}}
{{- $mvc := include "url-of" (list .Values.app.ingress.entries.mvc .) -}}
{{- $protocol := include "protocol" . -}}
{{- $zipkin := include "url-of" (list .Values.app.ingress.entries.zipkin .) -}}
apiVersion: v1
kind: ConfigMap
@ -22,3 +23,4 @@ data:
urls__apigwws: {{ $protocol }}://{{ $webshoppingapigw }}
urls__mvc: {{ $protocol }}://{{ $mvc }}
urls__IdentityUrl: {{ $protocol }}://{{ $identity }}
urls__Otel__ExporterEndpoint: http://{{ .Values.app.svc.zipkin }}:9411/api/v2/spans

+ 4
- 0
deploy/k8s/helm/webmvc/values.yaml View File

@ -46,6 +46,8 @@ env:
key: internalurls__identity__hc
- name: SignalrHubUrl
key: urls__apigwws
- name: OTEL_EXPORTER_TOOL_ENDPOINT
key: urls__Otel__ExporterEndpoint
# 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
@ -54,4 +56,6 @@ env:
value: 'K8S'
- name: IsClusterEnv
value: 'True'
- name: OTEL_USE_EXPORTER
value: 'zipkin'

+ 4
- 4
deploy/k8s/nginx-ingress/mandatory.yaml View File

@ -26,7 +26,7 @@ metadata:
app.kubernetes.io/part-of: ingress-nginx
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: nginx-ingress-clusterrole
@ -82,7 +82,7 @@ rules:
- update
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: nginx-ingress-role
@ -127,7 +127,7 @@ rules:
- get
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: nginx-ingress-role-nisa-binding
@ -145,7 +145,7 @@ subjects:
namespace: ingress-nginx
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: nginx-ingress-clusterrole-nisa-binding


Loading…
Cancel
Save