update eShopOnContainers forrkpull/1934/head
@ -0,0 +1,71 @@ | |||||
name: "Build and push image" | |||||
description: "Builds and pushes an image to a registry" | |||||
inputs: | |||||
service: | |||||
description: "Service to build" | |||||
required: true | |||||
registry_host: | |||||
description: "Image registry host e.g. myacr.azureacr.io" | |||||
required: true | |||||
registry_endpoint: | |||||
description: "Image registry repo e.g. myacr.azureacr.io/eshop" | |||||
required: true | |||||
image_name: | |||||
description: "Name of image" | |||||
required: true | |||||
registry_username: | |||||
description: "Registry username" | |||||
required: true | |||||
registry_password: | |||||
description: "Registry password" | |||||
required: true | |||||
runs: | |||||
using: "composite" | |||||
steps: | |||||
- name: Enable experimental features for the Docker daemon and CLI | |||||
shell: bash | |||||
run: | | |||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json | |||||
mkdir -p ~/.docker | |||||
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json | |||||
sudo service docker restart | |||||
docker version -f '{{.Client.Experimental}}' | |||||
docker version -f '{{.Server.Experimental}}' | |||||
- name: Login to Container Registry | |||||
uses: docker/login-action@v1 | |||||
with: | |||||
registry: ${{ inputs.registry_host }} | |||||
username: ${{ inputs.registry_username }} | |||||
password: ${{ inputs.registry_password }} | |||||
- name: Set branch name as env variable | |||||
run: | | |||||
currentbranch=$(echo ${GITHUB_REF##*/}) | |||||
echo "running on $currentbranch" | |||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV | |||||
shell: bash | |||||
- name: Compose build ${{ inputs.service }} | |||||
shell: bash | |||||
run: sudo -E docker-compose build ${{ inputs.service }} | |||||
working-directory: ./src | |||||
env: | |||||
TAG: ${{ env.BRANCH }} | |||||
REGISTRY: ${{ inputs.registry_endpoint }} | |||||
- name: Compose push ${{ inputs.service }} | |||||
shell: bash | |||||
run: sudo -E docker-compose push ${{ inputs.service }} | |||||
working-directory: ./src | |||||
env: | |||||
TAG: ${{ env.BRANCH }} | |||||
REGISTRY: ${{ inputs.registry_endpoint }} | |||||
- name: Create multiarch manifest | |||||
shell: bash | |||||
run: | | |||||
docker --config ~/.docker manifest create ${{ inputs.registry_endpoint }}/${{ inputs.image_name }}:${{ env.BRANCH }} ${{ inputs.registry_endpoint }}/${{ inputs.image_name }}:linux-${{ env.BRANCH }} | |||||
docker --config ~/.docker manifest push ${{ inputs.registry_endpoint }}/${{ inputs.image_name }}:${{ env.BRANCH }} |
@ -0,0 +1,47 @@ | |||||
name: "Build for PRe" | |||||
description: "Builds a docker image without pushing" | |||||
inputs: | |||||
service: | |||||
description: "Service to build" | |||||
required: true | |||||
registry_endpoint: | |||||
description: "Image registry repo e.g. myacr.azureacr.io/eshop" | |||||
required: true | |||||
dotnet_version: | |||||
description: "Version of dotnet to use for testing" | |||||
required: true | |||||
project_path: | |||||
description: "Path to project to test e.g. Services/Catalog/Catalog.API" | |||||
required: true | |||||
tests_path: | |||||
description: "Path to test project e.g. Services/Catalog/Catalog.UnitTests" | |||||
required: true | |||||
runs: | |||||
using: "composite" | |||||
steps: | |||||
- name: Setup dotnet | |||||
uses: actions/setup-dotnet@v1 | |||||
with: | |||||
dotnet-version: ${{ inputs.dotnet_version }} | |||||
- name: Build and run unit tests | |||||
shell: bash | |||||
run: | | |||||
cd src | |||||
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln" | |||||
cd ${{ inputs.project_path }} | |||||
dotnet build --no-restore | |||||
cd - | |||||
cd ${{ inputs.tests_path }} | |||||
dotnet build --no-restore | |||||
dotnet test --no-build -v=normal | |||||
- name: Compose build ${{ inputs.service }} | |||||
shell: bash | |||||
run: sudo -E docker-compose build ${{ inputs.service }} | |||||
working-directory: ./src | |||||
env: | |||||
TAG: ${{ env.BRANCH }} | |||||
REGISTRY: ${{ inputs.registry_endpoint }} |
@ -0,0 +1,21 @@ | |||||
name: "Build for PRe" | |||||
description: "Builds a docker image without pushing" | |||||
inputs: | |||||
service: | |||||
description: "Service to build" | |||||
required: true | |||||
registry_endpoint: | |||||
description: "Image registry repo e.g. myacr.azureacr.io/eshop" | |||||
required: true | |||||
runs: | |||||
using: "composite" | |||||
steps: | |||||
- name: Compose build ${{ inputs.service }} | |||||
shell: bash | |||||
run: sudo -E docker-compose build ${{ inputs.service }} | |||||
working-directory: ./src | |||||
env: | |||||
TAG: ${{ env.BRANCH }} | |||||
REGISTRY: ${{ inputs.registry_endpoint }} |
@ -0,0 +1,54 @@ | |||||
name: "Deploy Helm to AKS" | |||||
description: "Deploys a helm chart to AKS" | |||||
inputs: | |||||
azure_credentials: | |||||
description: "Credentials to connect to AKS" | |||||
required: true | |||||
cluster_name: | |||||
description: "Name of AKS cluster" | |||||
required: true | |||||
resource_group: | |||||
description: "Resource group of AKS cluster" | |||||
required: true | |||||
registry_host: | |||||
description: "Image registry host e.g. myacr.azureacr.io" | |||||
required: true | |||||
chart: | |||||
description: "Chart name" | |||||
required: true | |||||
chart_root: | |||||
description: "Root folder of chart" | |||||
required: true | |||||
namespace: | |||||
description: "Namespace to deploy to" | |||||
required: true | |||||
runs: | |||||
using: "composite" | |||||
steps: | |||||
- uses: azure/login@v1 | |||||
with: | |||||
creds: ${{ inputs.azure_credentials }} | |||||
- uses: azure/aks-set-context@v1 | |||||
name: Set AKS context | |||||
with: | |||||
creds: '${{ inputs.azure_credentials }}' | |||||
cluster-name: ${{ inputs.cluster_name }} | |||||
resource-group: ${{ inputs.resource_group }} | |||||
- name: Set branch name as env variable | |||||
shell: bash | |||||
run: | | |||||
currentbranch=$(echo ${GITHUB_REF##*/}) | |||||
echo "running on $currentbranch" | |||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV | |||||
- name: Deploy Chart | |||||
shell: bash | |||||
run: | | |||||
./deploy-chart.sh -c ${{ inputs.chart }} --dns aks --aks-name ${{ inputs.clusteR_name }} --aks-rg ${{ inputs.resource_group }} -r ${{ inputs.registry_host }} -t $TAG --namespace ${{ inputs.namespace }} --acr-connected | |||||
env: | |||||
TAG: ${{ env.BRANCH }} | |||||
working-directory: ${{ inputs.chart_root }} |
@ -1,8 +0,0 @@ | |||||
# Kubernetes deployment | |||||
This folder contains the files required to deploy eShopOnContainers to a Kubernetes cluster. | |||||
For more information see the following articles in the [wiki](https://github.com/dotnet-architecture/eShopOnContainers/wiki): | |||||
- [Deploy to Local Kubernetes](https://github.com/dotnet-architecture/eShopOnContainers/wiki/Deploy-to-Local-Kubernetes) | |||||
- [Deploy to Azure Kubernetes Service (AKS)](https://github.com/dotnet-architecture/eShopOnContainers/wiki/Deploy-to-Azure-Kubernetes-Service-(AKS)) |
@ -1,50 +0,0 @@ | |||||
Param( | |||||
[parameter(Mandatory=$true)][string]$resourceGroupName, | |||||
[parameter(Mandatory=$true)][string]$location, | |||||
[parameter(Mandatory=$true)][string]$serviceName, | |||||
[parameter(Mandatory=$true)][string]$dnsNamePrefix, | |||||
[parameter(Mandatory=$false)][string]$registryName, | |||||
[parameter(Mandatory=$true)][bool]$createAcr=$true, | |||||
[parameter(Mandatory=$false)][int]$nodeCount=3, | |||||
[parameter(Mandatory=$false)][string]$nodeVMSize="Standard_D2_v2", | |||||
[parameter(Mandatory=$false)][bool]$enableHttpApplicationAddon=$true, | |||||
[parameter(Mandatory=$false)][bool]$enableAzureMonitoring=$false, | |||||
[parameter(Mandatory=$false)][ValidateSet("VirtualMachineScaleSets","AvailabilitySet",IgnoreCase=$true)]$vmSetType="VirtualMachineScaleSets" | |||||
) | |||||
# Create resource group | |||||
Write-Host "Creating Azure Resource Group..." -ForegroundColor Yellow | |||||
az group create --name=$resourceGroupName --location=$location | |||||
if ($createAcr -eq $true) { | |||||
# Create Azure Container Registry | |||||
if ([string]::IsNullOrEmpty($registryName)) { | |||||
$registryName=$serviceName | |||||
} | |||||
Write-Host "Creating Azure Container Registry named $registryName" -ForegroundColor Yellow | |||||
az acr create -n $registryName -g $resourceGroupName -l $location --admin-enabled true --sku Basic | |||||
} | |||||
# Create kubernetes cluster in AKS | |||||
Write-Host "Creating AKS $resourceGroupName/$serviceName" -ForegroundColor Yellow | |||||
az aks create --resource-group=$resourceGroupName --name=$serviceName --dns-name-prefix=$dnsNamePrefix --generate-ssh-keys --node-count=$nodeCount --node-vm-size=$nodeVMSize --vm-set-type $vmSetType | |||||
if ($enableHttpApplicationAddon) { | |||||
Write-Host "Enabling Http Applciation Routing in AKS $serviceName" -ForegroundColor Yellow | |||||
az aks enable-addons --resource-group $resourceGroupName --name $serviceName --addons http_application_routing | |||||
} | |||||
if ($enableAzureMonitoring) { | |||||
Write-Host "Enabling Azure Monitoring in AKS $serviceName" -ForegroundColor Yellow | |||||
az aks enable-addons --resource-group $resourceGroupName --name $serviceName --addons monitoring | |||||
} | |||||
# Retrieve kubernetes cluster configuration and save it under ~/.kube/config | |||||
Write-Host "Getting Kubernetes config..." -ForegroundColor Yellow | |||||
az aks get-credentials --resource-group=$resourceGroupName --name=$serviceName | |||||
if ($createAcr -eq $true) { | |||||
# Show ACR credentials | |||||
Write-Host "ACR $registryName credentials:" -ForegroundColor Yellow | |||||
az acr credential show -n $registryName | |||||
} |
@ -1,18 +0,0 @@ | |||||
apiVersion: v1 | |||||
kind: ServiceAccount | |||||
metadata: | |||||
name: admin-user | |||||
namespace: kubernetes-dashboard | |||||
--- | |||||
apiVersion: rbac.authorization.k8s.io/v1 | |||||
kind: ClusterRoleBinding | |||||
metadata: | |||||
name: admin-user | |||||
roleRef: | |||||
apiGroup: rbac.authorization.k8s.io | |||||
kind: ClusterRole | |||||
name: cluster-admin | |||||
subjects: | |||||
- kind: ServiceAccount | |||||
name: admin-user | |||||
namespace: kubernetes-dashboard |
@ -1,20 +0,0 @@ | |||||
Param ( | |||||
[parameter(Mandatory=$false)][string]$aksName="", | |||||
[parameter(Mandatory=$false)][string]$aksRg="" | |||||
) | |||||
if ($aksName -and $aksRg) { | |||||
$aks=$(az aks show -n $aksName -g $aksRg -o json | ConvertFrom-Json) | |||||
if (-not $aks) { | |||||
Write-Host "AKS $aksName not found in RG $aksRg" -ForegroundColor Red | |||||
exit 1 | |||||
} | |||||
Write-Host "Switching kubectl context to $aksRg/$aksName" -ForegroundColor Yellow | |||||
az aks get-credentials -g $aksRg -n $aksName | |||||
} | |||||
Write-Host "Installing cert-manager on current cluster" | |||||
kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.11.0/cert-manager.yaml --validate=false |
@ -1,18 +0,0 @@ | |||||
apiVersion: v1 | |||||
kind: ServiceAccount | |||||
metadata: | |||||
name: tiller | |||||
namespace: kube-system | |||||
--- | |||||
apiVersion: rbac.authorization.k8s.io/v1 | |||||
kind: ClusterRoleBinding | |||||
metadata: | |||||
name: tiller | |||||
roleRef: | |||||
apiGroup: rbac.authorization.k8s.io | |||||
kind: ClusterRole | |||||
name: cluster-admin | |||||
subjects: | |||||
- kind: ServiceAccount | |||||
name: tiller | |||||
namespace: kube-system |
@ -1,12 +0,0 @@ | |||||
apiVersion: v1 | |||||
kind: ConfigMap | |||||
metadata: | |||||
labels: | |||||
# addonmanager.kubernetes.io/mode: Reconcile | |||||
app: addon-http-application-routing-ingress-nginx | |||||
kubernetes.io/cluster-service: "true" | |||||
name: addon-http-application-routing-nginx-configuration | |||||
namespace: kube-system | |||||
data: | |||||
proxy-buffer-size: "128k" | |||||
proxy-buffers: "4 256k" |
@ -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 |
@ -1,5 +0,0 @@ | |||||
apiVersion: v1 | |||||
appVersion: "1.0" | |||||
description: A Helm chart for Kubernetes | |||||
name: apigwms | |||||
version: 0.1.0 |
@ -1,139 +0,0 @@ | |||||
admin: | |||||
access_log_path: "/dev/null" | |||||
address: | |||||
socket_address: | |||||
address: 0.0.0.0 | |||||
port_value: 8001 | |||||
static_resources: | |||||
listeners: | |||||
- address: | |||||
socket_address: | |||||
address: 0.0.0.0 | |||||
port_value: 80 | |||||
filter_chains: | |||||
- filters: | |||||
- name: envoy.http_connection_manager | |||||
config: | |||||
codec_type: auto | |||||
stat_prefix: ingress_http | |||||
route_config: | |||||
name: eshop_backend_route | |||||
virtual_hosts: | |||||
- name: eshop_backend | |||||
domains: | |||||
- "*" | |||||
routes: | |||||
- name: "c-short" | |||||
match: | |||||
prefix: "/c/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/catalog-api/" | |||||
cluster: catalog | |||||
- name: "c-long" | |||||
match: | |||||
prefix: "/catalog-api/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
cluster: catalog | |||||
- name: "o-short" | |||||
match: | |||||
prefix: "/o/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/ordering-api/" | |||||
cluster: ordering | |||||
- name: "o-long" | |||||
match: | |||||
prefix: "/ordering-api/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
cluster: ordering | |||||
- name: "h-long" | |||||
match: | |||||
prefix: "/hub/notificationhub" | |||||
route: | |||||
auto_host_rewrite: true | |||||
cluster: signalr-hub | |||||
timeout: 300s | |||||
- name: "b-short" | |||||
match: | |||||
prefix: "/b/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/basket-api/" | |||||
cluster: basket | |||||
- name: "b-long" | |||||
match: | |||||
prefix: "/basket-api/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
cluster: basket | |||||
- name: "agg" | |||||
match: | |||||
prefix: "/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/" | |||||
cluster: shoppingagg | |||||
http_filters: | |||||
- name: envoy.router | |||||
access_log: | |||||
- name: envoy.file_access_log | |||||
filter: | |||||
not_health_check_filter: {} | |||||
config: | |||||
json_format: | |||||
time: "%START_TIME%" | |||||
protocol: "%PROTOCOL%" | |||||
duration: "%DURATION%" | |||||
request_method: "%REQ(:METHOD)%" | |||||
request_host: "%REQ(HOST)%" | |||||
path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" | |||||
response_flags: "%RESPONSE_FLAGS%" | |||||
route_name: "%ROUTE_NAME%" | |||||
upstream_host: "%UPSTREAM_HOST%" | |||||
upstream_cluster: "%UPSTREAM_CLUSTER%" | |||||
upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%" | |||||
path: "/tmp/access.log" | |||||
clusters: | |||||
- name: shoppingagg | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: webshoppingagg | |||||
port_value: 80 | |||||
- name: catalog | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: catalog-api | |||||
port_value: 80 | |||||
- name: basket | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: basket-api | |||||
port_value: 80 | |||||
- name: ordering | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: ordering-api | |||||
port_value: 80 | |||||
- name: signalr-hub | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: ordering-signalrhub | |||||
port_value: 80 |
@ -1,2 +0,0 @@ | |||||
eShop API Gateway for Mobile Shopping services installed | |||||
-------------------------------------------------------- |
@ -1,32 +0,0 @@ | |||||
{{/* vim: set filetype=mustache: */}} | |||||
{{/* | |||||
Expand the name of the chart. | |||||
*/}} | |||||
{{- define "apigwms.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 "apigwms.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 "apigwms.chart" -}} | |||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | |||||
{{- end -}} |
@ -1,52 +0,0 @@ | |||||
{{- define "suffix-name" -}} | |||||
{{- if .Values.app.name -}} | |||||
{{- .Values.app.name -}} | |||||
{{- else -}} | |||||
{{- .Release.Name -}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "sql-name" -}} | |||||
{{- if .Values.inf.sql.host -}} | |||||
{{- .Values.inf.sql.host -}} | |||||
{{- else -}} | |||||
{{- printf "%s" "sql-data" -}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "mongo-name" -}} | |||||
{{- if .Values.inf.mongo.host -}} | |||||
{{- .Values.inf.mongo.host -}} | |||||
{{- else -}} | |||||
{{- printf "%s" "nosql-data" -}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "url-of" -}} | |||||
{{- $name := first .}} | |||||
{{- $ctx := last .}} | |||||
{{- if eq $name "" -}} | |||||
{{- $ctx.Values.inf.k8s.dns -}} | |||||
{{- else -}} | |||||
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just <dns>/<name> */}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "pathBase" -}} | |||||
{{- if .Values.inf.k8s.suffix -}} | |||||
{{- $suffix := include "suffix-name" . -}} | |||||
{{- printf "%s-%s" .Values.pathBase $suffix -}} | |||||
{{- else -}} | |||||
{{- .Values.pathBase -}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "fqdn-image" -}} | |||||
{{- if .Values.inf.registry -}} | |||||
{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}} | |||||
{{- else -}} | |||||
{{- .Values.image.repository -}} | |||||
{{- end -}} | |||||
{{- end -}} |
@ -1,110 +0,0 @@ | |||||
{{- $name := include "apigwms.fullname" . -}} | |||||
{{- $cfgname := printf "%s-%s" "cfg" $name -}} | |||||
{{- $envoycfgname := printf "%s-%s" "envoy" $name -}} | |||||
apiVersion: apps/v1beta2 | |||||
kind: Deployment | |||||
metadata: | |||||
name: {{ template "apigwms.fullname" . }} | |||||
labels: | |||||
ufo: {{ $cfgname}} | |||||
app: {{ template "apigwms.name" . }} | |||||
chart: {{ template "apigwms.chart" . }} | |||||
release: {{ .Release.Name }} | |||||
heritage: {{ .Release.Service }} | |||||
spec: | |||||
replicas: {{ .Values.replicaCount }} | |||||
selector: | |||||
matchLabels: | |||||
app: {{ template "apigwms.name" . }} | |||||
release: {{ .Release.Name }} | |||||
template: | |||||
metadata: | |||||
labels: | |||||
app: {{ template "apigwms.name" . }} | |||||
release: {{ .Release.Name }} | |||||
{{ if .Values.inf.mesh.enabled -}} | |||||
annotations: | |||||
linkerd.io/inject: enabled | |||||
{{- end }} | |||||
spec: | |||||
{{ if .Values.inf.registry -}} | |||||
imagePullSecrets: | |||||
- name: {{ .Values.inf.registry.secretName }} | |||||
{{- end }} | |||||
volumes: | |||||
- name: config | |||||
configMap: | |||||
name: {{ $envoycfgname }} | |||||
items: | |||||
- key: envoy.yaml | |||||
path: envoy.yaml | |||||
containers: | |||||
- name: {{ .Chart.Name }} | |||||
{{ if .Values.probes -}} | |||||
{{- if .Values.probes.liveness -}} | |||||
livenessProbe: | |||||
httpGet: | |||||
port: {{ .Values.probes.liveness.port }} | |||||
path: {{ .Values.probes.liveness.path }} | |||||
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }} | |||||
periodSeconds: {{ .Values.probes.liveness.periodSeconds }} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- if .Values.probes -}} | |||||
{{- if .Values.probes.readiness }} | |||||
readinessProbe: | |||||
httpGet: | |||||
port: {{ .Values.probes.readiness.port }} | |||||
path: {{ .Values.probes.readiness.path }} | |||||
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }} | |||||
periodSeconds: {{ .Values.probes.readiness.periodSeconds }} | |||||
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }} | |||||
{{- end -}} | |||||
{{- end }} | |||||
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}" | |||||
imagePullPolicy: IfNotPresent | |||||
volumeMounts: | |||||
- name: config | |||||
mountPath: {{ .Values.envoy.configPath }} | |||||
env: | |||||
- name: PATH_BASE | |||||
value: {{ include "pathBase" . }} | |||||
- name: k8sname | |||||
value: {{ .Values.clusterName }} | |||||
{{- if .Values.env.values -}} | |||||
{{- range .Values.env.values }} | |||||
- name: {{ .name }} | |||||
value: {{ .value | quote }} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- if .Values.env.configmap -}} | |||||
{{- range .Values.env.configmap }} | |||||
- name: {{ .name }} | |||||
valueFrom: | |||||
configMapKeyRef: | |||||
name: {{ $cfgname }} | |||||
key: {{ .key }} | |||||
{{- end -}} | |||||
{{- end }} | |||||
ports: | |||||
- name: http | |||||
containerPort: 80 | |||||
protocol: TCP | |||||
- name: admin | |||||
containerPort: 8001 | |||||
protocol: TCP | |||||
resources: | |||||
{{ toYaml .Values.resources | indent 12 }} | |||||
{{- with .Values.nodeSelector }} | |||||
nodeSelector: | |||||
{{ toYaml . | indent 8 }} | |||||
{{- end }} | |||||
{{- with .Values.affinity }} | |||||
affinity: | |||||
{{ toYaml . | indent 8 }} | |||||
{{- end }} | |||||
{{- with .Values.tolerations }} | |||||
tolerations: | |||||
{{ toYaml . | indent 8 }} | |||||
{{- end }} | |||||
@ -1,14 +0,0 @@ | |||||
{{- $name := include "apigwms.fullname" . -}} | |||||
apiVersion: v1 | |||||
kind: ConfigMap | |||||
metadata: | |||||
name: "envoy-{{ $name }}" | |||||
labels: | |||||
app: {{ template "apigwms.name" . }} | |||||
chart: {{ template "apigwms.chart" .}} | |||||
release: {{ .Release.Name }} | |||||
heritage: {{ .Release.Service }} | |||||
data: | |||||
{{ (.Files.Glob "envoy.yaml").AsConfig | indent 2 }} | |||||
@ -1,47 +0,0 @@ | |||||
{{- if .Values.ingress.enabled -}} | |||||
{{- $ingressPath := include "pathBase" . -}} | |||||
{{- $serviceName := .Values.app.svc.mobileshoppingapigw -}} | |||||
apiVersion: extensions/v1beta1 | |||||
kind: Ingress | |||||
metadata: | |||||
name: {{ template "apigwms.fullname" . }} | |||||
labels: | |||||
app: {{ template "apigwms.name" . }} | |||||
chart: {{ template "apigwms.chart" . }} | |||||
release: {{ .Release.Name }} | |||||
heritage: {{ .Release.Service }} | |||||
{{- with .Values.ingress.annotations }} | |||||
annotations: | |||||
{{ toYaml . | indent 4 }} | |||||
{{- end }} | |||||
{{- if and .Values.inf.tls.enabled .Values.inf.tls.issuer }} | |||||
cert-manager.io/issuer: {{ .Values.inf.tls.issuer }} | |||||
{{- end }} | |||||
{{- if .Values.inf.mesh.enabled }} | |||||
{{- with .Values.ingress.mesh.annotations }} | |||||
{{ toYaml . | indent 4 }} | |||||
{{- end }} | |||||
{{- 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: {{ $serviceName }} | |||||
servicePort: http | |||||
{{- end }} | |||||
{{- end }} |
@ -1,23 +0,0 @@ | |||||
apiVersion: v1 | |||||
kind: Service | |||||
metadata: | |||||
name: {{ .Values.app.svc.mobileshoppingapigw }} | |||||
labels: | |||||
app: {{ template "apigwms.name" . }} | |||||
chart: {{ template "apigwms.chart" . }} | |||||
release: {{ .Release.Name }} | |||||
heritage: {{ .Release.Service }} | |||||
spec: | |||||
type: {{ .Values.service.type }} | |||||
ports: | |||||
- port: {{ .Values.service.port }} | |||||
targetPort: http | |||||
protocol: TCP | |||||
name: http | |||||
- port: {{ .Values.service.adminPort }} | |||||
targetPort: admin | |||||
protocol: TCP | |||||
name: admin | |||||
selector: | |||||
app: {{ template "apigwms.name" . }} | |||||
release: {{ .Release.Name }} |
@ -1,45 +0,0 @@ | |||||
replicaCount: 1 | |||||
clusterName: eshop-aks | |||||
pathBase: /mobileshoppingapigw | |||||
image: | |||||
repository: envoyproxy/envoy | |||||
tag: v1.11.1 | |||||
service: | |||||
type: ClusterIP | |||||
port: 80 | |||||
adminPort: 8001 | |||||
ingress: | |||||
enabled: true | |||||
annotations: | |||||
nginx.ingress.kubernetes.io/rewrite-target: "/" | |||||
ingress.kubernetes.io/rewrite-target: "/" | |||||
tls: [] | |||||
resources: {} | |||||
nodeSelector: {} | |||||
tolerations: [] | |||||
affinity: {} | |||||
env: {} | |||||
envoy: | |||||
configPath: /etc/envoy | |||||
probes: | |||||
liveness: | |||||
path: /ready | |||||
initialDelaySeconds: 5 | |||||
periodSeconds: 15 | |||||
port: 8001 | |||||
readiness: | |||||
path: /ready | |||||
initialDelaySeconds: 5 | |||||
periodSeconds: 60 | |||||
port: 8001 |
@ -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 |
@ -1,5 +0,0 @@ | |||||
apiVersion: v1 | |||||
appVersion: "1.0" | |||||
description: A Helm chart for Kubernetes | |||||
name: apigwws | |||||
version: 0.1.0 |
@ -1,139 +0,0 @@ | |||||
admin: | |||||
access_log_path: "/dev/null" | |||||
address: | |||||
socket_address: | |||||
address: 0.0.0.0 | |||||
port_value: 8001 | |||||
static_resources: | |||||
listeners: | |||||
- address: | |||||
socket_address: | |||||
address: 0.0.0.0 | |||||
port_value: 80 | |||||
filter_chains: | |||||
- filters: | |||||
- name: envoy.http_connection_manager | |||||
config: | |||||
codec_type: auto | |||||
stat_prefix: ingress_http | |||||
route_config: | |||||
name: eshop_backend_route | |||||
virtual_hosts: | |||||
- name: eshop_backend | |||||
domains: | |||||
- "*" | |||||
routes: | |||||
- name: "c-short" | |||||
match: | |||||
prefix: "/c/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/catalog-api/" | |||||
cluster: catalog | |||||
- name: "c-long" | |||||
match: | |||||
prefix: "/catalog-api/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
cluster: catalog | |||||
- name: "o-short" | |||||
match: | |||||
prefix: "/o/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/ordering-api/" | |||||
cluster: ordering | |||||
- name: "o-long" | |||||
match: | |||||
prefix: "/ordering-api/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
cluster: ordering | |||||
- name: "h-long" | |||||
match: | |||||
prefix: "/hub/notificationhub" | |||||
route: | |||||
auto_host_rewrite: true | |||||
cluster: signalr-hub | |||||
timeout: 300s | |||||
- name: "b-short" | |||||
match: | |||||
prefix: "/b/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/basket-api/" | |||||
cluster: basket | |||||
- name: "b-long" | |||||
match: | |||||
prefix: "/basket-api/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
cluster: basket | |||||
- name: "agg" | |||||
match: | |||||
prefix: "/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/" | |||||
cluster: shoppingagg | |||||
http_filters: | |||||
- name: envoy.router | |||||
access_log: | |||||
- name: envoy.file_access_log | |||||
filter: | |||||
not_health_check_filter: {} | |||||
config: | |||||
json_format: | |||||
time: "%START_TIME%" | |||||
protocol: "%PROTOCOL%" | |||||
duration: "%DURATION%" | |||||
request_method: "%REQ(:METHOD)%" | |||||
request_host: "%REQ(HOST)%" | |||||
path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" | |||||
response_flags: "%RESPONSE_FLAGS%" | |||||
route_name: "%ROUTE_NAME%" | |||||
upstream_host: "%UPSTREAM_HOST%" | |||||
upstream_cluster: "%UPSTREAM_CLUSTER%" | |||||
upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%" | |||||
path: "/tmp/access.log" | |||||
clusters: | |||||
- name: shoppingagg | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: webshoppingagg | |||||
port_value: 80 | |||||
- name: catalog | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: catalog-api | |||||
port_value: 80 | |||||
- name: basket | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: basket-api | |||||
port_value: 80 | |||||
- name: ordering | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: ordering-api | |||||
port_value: 80 | |||||
- name: signalr-hub | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: ordering-signalrhub | |||||
port_value: 80 |
@ -1,2 +0,0 @@ | |||||
eShop API Gateway for Web Shopping services installed | |||||
----------------------------------------------------- |
@ -1,32 +0,0 @@ | |||||
{{/* vim: set filetype=mustache: */}} | |||||
{{/* | |||||
Expand the name of the chart. | |||||
*/}} | |||||
{{- define "apigwws.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 "apigwws.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 "apigwws.chart" -}} | |||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | |||||
{{- end -}} |
@ -1,52 +0,0 @@ | |||||
{{- define "suffix-name" -}} | |||||
{{- if .Values.app.name -}} | |||||
{{- .Values.app.name -}} | |||||
{{- else -}} | |||||
{{- .Release.Name -}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "sql-name" -}} | |||||
{{- if .Values.inf.sql.host -}} | |||||
{{- .Values.inf.sql.host -}} | |||||
{{- else -}} | |||||
{{- printf "%s" "sql-data" -}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "mongo-name" -}} | |||||
{{- if .Values.inf.mongo.host -}} | |||||
{{- .Values.inf.mongo.host -}} | |||||
{{- else -}} | |||||
{{- printf "%s" "nosql-data" -}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "url-of" -}} | |||||
{{- $name := first .}} | |||||
{{- $ctx := last .}} | |||||
{{- if eq $name "" -}} | |||||
{{- $ctx.Values.inf.k8s.dns -}} | |||||
{{- else -}} | |||||
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just <dns>/<name> */}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "pathBase" -}} | |||||
{{- if .Values.inf.k8s.suffix -}} | |||||
{{- $suffix := include "suffix-name" . -}} | |||||
{{- printf "%s-%s" .Values.pathBase $suffix -}} | |||||
{{- else -}} | |||||
{{- .Values.pathBase -}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "fqdn-image" -}} | |||||
{{- if .Values.inf.registry -}} | |||||
{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}} | |||||
{{- else -}} | |||||
{{- .Values.image.repository -}} | |||||
{{- end -}} | |||||
{{- end -}} |
@ -1,109 +0,0 @@ | |||||
{{- $name := include "apigwws.fullname" . -}} | |||||
{{- $cfgname := printf "%s-%s" "cfg" $name -}} | |||||
{{- $envoycfgname := printf "%s-%s" "envoy" $name -}} | |||||
apiVersion: apps/v1beta2 | |||||
kind: Deployment | |||||
metadata: | |||||
name: {{ template "apigwws.fullname" . }} | |||||
labels: | |||||
app: {{ template "apigwws.name" . }} | |||||
chart: {{ template "apigwws.chart" . }} | |||||
release: {{ .Release.Name }} | |||||
heritage: {{ .Release.Service }} | |||||
spec: | |||||
replicas: {{ .Values.replicaCount }} | |||||
selector: | |||||
matchLabels: | |||||
app: {{ template "apigwws.name" . }} | |||||
release: {{ .Release.Name }} | |||||
template: | |||||
metadata: | |||||
labels: | |||||
app: {{ template "apigwws.name" . }} | |||||
release: {{ .Release.Name }} | |||||
{{ if .Values.inf.mesh.enabled -}} | |||||
annotations: | |||||
linkerd.io/inject: enabled | |||||
{{- end }} | |||||
spec: | |||||
{{ if .Values.inf.registry -}} | |||||
imagePullSecrets: | |||||
- name: {{ .Values.inf.registry.secretName }} | |||||
{{- end }} | |||||
volumes: | |||||
- name: config | |||||
configMap: | |||||
name: {{ $envoycfgname }} | |||||
items: | |||||
- key: envoy.yaml | |||||
path: envoy.yaml | |||||
containers: | |||||
- name: {{ .Chart.Name }} | |||||
{{ if .Values.probes -}} | |||||
{{- if .Values.probes.liveness -}} | |||||
livenessProbe: | |||||
httpGet: | |||||
port: {{ .Values.probes.liveness.port }} | |||||
path: {{ .Values.probes.liveness.path }} | |||||
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }} | |||||
periodSeconds: {{ .Values.probes.liveness.periodSeconds }} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- if .Values.probes -}} | |||||
{{- if .Values.probes.readiness }} | |||||
readinessProbe: | |||||
httpGet: | |||||
port: {{ .Values.probes.readiness.port }} | |||||
path: {{ .Values.probes.readiness.path }} | |||||
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }} | |||||
periodSeconds: {{ .Values.probes.readiness.periodSeconds }} | |||||
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }} | |||||
{{- end -}} | |||||
{{- end }} | |||||
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}" | |||||
imagePullPolicy: {{ .Values.image.pullPolicy }} | |||||
volumeMounts: | |||||
- name: config | |||||
mountPath: {{ .Values.envoy.configPath }} | |||||
env: | |||||
- name: PATH_BASE | |||||
value: {{ include "pathBase" . }} | |||||
- name: k8sname | |||||
value: {{ .Values.clusterName }} | |||||
{{- if .Values.env.values -}} | |||||
{{- range .Values.env.values }} | |||||
- name: {{ .name }} | |||||
value: {{ .value | quote }} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- if .Values.env.configmap -}} | |||||
{{- range .Values.env.configmap }} | |||||
- name: {{ .name }} | |||||
valueFrom: | |||||
configMapKeyRef: | |||||
name: {{ $cfgname }} | |||||
key: {{ .key }} | |||||
{{- end -}} | |||||
{{- end }} | |||||
ports: | |||||
- name: http | |||||
containerPort: 80 | |||||
protocol: TCP | |||||
- name: admin | |||||
containerPort: 8001 | |||||
protocol: TCP | |||||
resources: | |||||
{{ toYaml .Values.resources | indent 12 }} | |||||
{{- with .Values.nodeSelector }} | |||||
nodeSelector: | |||||
{{ toYaml . | indent 8 }} | |||||
{{- end }} | |||||
{{- with .Values.affinity }} | |||||
affinity: | |||||
{{ toYaml . | indent 8 }} | |||||
{{- end }} | |||||
{{- with .Values.tolerations }} | |||||
tolerations: | |||||
{{ toYaml . | indent 8 }} | |||||
{{- end }} | |||||
@ -1,14 +0,0 @@ | |||||
{{- $name := include "apigwws.fullname" . -}} | |||||
apiVersion: v1 | |||||
kind: ConfigMap | |||||
metadata: | |||||
name: "envoy-{{ $name }}" | |||||
labels: | |||||
app: {{ template "apigwws.name" . }} | |||||
chart: {{ template "apigwws.chart" .}} | |||||
release: {{ .Release.Name }} | |||||
heritage: {{ .Release.Service }} | |||||
data: | |||||
{{ (.Files.Glob "envoy.yaml").AsConfig | indent 2 }} | |||||
@ -1,46 +0,0 @@ | |||||
{{- if .Values.ingress.enabled -}} | |||||
{{- $ingressPath := include "pathBase" . -}} | |||||
{{- $serviceName := .Values.app.svc.webshoppingapigw -}} | |||||
apiVersion: extensions/v1beta1 | |||||
kind: Ingress | |||||
metadata: | |||||
name: {{ template "apigwws.fullname" . }} | |||||
labels: | |||||
app: {{ template "apigwws.name" . }} | |||||
chart: {{ template "apigwws.chart" . }} | |||||
release: {{ .Release.Name }} | |||||
heritage: {{ .Release.Service }} | |||||
{{- with .Values.ingress.annotations }} | |||||
annotations: | |||||
{{ toYaml . | indent 4 }} | |||||
{{- end }} | |||||
{{- if and .Values.inf.tls.enabled .Values.inf.tls.issuer }} | |||||
cert-manager.io/issuer: {{ .Values.inf.tls.issuer }} | |||||
{{- end }} | |||||
{{- if .Values.inf.mesh.enabled }} | |||||
{{- with .Values.ingress.mesh.annotations }} | |||||
{{ toYaml . | indent 4 }} | |||||
{{- end }} | |||||
{{- 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: {{ $serviceName }} | |||||
servicePort: http | |||||
{{- end }} | |||||
{{- end }} |
@ -1,23 +0,0 @@ | |||||
apiVersion: v1 | |||||
kind: Service | |||||
metadata: | |||||
name: {{ .Values.app.svc.webshoppingapigw }} | |||||
labels: | |||||
app: {{ template "apigwws.name" . }} | |||||
chart: {{ template "apigwws.chart" . }} | |||||
release: {{ .Release.Name }} | |||||
heritage: {{ .Release.Service }} | |||||
spec: | |||||
type: {{ .Values.service.type }} | |||||
ports: | |||||
- port: {{ .Values.service.port }} | |||||
targetPort: http | |||||
protocol: TCP | |||||
name: http | |||||
- port: {{ .Values.service.adminPort }} | |||||
targetPort: admin | |||||
protocol: TCP | |||||
name: admin | |||||
selector: | |||||
app: {{ template "apigwws.name" . }} | |||||
release: {{ .Release.Name }} |
@ -1,46 +0,0 @@ | |||||
replicaCount: 1 | |||||
clusterName: eshop-aks | |||||
pathBase: /webshoppingapigw | |||||
image: | |||||
repository: envoyproxy/envoy | |||||
tag: v1.11.1 | |||||
service: | |||||
type: ClusterIP | |||||
port: 80 | |||||
adminPort: 8001 | |||||
ingress: | |||||
enabled: true | |||||
annotations: | |||||
nginx.ingress.kubernetes.io/rewrite-target: "/" | |||||
ingress.kubernetes.io/rewrite-target: "/" | |||||
tls: [] | |||||
resources: {} | |||||
nodeSelector: {} | |||||
tolerations: [] | |||||
affinity: {} | |||||
# env defines the environment variables that will be declared in the pod | |||||
env: {} | |||||
envoy: | |||||
configPath: /etc/envoy | |||||
probes: | |||||
liveness: | |||||
path: /ready | |||||
initialDelaySeconds: 5 | |||||
periodSeconds: 15 | |||||
port: 8001 | |||||
readiness: | |||||
path: /ready | |||||
initialDelaySeconds: 5 | |||||
periodSeconds: 60 | |||||
port: 8001 |
@ -1,38 +0,0 @@ | |||||
# This helm 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 | |||||
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 | |||||
webhooks: webhooks-api # ingress entry for webhooks api | |||||
webhooksweb: webhooks-web # ingress entry for webhooks web demo client | |||||
svc: | |||||
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 | |||||
orderingsignalrhub: ordering-signalrhub # service name for orderingsignalrhub | |||||
identity: identity-api # 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 | |||||
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-api # service name for payment api | |||||
webhooks: webhooks-api # service name for webhooks api | |||||
webhooksweb: webhooks-client # service name for webhooks web |
@ -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 |
@ -1,5 +0,0 @@ | |||||
apiVersion: v1 | |||||
appVersion: "1.0" | |||||
description: A Helm chart for Kubernetes | |||||
name: basket-api | |||||
version: 0.1.0 |
@ -1,8 +0,0 @@ | |||||
eShop Basket API installed. | |||||
-------------------------- | |||||
This API is not directly exposed outside cluster. If need to access it use: | |||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "basket-api.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 |
@ -1,32 +0,0 @@ | |||||
{{/* vim: set filetype=mustache: */}} | |||||
{{/* | |||||
Expand the name of the chart. | |||||
*/}} | |||||
{{- define "basket-api.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 "basket-api.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 "basket-api.chart" -}} | |||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | |||||
{{- end -}} |
@ -1,52 +0,0 @@ | |||||
{{- define "suffix-name" -}} | |||||
{{- if .Values.app.name -}} | |||||
{{- .Values.app.name -}} | |||||
{{- else -}} | |||||
{{- .Release.Name -}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "sql-name" -}} | |||||
{{- if .Values.inf.sql.host -}} | |||||
{{- .Values.inf.sql.host -}} | |||||
{{- else -}} | |||||
{{- printf "%s" "sql-data" -}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "mongo-name" -}} | |||||
{{- if .Values.inf.mongo.host -}} | |||||
{{- .Values.inf.mongo.host -}} | |||||
{{- else -}} | |||||
{{- printf "%s" "nosql-data" -}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "url-of" -}} | |||||
{{- $name := first .}} | |||||
{{- $ctx := last .}} | |||||
{{- if eq $name "" -}} | |||||
{{- $ctx.Values.inf.k8s.dns -}} | |||||
{{- else -}} | |||||
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just <dns>/<name> */}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "pathBase" -}} | |||||
{{- if .Values.inf.k8s.suffix -}} | |||||
{{- $suffix := include "suffix-name" . -}} | |||||
{{- printf "%s-%s" .Values.pathBase $suffix -}} | |||||
{{- else -}} | |||||
{{- .Values.pathBase -}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "fqdn-image" -}} | |||||
{{- if .Values.inf.registry -}} | |||||
{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}} | |||||
{{- else -}} | |||||
{{- .Values.image.repository -}} | |||||
{{- end -}} | |||||
{{- end -}} |
@ -1,17 +0,0 @@ | |||||
{{- $name := include "basket-api.fullname" . -}} | |||||
apiVersion: v1 | |||||
kind: ConfigMap | |||||
metadata: | |||||
name: "cfg-{{ $name }}" | |||||
labels: | |||||
app: {{ template "basket-api.name" . }} | |||||
chart: {{ template "basket-api.chart" .}} | |||||
release: {{ .Release.Name }} | |||||
heritage: {{ .Release.Service }} | |||||
data: | |||||
basket__ConnectionString: {{ .Values.inf.redis.basket.constr }} | |||||
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 }}" |
@ -1,99 +0,0 @@ | |||||
{{- $name := include "basket-api.fullname" . -}} | |||||
{{- $cfgname := printf "%s-%s" "cfg" $name -}} | |||||
apiVersion: apps/v1beta2 | |||||
kind: Deployment | |||||
metadata: | |||||
name: {{ template "basket-api.fullname" . }} | |||||
labels: | |||||
ufo: {{ $cfgname}} | |||||
app: {{ template "basket-api.name" . }} | |||||
chart: {{ template "basket-api.chart" . }} | |||||
release: {{ .Release.Name }} | |||||
heritage: {{ .Release.Service }} | |||||
spec: | |||||
replicas: {{ .Values.replicaCount }} | |||||
selector: | |||||
matchLabels: | |||||
app: {{ template "basket-api.name" . }} | |||||
release: {{ .Release.Name }} | |||||
template: | |||||
metadata: | |||||
labels: | |||||
app: {{ template "basket-api.name" . }} | |||||
release: {{ .Release.Name }} | |||||
{{ if .Values.inf.mesh.enabled -}} | |||||
annotations: | |||||
linkerd.io/inject: enabled | |||||
{{- end }} | |||||
spec: | |||||
{{ if .Values.inf.registry -}} | |||||
imagePullSecrets: | |||||
- name: {{ .Values.inf.registry.secretName }} | |||||
{{- end }} | |||||
containers: | |||||
- name: {{ .Chart.Name }} | |||||
{{ if .Values.probes -}} | |||||
{{- if .Values.probes.liveness -}} | |||||
livenessProbe: | |||||
httpGet: | |||||
port: {{ .Values.probes.liveness.port }} | |||||
path: {{ .Values.probes.liveness.path }} | |||||
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }} | |||||
periodSeconds: {{ .Values.probes.liveness.periodSeconds }} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- if .Values.probes -}} | |||||
{{- if .Values.probes.readiness }} | |||||
readinessProbe: | |||||
httpGet: | |||||
port: {{ .Values.probes.readiness.port }} | |||||
path: {{ .Values.probes.readiness.path }} | |||||
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }} | |||||
periodSeconds: {{ .Values.probes.readiness.periodSeconds }} | |||||
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }} | |||||
{{- end -}} | |||||
{{- end }} | |||||
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}" | |||||
imagePullPolicy: {{ .Values.image.pullPolicy }} | |||||
env: | |||||
- name: PATH_BASE | |||||
value: {{ include "pathBase" . }} | |||||
- name: k8sname | |||||
value: {{ .Values.clusterName }} | |||||
{{- if .Values.env.values -}} | |||||
{{- range .Values.env.values }} | |||||
- name: {{ .name }} | |||||
value: {{ .value | quote }} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- if .Values.env.configmap -}} | |||||
{{- range .Values.env.configmap }} | |||||
- name: {{ .name }} | |||||
valueFrom: | |||||
configMapKeyRef: | |||||
name: {{ $cfgname }} | |||||
key: {{ .key }} | |||||
{{- end -}} | |||||
{{- end }} | |||||
ports: | |||||
- name: http | |||||
containerPort: 80 | |||||
protocol: TCP | |||||
- name: grpc | |||||
containerPort: 81 | |||||
protocol: TCP | |||||
resources: | |||||
{{ toYaml .Values.resources | indent 12 }} | |||||
{{- with .Values.nodeSelector }} | |||||
nodeSelector: | |||||
{{ toYaml . | indent 8 }} | |||||
{{- end }} | |||||
{{- with .Values.affinity }} | |||||
affinity: | |||||
{{ toYaml . | indent 8 }} | |||||
{{- end }} | |||||
{{- with .Values.tolerations }} | |||||
tolerations: | |||||
{{ toYaml . | indent 8 }} | |||||
{{- end }} | |||||
@ -1,23 +0,0 @@ | |||||
apiVersion: v1 | |||||
kind: Service | |||||
metadata: | |||||
name: {{ .Values.app.svc.basket }} | |||||
labels: | |||||
app: {{ template "basket-api.name" . }} | |||||
chart: {{ template "basket-api.chart" . }} | |||||
release: {{ .Release.Name }} | |||||
heritage: {{ .Release.Service }} | |||||
spec: | |||||
type: {{ .Values.service.type }} | |||||
ports: | |||||
- port: {{ .Values.service.port }} | |||||
targetPort: http | |||||
protocol: TCP | |||||
name: http | |||||
- port: {{ .Values.service.grpcPort }} | |||||
targetPort: grpc | |||||
protocol: TCP | |||||
name: grpc | |||||
selector: | |||||
app: {{ template "basket-api.name" . }} | |||||
release: {{ .Release.Name }} |
@ -1,61 +0,0 @@ | |||||
replicaCount: 1 | |||||
clusterName: eshop-aks | |||||
pathBase: /basket-api | |||||
image: | |||||
repository: eshop/basket.api | |||||
tag: latest | |||||
pullPolicy: IfNotPresent | |||||
service: | |||||
type: ClusterIP | |||||
port: 80 | |||||
grpcPort: 81 | |||||
resources: {} | |||||
nodeSelector: {} | |||||
tolerations: [] | |||||
affinity: {} | |||||
# env defines the environment variables that will be declared in the pod | |||||
env: | |||||
urls: | |||||
# configmap declares variables which value is taken from the config map defined in template configmap.yaml (name is name of var and key the key in configmap). | |||||
configmap: | |||||
- name: ConnectionString | |||||
key: basket__ConnectionString | |||||
- name: EventBusConnection | |||||
key: all__EventBusConnection | |||||
- name: ApplicationInsights__InstrumentationKey | |||||
key: all__InstrumentationKey | |||||
- name: AzureServiceBusEnabled | |||||
key: all__UseAzureServiceBus | |||||
- name: IdentityUrl | |||||
key: urls__IdentityUrl | |||||
# values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value) | |||||
values: | |||||
- name: OrchestratorType | |||||
value: 'K8S' | |||||
- name: PORT | |||||
value: "80" | |||||
- name: GRPC_PORT | |||||
value: "81" | |||||
probes: | |||||
liveness: | |||||
path: /liveness | |||||
initialDelaySeconds: 10 | |||||
periodSeconds: 15 | |||||
port: 80 | |||||
readiness: | |||||
path: /hc | |||||
timeoutSeconds: 5 | |||||
initialDelaySeconds: 90 | |||||
periodSeconds: 60 | |||||
port: 80 | |||||
ingress: | |||||
enabled: false |
@ -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 |
@ -1,5 +0,0 @@ | |||||
apiVersion: v1 | |||||
appVersion: "1.0" | |||||
description: A Helm chart for Kubernetes | |||||
name: basket-data | |||||
version: 0.1.0 |
@ -1,8 +0,0 @@ | |||||
eShop Redis for keystore data installed | |||||
---------------------------------------- | |||||
Redis is not directly exposed outside cluster. If need to access it from outside use: | |||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "basket-data.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 |
@ -1,32 +0,0 @@ | |||||
{{/* vim: set filetype=mustache: */}} | |||||
{{/* | |||||
Expand the name of the chart. | |||||
*/}} | |||||
{{- define "basket-data.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 "basket-data.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 "basket-data.chart" -}} | |||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | |||||
{{- end -}} |
@ -1,43 +0,0 @@ | |||||
apiVersion: apps/v1beta2 | |||||
kind: Deployment | |||||
metadata: | |||||
name: {{ template "basket-data.fullname" . }} | |||||
labels: | |||||
app: {{ template "basket-data.name" . }} | |||||
chart: {{ template "basket-data.chart" . }} | |||||
release: {{ .Release.Name }} | |||||
heritage: {{ .Release.Service }} | |||||
spec: | |||||
replicas: {{ .Values.replicaCount }} | |||||
selector: | |||||
matchLabels: | |||||
app: {{ template "basket-data.name" . }} | |||||
release: {{ .Release.Name }} | |||||
template: | |||||
metadata: | |||||
labels: | |||||
app: {{ template "basket-data.name" . }} | |||||
release: {{ .Release.Name }} | |||||
spec: | |||||
containers: | |||||
- name: {{ .Chart.Name }} | |||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | |||||
imagePullPolicy: {{ .Values.image.pullPolicy }} | |||||
ports: | |||||
- name: http | |||||
containerPort: 6379 | |||||
protocol: TCP | |||||
resources: | |||||
{{ toYaml .Values.resources | indent 12 }} | |||||
{{- with .Values.nodeSelector }} | |||||
nodeSelector: | |||||
{{ toYaml . | indent 8 }} | |||||
{{- end }} | |||||
{{- with .Values.affinity }} | |||||
affinity: | |||||
{{ toYaml . | indent 8 }} | |||||
{{- end }} | |||||
{{- with .Values.tolerations }} | |||||
tolerations: | |||||
{{ toYaml . | indent 8 }} | |||||
{{- end }} |
@ -1,19 +0,0 @@ | |||||
apiVersion: v1 | |||||
kind: Service | |||||
metadata: | |||||
name: {{ .Values.inf.redis.basket.svc }} | |||||
labels: | |||||
app: {{ template "basket-data.name" . }} | |||||
chart: {{ template "basket-data.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 "basket-data.name" . }} | |||||
release: {{ .Release.Name }} |
@ -1,19 +0,0 @@ | |||||
replicaCount: 1 | |||||
image: | |||||
repository: redis | |||||
tag: 4.0.10 | |||||
pullPolicy: IfNotPresent | |||||
service: | |||||
type: ClusterIP | |||||
port: 6379 | |||||
resources: {} | |||||
nodeSelector: {} | |||||
tolerations: [] | |||||
affinity: {} |
@ -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 |
@ -1,5 +0,0 @@ | |||||
apiVersion: v1 | |||||
appVersion: "1.0" | |||||
description: A Helm chart for Kubernetes | |||||
name: catalog-api | |||||
version: 0.1.0 |
@ -1,9 +0,0 @@ | |||||
eShop Catalog API installed. | |||||
---------------------------- | |||||
This API is not directly exposed outside cluster. If need to access it use: | |||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "catalog-api.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 | |||||
@ -1,32 +0,0 @@ | |||||
{{/* vim: set filetype=mustache: */}} | |||||
{{/* | |||||
Expand the name of the chart. | |||||
*/}} | |||||
{{- define "catalog-api.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 "catalog-api.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 "catalog-api.chart" -}} | |||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | |||||
{{- end -}} |
@ -1,60 +0,0 @@ | |||||
{{- define "suffix-name" -}} | |||||
{{- if .Values.app.name -}} | |||||
{{- .Values.app.name -}} | |||||
{{- else -}} | |||||
{{- .Release.Name -}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "sql-name" -}} | |||||
{{- if .Values.inf.sql.host -}} | |||||
{{- .Values.inf.sql.host -}} | |||||
{{- else -}} | |||||
{{- printf "%s" "sql-data" -}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "mongo-name" -}} | |||||
{{- if .Values.inf.mongo.host -}} | |||||
{{- .Values.inf.mongo.host -}} | |||||
{{- else -}} | |||||
{{- printf "%s" "nosql-data" -}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "url-of" -}} | |||||
{{- $name := first .}} | |||||
{{- $ctx := last .}} | |||||
{{- if eq $name "" -}} | |||||
{{- $ctx.Values.inf.k8s.dns -}} | |||||
{{- else -}} | |||||
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} {{/*Value is just <dns>/<name> */}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "pathBase" -}} | |||||
{{- if .Values.inf.k8s.suffix -}} | |||||
{{- $suffix := include "suffix-name" . -}} | |||||
{{- printf "%s-%s" .Values.pathBase $suffix -}} | |||||
{{- else -}} | |||||
{{- .Values.pathBase -}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "fqdn-image" -}} | |||||
{{- if .Values.inf.registry -}} | |||||
{{- printf "%s/%s" .Values.inf.registry.server .Values.image.repository -}} | |||||
{{- else -}} | |||||
{{- .Values.image.repository -}} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- define "protocol" -}} | |||||
{{- if .Values.inf.tls.enabled -}} | |||||
{{- printf "%s" "https" -}} | |||||
{{- else -}} | |||||
{{- printf "%s" "http" -}} | |||||
{{- end -}} | |||||
{{- end -}} |
@ -1,21 +0,0 @@ | |||||
{{- $name := include "catalog-api.fullname" . -}} | |||||
{{- $sqlsrv := include "sql-name" . -}} | |||||
{{- $webshoppingapigw := include "url-of" (list .Values.app.ingress.entries.webshoppingapigw .) -}} | |||||
{{- $protocol := include "protocol" . -}} | |||||
apiVersion: v1 | |||||
kind: ConfigMap | |||||
metadata: | |||||
name: "cfg-{{ $name }}" | |||||
labels: | |||||
app: {{ template "catalog-api.name" . }} | |||||
chart: {{ template "catalog-api.chart" .}} | |||||
release: {{ .Release.Name }} | |||||
heritage: {{ .Release.Service }} | |||||
data: | |||||
catalog__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.catalog.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }}; | |||||
catalog__PicBaseUrl: {{ $protocol }}://{{ $webshoppingapigw }}/c/api/v1/catalog/items/[0]/pic/ | |||||
catalog__AzureStorageEnabled: "{{ .Values.inf.misc.useAzureStorage }}" | |||||
all__EventBusConnection: {{ .Values.inf.eventbus.constr }} | |||||
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" | |||||
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" |
@ -1,99 +0,0 @@ | |||||
{{- $name := include "catalog-api.fullname" . -}} | |||||
{{- $cfgname := printf "%s-%s" "cfg" $name -}} | |||||
apiVersion: apps/v1beta2 | |||||
kind: Deployment | |||||
metadata: | |||||
name: {{ template "catalog-api.fullname" . }} | |||||
labels: | |||||
ufo: {{ $cfgname}} | |||||
app: {{ template "catalog-api.name" . }} | |||||
chart: {{ template "catalog-api.chart" . }} | |||||
release: {{ .Release.Name }} | |||||
heritage: {{ .Release.Service }} | |||||
spec: | |||||
replicas: {{ .Values.replicaCount }} | |||||
selector: | |||||
matchLabels: | |||||
app: {{ template "catalog-api.name" . }} | |||||
release: {{ .Release.Name }} | |||||
template: | |||||
metadata: | |||||
labels: | |||||
app: {{ template "catalog-api.name" . }} | |||||
release: {{ .Release.Name }} | |||||
{{ if .Values.inf.mesh.enabled -}} | |||||
annotations: | |||||
linkerd.io/inject: enabled | |||||
{{- end }} | |||||
spec: | |||||
{{ if .Values.inf.registry -}} | |||||
imagePullSecrets: | |||||
- name: {{ .Values.inf.registry.secretName }} | |||||
{{- end }} | |||||
containers: | |||||
- name: {{ .Chart.Name }} | |||||
{{ if .Values.probes -}} | |||||
{{- if .Values.probes.liveness -}} | |||||
livenessProbe: | |||||
httpGet: | |||||
port: {{ .Values.probes.liveness.port }} | |||||
path: {{ .Values.probes.liveness.path }} | |||||
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }} | |||||
periodSeconds: {{ .Values.probes.liveness.periodSeconds }} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- if .Values.probes -}} | |||||
{{- if .Values.probes.readiness }} | |||||
readinessProbe: | |||||
httpGet: | |||||
port: {{ .Values.probes.readiness.port }} | |||||
path: {{ .Values.probes.readiness.path }} | |||||
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }} | |||||
periodSeconds: {{ .Values.probes.readiness.periodSeconds }} | |||||
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }} | |||||
{{- end -}} | |||||
{{- end }} | |||||
image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}" | |||||
imagePullPolicy: {{ .Values.image.pullPolicy }} | |||||
env: | |||||
- name: PATH_BASE | |||||
value: {{ include "pathBase" . }} | |||||
- name: k8sname | |||||
value: {{ .Values.clusterName }} | |||||
{{- if .Values.env.values -}} | |||||
{{- range .Values.env.values }} | |||||
- name: {{ .name }} | |||||
value: {{ .value | quote }} | |||||
{{- end -}} | |||||
{{- end -}} | |||||
{{- if .Values.env.configmap -}} | |||||
{{- range .Values.env.configmap }} | |||||
- name: {{ .name }} | |||||
valueFrom: | |||||
configMapKeyRef: | |||||
name: {{ $cfgname }} | |||||
key: {{ .key }} | |||||
{{- end -}} | |||||
{{- end }} | |||||
ports: | |||||
- name: http | |||||
containerPort: 80 | |||||
protocol: TCP | |||||
- name: grpc | |||||
containerPort: 81 | |||||
protocol: TCP | |||||
resources: | |||||
{{ toYaml .Values.resources | indent 12 }} | |||||
{{- with .Values.nodeSelector }} | |||||
nodeSelector: | |||||
{{ toYaml . | indent 8 }} | |||||
{{- end }} | |||||
{{- with .Values.affinity }} | |||||
affinity: | |||||
{{ toYaml . | indent 8 }} | |||||
{{- end }} | |||||
{{- with .Values.tolerations }} | |||||
tolerations: | |||||
{{ toYaml . | indent 8 }} | |||||
{{- end }} | |||||
@ -1,23 +0,0 @@ | |||||
apiVersion: v1 | |||||
kind: Service | |||||
metadata: | |||||
name: {{ .Values.app.svc.catalog }} | |||||
labels: | |||||
app: {{ template "catalog-api.name" . }} | |||||
chart: {{ template "catalog-api.chart" . }} | |||||
release: {{ .Release.Name }} | |||||
heritage: {{ .Release.Service }} | |||||
spec: | |||||
type: {{ .Values.service.type }} | |||||
ports: | |||||
- port: {{ .Values.service.port }} | |||||
targetPort: http | |||||
protocol: TCP | |||||
name: http | |||||
- port: {{ .Values.service.grpcPort }} | |||||
targetPort: grpc | |||||
protocol: TCP | |||||
name: grpc | |||||
selector: | |||||
app: {{ template "catalog-api.name" . }} | |||||
release: {{ .Release.Name }} |
@ -1,63 +0,0 @@ | |||||
replicaCount: 1 | |||||
clusterName: eshop-aks | |||||
pathBase: /catalog-api | |||||
image: | |||||
repository: eshop/catalog.api | |||||
tag: latest | |||||
pullPolicy: IfNotPresent | |||||
service: | |||||
type: ClusterIP | |||||
port: 80 | |||||
grpcPort: 81 | |||||
resources: {} | |||||
nodeSelector: {} | |||||
tolerations: [] | |||||
affinity: {} | |||||
# env defines the environment variables that will be declared in the pod | |||||
env: | |||||
urls: | |||||
# configmap declares variables which value is taken from the config map defined in template configmap.yaml (name is name of var and key the key in configmap). | |||||
configmap: | |||||
- name: ConnectionString | |||||
key: catalog__ConnectionString | |||||
- name: PicBaseUrl | |||||
key: catalog__PicBaseUrl | |||||
- name: AzureStorageEnabled | |||||
key: catalog__AzureStorageEnabled | |||||
- name: ApplicationInsights__InstrumentationKey | |||||
key: all__InstrumentationKey | |||||
- name: EventBusConnection | |||||
key: all__EventBusConnection | |||||
- name: AzureServiceBusEnabled | |||||
key: all__UseAzureServiceBus | |||||
# 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 | |||||
value: Development | |||||
- name: OrchestratorType | |||||
value: 'K8S' | |||||
- name: PORT | |||||
value: "80" | |||||
- name: GRPC_PORT | |||||
value: "81" | |||||
probes: | |||||
liveness: | |||||
path: /liveness | |||||
initialDelaySeconds: 10 | |||||
periodSeconds: 15 | |||||
port: 80 | |||||
readiness: | |||||
path: /hc | |||||
timeoutSeconds: 5 | |||||
initialDelaySeconds: 90 | |||||
periodSeconds: 60 | |||||
port: 80 | |||||
@ -1,149 +0,0 @@ | |||||
Param( | |||||
[parameter(Mandatory=$false)][string]$registry, | |||||
[parameter(Mandatory=$false)][string]$dockerUser, | |||||
[parameter(Mandatory=$false)][string]$dockerPassword, | |||||
[parameter(Mandatory=$false)][string]$externalDns, | |||||
[parameter(Mandatory=$false)][string]$appName="eshop", | |||||
[parameter(Mandatory=$false)][bool]$deployInfrastructure=$true, | |||||
[parameter(Mandatory=$false)][bool]$deployCharts=$true, | |||||
[parameter(Mandatory=$false)][bool]$clean=$true, | |||||
[parameter(Mandatory=$false)][string]$aksName="", | |||||
[parameter(Mandatory=$false)][string]$aksRg="", | |||||
[parameter(Mandatory=$false)][string]$imageTag="latest", | |||||
[parameter(Mandatory=$false)][bool]$useLocalk8s=$false, | |||||
[parameter(Mandatory=$false)][bool]$useMesh=$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", | |||||
[parameter(Mandatory=$false)][string]$chartsToDeploy="*", | |||||
[parameter(Mandatory=$false)][string]$ingressMeshAnnotationsFile="ingress_values_linkerd.yaml" | |||||
) | |||||
function Install-Chart { | |||||
Param([string]$chart,[string]$initialOptions, [bool]$customRegistry) | |||||
$options=$initialOptions | |||||
if ($sslEnabled) { | |||||
$options = "$options --set ingress.tls[0].secretName=$tlsSecretName --set ingress.tls[0].hosts={$dns}" | |||||
if ($sslSupport -ne "custom") { | |||||
$options = "$options --set inf.tls.issuer=$sslIssuer" | |||||
} | |||||
} | |||||
if ($customRegistry) { | |||||
$options = "$options --set inf.registry.server=$registry --set inf.registry.login=$dockerUser --set inf.registry.pwd=$dockerPassword --set inf.registry.secretName=eshop-docker-scret" | |||||
} | |||||
if ($chart -ne "eshop-common" -or $customRegistry) { # eshop-common is ignored when no secret must be deployed | |||||
$command = "install $options --name=$appName-$chart $chart" | |||||
Write-Host "Helm Command: helm $command" -ForegroundColor Gray | |||||
Invoke-Expression 'cmd /c "helm $command"' | |||||
} | |||||
} | |||||
$dns = $externalDns | |||||
$sslEnabled=$false | |||||
$sslIssuer="" | |||||
if ($sslSupport -eq "staging") { | |||||
$sslEnabled=$true | |||||
$tlsSecretName="eshop-letsencrypt-staging" | |||||
$sslIssuer="letsencrypt-staging" | |||||
} | |||||
elseif ($sslSupport -eq "prod") { | |||||
$sslEnabled=$true | |||||
$tlsSecretName="eshop-letsencrypt-prod" | |||||
$sslIssuer="letsencrypt-prod" | |||||
} | |||||
elseif ($sslSupport -eq "custom") { | |||||
$sslEnabled=$true | |||||
} | |||||
$ingressValuesFile="ingress_values.yaml" | |||||
if ($useLocalk8s -eq $true) { | |||||
$ingressValuesFile="ingress_values_dockerk8s.yaml" | |||||
$dns="localhost" | |||||
} | |||||
if ($externalDns -eq "aks") { | |||||
if ([string]::IsNullOrEmpty($aksName) -or [string]::IsNullOrEmpty($aksRg)) { | |||||
Write-Host "Error: When using -dns aks, MUST set -aksName and -aksRg too." -ForegroundColor Red | |||||
exit 1 | |||||
} | |||||
Write-Host "Getting DNS of AKS of AKS $aksName (in resource group $aksRg)..." -ForegroundColor Green | |||||
$dns = $(az aks show -n $aksName -g $aksRg --query addonProfiles.httpApplicationRouting.config.HTTPApplicationRoutingZoneName) | |||||
if ([string]::IsNullOrEmpty($dns)) { | |||||
Write-Host "Error getting DNS of AKS $aksName (in resource group $aksRg). Please ensure AKS has httpRouting enabled AND Azure CLI is logged & in version 2.0.37 or higher" -ForegroundColor Red | |||||
exit 1 | |||||
} | |||||
$dns = $dns -replace '[\"]' | |||||
Write-Host "DNS base found is $dns. Will use $appName.$dns for the app!" -ForegroundColor Green | |||||
$dns = "$appName.$dns" | |||||
} | |||||
# Initialization & check commands | |||||
if ([string]::IsNullOrEmpty($dns)) { | |||||
Write-Host "No DNS specified. Ingress resources will be bound to public ip" -ForegroundColor Yellow | |||||
if ($sslEnabled) { | |||||
Write-Host "Can't bound SSL to public IP. DNS is mandatory when using TLS" -ForegroundColor Red | |||||
exit 1 | |||||
} | |||||
} | |||||
if ($useLocalk8s -and $sslEnabled) { | |||||
Write-Host "SSL can'be enabled on local K8s." -ForegroundColor Red | |||||
exit 1 | |||||
} | |||||
if ($clean) { | |||||
Write-Host "Cleaning previous helm releases..." -ForegroundColor Green | |||||
helm delete --purge $(helm ls -q eshop) | |||||
Write-Host "Previous releases deleted" -ForegroundColor Green | |||||
} | |||||
$useCustomRegistry=$false | |||||
if (-not [string]::IsNullOrEmpty($registry)) { | |||||
$useCustomRegistry=$true | |||||
if ([string]::IsNullOrEmpty($dockerUser) -or [string]::IsNullOrEmpty($dockerPassword)) { | |||||
Write-Host "Error: Must use -dockerUser AND -dockerPassword if specifying custom registry" -ForegroundColor Red | |||||
exit 1 | |||||
} | |||||
} | |||||
Write-Host "Begin eShopOnContainers installation using Helm" -ForegroundColor Green | |||||
$infras = ("sql-data", "nosql-data", "rabbitmq", "keystore-data", "basket-data") | |||||
$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 = ("apigwmm", "apigwms", "apigwwm", "apigwws") | |||||
if ($deployInfrastructure) { | |||||
foreach ($infra in $infras) { | |||||
Write-Host "Installing infrastructure: $infra" -ForegroundColor Green | |||||
helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" --name="$appName-$infra" $infra | |||||
} | |||||
} | |||||
else { | |||||
Write-Host "eShopOnContainers infrastructure (bbdd, redis, ...) charts aren't installed (-deployCharts is false)" -ForegroundColor Yellow | |||||
} | |||||
if ($deployCharts) { | |||||
foreach ($chart in $charts) { | |||||
if ($chartsToDeploy -eq "*" -or $chartsToDeploy.Contains($chart)) { | |||||
Write-Host "Installing: $chart" -ForegroundColor Green | |||||
Install-Chart $chart "-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=$imageTag --set image.pullPolicy=$imagePullPolicy --set inf.tls.enabled=$sslEnabled --set inf.mesh.enabled=$useMesh --set inf.k8s.local=$useLocalk8s" $useCustomRegistry | |||||
} | |||||
} | |||||
foreach ($chart in $gateways) { | |||||
if ($chartsToDeploy -eq "*" -or $chartsToDeploy.Contains($chart)) { | |||||
Write-Host "Installing Api Gateway Chart: $chart" -ForegroundColor Green | |||||
Install-Chart $chart "-f app.yaml -f inf.yaml -f $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set image.pullPolicy=$imagePullPolicy --set inf.mesh.enabled=$useMesh --set ingress.hosts={$dns} --set inf.tls.enabled=$sslEnabled" $false | |||||
} | |||||
} | |||||
} | |||||
else { | |||||
Write-Host "eShopOnContainers non-infrastructure charts aren't installed (-deployCharts is false)" -ForegroundColor Yellow | |||||
} | |||||
Write-Host "helm charts installed." -ForegroundColor Green |
@ -1,232 +0,0 @@ | |||||
#!/usr/bin/env bash | |||||
# http://redsymbol.net/articles/unofficial-bash-strict-mode | |||||
set -euo pipefail | |||||
usage() | |||||
{ | |||||
cat <<END | |||||
deploy.sh: deploys the $app_name application to a Kubernetes cluster using Helm. | |||||
Parameters: | |||||
--aks-name <AKS cluster name> | |||||
The name of the AKS cluster. Required when the registry (using the -r parameter) is set to "aks". | |||||
--aks-rg <AKS resource group> | |||||
The resource group for the AKS cluster. Required when the registry (using the -r parameter) is set to "aks". | |||||
-b | --build-solution | |||||
Force a solution build before deployment (default: false). | |||||
-d | --dns <dns or ip address> | --dns aks | |||||
Specifies the external DNS/ IP address of the Kubernetes cluster. | |||||
If 'aks' is set as value, the DNS value is retrieved from the AKS. --aks-name and --aks-rg are needed. | |||||
When --use-local-k8s is specified the external DNS is automatically set to localhost. | |||||
-h | --help | |||||
Displays this help text and exits the script. | |||||
--image-build | |||||
Build images (default is to not build all images). | |||||
--image-push | |||||
Upload images to the container registry (default is not pushing to the custom registry) | |||||
-n | --app-name <the name of the app> | |||||
Specifies the name of the application (default: eshop). | |||||
--namespace <namespace name> | |||||
Specifies the namespace name to deploy the app. If it doesn't exists it will be created (default: eshop). | |||||
-p | --docker-password <docker password> | |||||
The Docker password used to logon to the custom registry, supplied using the -r parameter. | |||||
-r | --registry <container registry> | |||||
Specifies the container registry to use (required), e.g. myregistry.azurecr.io. | |||||
--skip-clean | |||||
Do not clean the Kubernetes cluster (default is to clean the cluster). | |||||
--skip-infrastructure | |||||
Do not deploy infrastructure resources (like sql-data, no-sql or redis). | |||||
This is useful for production environments where infrastructure is hosted outside the Kubernetes cluster. | |||||
-t | --tag <docker image tag> | |||||
The tag used for the newly created docker images. Default: latest. | |||||
-u | --docker-username <docker username> | |||||
The Docker username used to logon to the custom registry, supplied using the -r parameter. | |||||
--use-local-k8s | |||||
Deploy to a locally installed Kubernetes (default: false). | |||||
It is assumed that the Kubernetes cluster has been granted access to the container registry. | |||||
If using AKS and ACR see link for more info: | |||||
https://docs.microsoft.com/en-us/azure/container-registry/container-registry-auth-aks | |||||
WARNING! THE SCRIPT WILL COMPLETELY DESTROY ALL DEPLOYMENTS AND SERVICES VISIBLE | |||||
FROM THE CURRENT CONFIGURATION CONTEXT AND NAMESPACE. | |||||
It is recommended that you check your selected namespace, 'eshop' by default, is already in use. | |||||
Every deployment and service done in the namespace will be deleted. | |||||
For more information see https://kubernetes.io/docs/tasks/administer-cluster/namespaces/ | |||||
END | |||||
} | |||||
app_name='eshop' | |||||
aks_name='' | |||||
aks_rg='' | |||||
build_images='' | |||||
clean='yes' | |||||
build_solution='' | |||||
container_registry='' | |||||
docker_password='' | |||||
docker_username='' | |||||
dns='' | |||||
image_tag='latest' | |||||
push_images='' | |||||
skip_infrastructure='' | |||||
use_local_k8s='' | |||||
namespace='eshop' | |||||
while [[ $# -gt 0 ]]; do | |||||
case "$1" in | |||||
--aks-name ) | |||||
aks_name="$2"; shift 2;; | |||||
--aks-rg ) | |||||
aks_rg="$2"; shift 2;; | |||||
-b | --build-solution ) | |||||
build_solution='yes'; shift ;; | |||||
-d | --dns ) | |||||
dns="$2"; shift 2;; | |||||
-h | --help ) | |||||
usage; exit 1 ;; | |||||
-n | --app-name ) | |||||
app_name="$2"; shift 2;; | |||||
-p | --docker-password ) | |||||
docker_password="$2"; shift 2;; | |||||
-r | --registry ) | |||||
container_registry="$2"; shift 2;; | |||||
--skip-clean ) | |||||
clean=''; shift ;; | |||||
--image-build ) | |||||
build_images='yes'; shift ;; | |||||
--image-push ) | |||||
push_images='yes'; shift ;; | |||||
--skip-infrastructure ) | |||||
skip_infrastructure='yes'; shift ;; | |||||
-t | --tag ) | |||||
image_tag="$2"; shift 2;; | |||||
-u | --docker-username ) | |||||
docker_username="$2"; shift 2;; | |||||
--use-local-k8s ) | |||||
use_local_k8s='yes'; shift ;; | |||||
--namespace ) | |||||
namespace="$2"; shift 2;; | |||||
*) | |||||
echo "Unknown option $1" | |||||
usage; exit 2 ;; | |||||
esac | |||||
done | |||||
if [[ $build_solution ]]; then | |||||
echo "#################### Building $app_name solution ####################" | |||||
dotnet publish -o obj/Docker/publish ../../eShopOnContainers-ServicesAndWebApps.sln | |||||
fi | |||||
export TAG=$image_tag | |||||
if [[ $build_images ]]; then | |||||
echo "#################### Building the $app_name Docker images ####################" | |||||
docker-compose -p ../.. -f ../../docker-compose.yml build | |||||
# Remove temporary images | |||||
docker rmi $(docker images -qf "dangling=true") | |||||
fi | |||||
use_custom_registry='' | |||||
if [[ -n $container_registry ]]; then | |||||
echo "################ Log into custom registry $container_registry ##################" | |||||
use_custom_registry='yes' | |||||
if [[ -z $docker_username ]] || [[ -z $docker_password ]]; then | |||||
echo "Error: Must use -u (--docker-username) AND -p (--docker-password) if specifying custom registry" | |||||
exit 1 | |||||
fi | |||||
docker login -u $docker_username -p $docker_password $container_registry | |||||
fi | |||||
if [[ $push_images ]]; then | |||||
echo "#################### Pushing images to the container registry ####################" | |||||
services=(basket.api catalog.api identity.api ordering.api payment.api webmvc webspa webstatus) | |||||
if [[ -z "$(docker image ls -q --filter=reference=eshop/$service:$image_tag)" ]]; then | |||||
image_tag=linux-$image_tag | |||||
fi | |||||
for service in "${services[@]}" | |||||
do | |||||
echo "Pushing image for service $service..." | |||||
docker tag "eshop/$service:$image_tag" "$container_registry/$service:$image_tag" | |||||
docker push "$container_registry/$service:$image_tag" | |||||
done | |||||
fi | |||||
ingress_values_file="ingress_values.yaml" | |||||
if [[ $use_local_k8s ]]; then | |||||
ingress_values_file="ingress_values_dockerk8s.yaml" | |||||
dns="localhost" | |||||
fi | |||||
if [[ $dns == "aks" ]]; then | |||||
echo "#################### Begin AKS discovery based on the --dns aks setting. ####################" | |||||
if [[ -z $aks_name ]] || [[ -z $aks_rg ]]; then | |||||
echo "Error: When using -dns aks, MUST set -aksName and -aksRg too." | |||||
echo '' | |||||
usage | |||||
exit 1 | |||||
fi | |||||
echo "Getting AKS cluster $aks_name AKS (in resource group $aks_rg)" | |||||
# JMESPath queries are case sensitive and httpapplicationrouting can be lowercase sometimes | |||||
jmespath_dnsqueries=(\ | |||||
addonProfiles.httpApplicationRouting.config.HTTPApplicationRoutingZoneName \ | |||||
addonProfiles.httpapplicationrouting.config.HTTPApplicationRoutingZoneName \ | |||||
) | |||||
for q in "${jmespath_dnsqueries[@]}" | |||||
do | |||||
dns="$(az aks show -n $aks_name -g $aks_rg --query $q -o tsv)" | |||||
if [[ -n $dns ]]; then break; fi | |||||
done | |||||
if [[ -z $dns ]]; then | |||||
echo "Error: when getting DNS of AKS $aks_name (in resource group $aks_rg). Please ensure AKS has httpRouting enabled AND Azure CLI is logged in and is of version 2.0.37 or higher." | |||||
exit 1 | |||||
fi | |||||
echo "DNS base found is $dns. Will use $aks_name.$dns for the app!" | |||||
dns="$aks_name.$dns" | |||||
fi | |||||
# Initialization & check commands | |||||
if [[ -z $dns ]]; then | |||||
echo "No DNS specified. Ingress resources will be bound to public IP." | |||||
fi | |||||
if [[ $clean ]]; then | |||||
echo "Cleaning previous helm releases..." | |||||
if [[ -z $(helm ls -q --namespace $namespace) ]]; then | |||||
echo "No previous releases found" | |||||
else | |||||
helm delete --purge $(helm ls -q --namespace $namespace) | |||||
echo "Previous releases deleted" | |||||
waitsecs=10; while [ $waitsecs -gt 0 ]; do echo -ne "$waitsecs\033[0K\r"; sleep 1; : $((waitsecs--)); done | |||||
fi | |||||
fi | |||||
echo "#################### Begin $app_name installation using Helm ####################" | |||||
infras=(sql-data nosql-data rabbitmq keystore-data basket-data) | |||||
charts=(eshop-common apigwms apigwws basket-api catalog-api identity-api mobileshoppingagg ordering-api ordering-backgroundtasks ordering-signalrhub payment-api webmvc webshoppingagg webspa webstatus webhooks-api webhooks-web) | |||||
if [[ !$skip_infrastructure ]]; then | |||||
for infra in "${infras[@]}" | |||||
do | |||||
echo "Installing infrastructure: $infra" | |||||
helm install --namespace $namespace --set "ingress.hosts={$dns}" --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --name="$app_name-$infra" $infra | |||||
done | |||||
fi | |||||
for chart in "${charts[@]}" | |||||
do | |||||
echo "Installing: $chart" | |||||
if [[ $use_custom_registry ]]; then | |||||
helm install --namespace $namespace --set "ingress.hosts={$dns}" --set inf.registry.server=$container_registry --set inf.registry.login=$docker_username --set inf.registry.pwd=$docker_password --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always --name="$app_name-$chart" $chart | |||||
elif [[ $chart != "eshop-common" ]]; then # eshop-common is ignored when no secret must be deployed | |||||
helm install --namespace $namespace --set "ingress.hosts={$dns}" --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always --name="$app_name-$chart" $chart | |||||
fi | |||||
done | |||||
echo "FINISHED: Helm charts installed." |
@ -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 |
@ -1,5 +0,0 @@ | |||||
apiVersion: v1 | |||||
appVersion: "1.0" | |||||
description: A Helm chart for Kubernetes | |||||
name: eshop-common | |||||
version: 0.1.0 |
@ -1,7 +0,0 @@ | |||||
Common eShop resources installed: | |||||
{{- if .Values.inf.registry -}} | |||||
* Docker registry secret ({{ .Values.inf.registry.secretName }}) | |||||
{{- end -}} | |||||
+++ Done +++ |
@ -1,32 +0,0 @@ | |||||
{{/* vim: set filetype=mustache: */}} | |||||
{{/* | |||||
Expand the name of the chart. | |||||
*/}} | |||||
{{- define "eshop-common.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 "eshop-common.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 "eshop-common.chart" -}} | |||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | |||||
{{- end -}} |
@ -1,3 +0,0 @@ | |||||
{{- define "imagePullSecret" }} | |||||
{{- printf "{\"auths\": {\"%s\": {\"auth\": \"%s\"}}}" .Values.inf.registry.server (printf "%s:%s" .Values.inf.registry.login .Values.inf.registry.pwd | b64enc) | b64enc }} | |||||
{{- end }} |
@ -1,9 +0,0 @@ | |||||
{{- if .Values.inf.registry -}} | |||||
apiVersion: v1 | |||||
kind: Secret | |||||
metadata: | |||||
name: {{ .Values.inf.registry.secretName }} | |||||
type: kubernetes.io/dockerconfigjson | |||||
data: | |||||
.dockerconfigjson: {{ template "imagePullSecret" . }} | |||||
{{- end -}} |
@ -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 |
@ -1,5 +0,0 @@ | |||||
apiVersion: v1 | |||||
appVersion: "1.0" | |||||
description: A Helm chart for Kubernetes | |||||
name: identity-api | |||||
version: 0.1.0 |