new helm charts for webhooks
This commit is contained in:
parent
9b0eaddb15
commit
50a5f8b0b4
@ -22,6 +22,8 @@ app: # app global settings
|
||||
payment: payment-api # ingress entry for payment api
|
||||
locations: locations-api # ingress entry for locations api
|
||||
marketing: marketing-api # ingress entry for marketing api
|
||||
webhooks: webhooks-api # ingress entry for webhooks api
|
||||
webhooksweb: webhooks-web # ingress entry for webhooks web demo client
|
||||
svc:
|
||||
basket: basket # service name for basket api
|
||||
catalog: catalog # service name for catalog api
|
||||
@ -41,3 +43,5 @@ app: # app global settings
|
||||
payment: payment # service name for payment api
|
||||
locations: locations # service name for locations api
|
||||
marketing: marketing # service name for marketing ap
|
||||
webhooks: webhooks # service name for webhooks api
|
||||
webhooksweb: webhooksweb # service name for webhooks web
|
||||
|
@ -61,7 +61,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")
|
||||
$charts = ("eshop-common", "apigwmm", "apigwms", "apigwwm", "apigwws", "basket-api","catalog-api", "identity-api", "locations-api", "marketing-api", "mobileshoppingagg","ordering-api","ordering-backgroundtasks","ordering-signalrhub", "payment-api", "webmvc", "webshoppingagg", "webspa", "webstatus")
|
||||
$charts = ("eshop-common", "apigwmm", "apigwms", "apigwwm", "apigwws", "basket-api","catalog-api", "identity-api", "locations-api", "marketing-api", "mobileshoppingagg","ordering-api","ordering-backgroundtasks","ordering-signalrhub", "payment-api", "webmvc", "webshoppingagg", "webspa", "webstatus", "webhooks-api", "webhooks-web")
|
||||
|
||||
if ($deployInfrastructure) {
|
||||
foreach ($infra in $infras) {
|
||||
|
@ -9,6 +9,8 @@
|
||||
{{- $mobileshoppingagg := include "url-of" (list .Values.app.ingress.entries.mobileshoppingagg .) -}}
|
||||
{{- $webhoppingagg := include "url-of" (list .Values.app.ingress.entries.webshoppingagg .) -}}
|
||||
{{- $xamarincallback := include "url-of" (list "xamarincallback" .) -}}
|
||||
{{- $webhooks_url := include "url-of" (list .Values.app.ingress.entries.webhooks .) -}}
|
||||
{{- $webhooksweb_url := include "url-of" (list .Values.app.ingress.entries.webhooksweb .) -}}
|
||||
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
@ -32,4 +34,7 @@ data:
|
||||
mobileshoppingagg_e: http://{{ $mobileshoppingagg }}
|
||||
webshoppingagg_e: http://{{ $webhoppingagg }}
|
||||
xamarin_callback_e: http://{{ $xamarincallback }}
|
||||
webhooksapi_e: http://{{ $webhooks_url }}
|
||||
webhooksweb_e: http://{{ $webhooksweb_url }}
|
||||
|
||||
|
||||
|
@ -54,6 +54,10 @@ env:
|
||||
key: webshoppingagg_e
|
||||
- name: XamarinCallback
|
||||
key: xamarin_callback_e
|
||||
- name: WebhooksApiClient
|
||||
key: webhooksapi_e
|
||||
- name: WebhooksWebClient
|
||||
key: webhooksweb_e
|
||||
values:
|
||||
- name: ASPNETCORE_ENVIRONMENT
|
||||
value: Development
|
||||
|
@ -16,6 +16,8 @@ inf:
|
||||
db: IdentityDb # Ordering API SQL db name
|
||||
marketing:
|
||||
db: MarketingDb # Marketing API SQL db name
|
||||
webhooks:
|
||||
db: WebhooksDb # Webhooks DB
|
||||
mongo:
|
||||
# host: my-nosql-data # Uncomment to use specify custom mongo host. By default nosql-data is used
|
||||
locations:
|
||||
|
21
k8s/helm/webhooks-api/.helmignore
Normal file
21
k8s/helm/webhooks-api/.helmignore
Normal file
@ -0,0 +1,21 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
5
k8s/helm/webhooks-api/Chart.yaml
Normal file
5
k8s/helm/webhooks-api/Chart.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
apiVersion: v1
|
||||
appVersion: "1.0"
|
||||
description: A Helm chart for Kubernetes
|
||||
name: webhooks-api
|
||||
version: 0.1.0
|
8
k8s/helm/webhooks-api/templates/NOTES.txt
Normal file
8
k8s/helm/webhooks-api/templates/NOTES.txt
Normal file
@ -0,0 +1,8 @@
|
||||
eShop Ordering 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 "webhooks-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
|
32
k8s/helm/webhooks-api/templates/_helpers.tpl
Normal file
32
k8s/helm/webhooks-api/templates/_helpers.tpl
Normal file
@ -0,0 +1,32 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "webhooks-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 "webhooks-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 "webhooks-api.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
51
k8s/helm/webhooks-api/templates/_names.tpl
Normal file
51
k8s/helm/webhooks-api/templates/_names.tpl
Normal file
@ -0,0 +1,51 @@
|
||||
{{- 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 -}}
|
20
k8s/helm/webhooks-api/templates/configmap.yaml
Normal file
20
k8s/helm/webhooks-api/templates/configmap.yaml
Normal file
@ -0,0 +1,20 @@
|
||||
{{- $name := include "webhooks-api.fullname" . -}}
|
||||
{{- $sqlsrv := include "sql-name" . -}}
|
||||
{{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}}
|
||||
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: "cfg-{{ $name }}"
|
||||
labels:
|
||||
app: {{ template "webhooks-api.name" . }}
|
||||
chart: {{ template "webhooks-api.chart" .}}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
data:
|
||||
webhooks__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.webhooks.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }};
|
||||
urls__IdentityUrl: http://{{ $identity }}
|
||||
urls__IdentityUrlExternal: http://{{ $identity }}
|
||||
all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
|
||||
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
|
||||
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"
|
71
k8s/helm/webhooks-api/templates/deployment.yaml
Normal file
71
k8s/helm/webhooks-api/templates/deployment.yaml
Normal file
@ -0,0 +1,71 @@
|
||||
{{- $name := include "webhooks-api.fullname" . -}}
|
||||
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
|
||||
apiVersion: apps/v1beta2
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "webhooks-api.fullname" . }}
|
||||
labels:
|
||||
ufo: {{ $cfgname}}
|
||||
app: {{ template "webhooks-api.name" . }}
|
||||
chart: {{ template "webhooks-api.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ template "webhooks-api.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "webhooks-api.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
{{ if .Values.inf.registry -}}
|
||||
imagePullSecrets:
|
||||
- name: {{ .Values.inf.registry.secretName }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
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
|
||||
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 }}
|
||||
|
33
k8s/helm/webhooks-api/templates/ingress.yaml
Normal file
33
k8s/helm/webhooks-api/templates/ingress.yaml
Normal file
@ -0,0 +1,33 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $ingressPath := include "pathBase" . -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ template "webhooks-api.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "webhooks-api.name" . }}
|
||||
chart: {{ template "webhooks-api.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.ingress.tls }}
|
||||
- hosts:
|
||||
- {{ .Values.inf.k8s.dns }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
- host: {{ .Values.inf.k8s.dns }}
|
||||
http:
|
||||
paths:
|
||||
- path: {{ $ingressPath }}
|
||||
backend:
|
||||
serviceName: {{ .Values.app.svc.webhooks }}
|
||||
servicePort: http
|
||||
{{- end }}
|
19
k8s/helm/webhooks-api/templates/service.yaml
Normal file
19
k8s/helm/webhooks-api/templates/service.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Values.app.svc.ordering }}
|
||||
labels:
|
||||
app: {{ template "webhooks-api.name" . }}
|
||||
chart: {{ template "webhooks-api.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 "webhooks-api.name" . }}
|
||||
release: {{ .Release.Name }}
|
53
k8s/helm/webhooks-api/values.yaml
Normal file
53
k8s/helm/webhooks-api/values.yaml
Normal file
@ -0,0 +1,53 @@
|
||||
replicaCount: 1
|
||||
clusterName: eshop-aks
|
||||
pathBase: /webhooks-api
|
||||
|
||||
image:
|
||||
repository: eshop/ordering.api
|
||||
tag: latest
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 80
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
annotations: {}
|
||||
hosts:
|
||||
- chart-example.local
|
||||
tls: []
|
||||
|
||||
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: webhooks__ConnectionString
|
||||
- name: ApplicationInsights__InstrumentationKey
|
||||
key: all__InstrumentationKey
|
||||
- name: EventBusConnection
|
||||
key: all__EventBusConnection
|
||||
- name: AzureServiceBusEnabled
|
||||
key: all__UseAzureServiceBus
|
||||
- name: IdentityUrl
|
||||
key: urls__IdentityUrl
|
||||
- name: IdentityUrlExternal
|
||||
key: urls__IdentityUrlExternal
|
||||
# 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'
|
||||
|
21
k8s/helm/webhooks-web/.helmignore
Normal file
21
k8s/helm/webhooks-web/.helmignore
Normal file
@ -0,0 +1,21 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
5
k8s/helm/webhooks-web/Chart.yaml
Normal file
5
k8s/helm/webhooks-web/Chart.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
apiVersion: v1
|
||||
appVersion: "1.0"
|
||||
description: A Helm chart for Kubernetes
|
||||
name: webhooks-web
|
||||
version: 0.1.0
|
8
k8s/helm/webhooks-web/templates/NOTES.txt
Normal file
8
k8s/helm/webhooks-web/templates/NOTES.txt
Normal file
@ -0,0 +1,8 @@
|
||||
eShop Ordering 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 "webhooks-web.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
|
32
k8s/helm/webhooks-web/templates/_helpers.tpl
Normal file
32
k8s/helm/webhooks-web/templates/_helpers.tpl
Normal file
@ -0,0 +1,32 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "webhooks-web.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 "webhooks-web.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 "webhooks-web.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
51
k8s/helm/webhooks-web/templates/_names.tpl
Normal file
51
k8s/helm/webhooks-web/templates/_names.tpl
Normal file
@ -0,0 +1,51 @@
|
||||
{{- 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 -}}
|
18
k8s/helm/webhooks-web/templates/configmap.yaml
Normal file
18
k8s/helm/webhooks-web/templates/configmap.yaml
Normal file
@ -0,0 +1,18 @@
|
||||
{{- $name := include "webhooks-web.fullname" . -}}
|
||||
{{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}}
|
||||
{{- $webhooksweb := include "url-of" (list .Values.app.ingress.entries.webhooksweb .) -}}
|
||||
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: "cfg-{{ $name }}"
|
||||
labels:
|
||||
app: {{ template "webhooks-web.name" . }}
|
||||
chart: {{ template "webhooks-web.chart" .}}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
data:
|
||||
urls__webhooks: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.webhooks.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }};
|
||||
identity_e: http://{{ $identity }}
|
||||
webhooksweb_e: http://{{ $webhooksweb }}
|
||||
urls_webhooksweb: http://{{ .Values.app.svc.webhooksweb }}
|
71
k8s/helm/webhooks-web/templates/deployment.yaml
Normal file
71
k8s/helm/webhooks-web/templates/deployment.yaml
Normal file
@ -0,0 +1,71 @@
|
||||
{{- $name := include "webhooks-web.fullname" . -}}
|
||||
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
|
||||
apiVersion: apps/v1beta2
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "webhooks-web.fullname" . }}
|
||||
labels:
|
||||
ufo: {{ $cfgname}}
|
||||
app: {{ template "webhooks-web.name" . }}
|
||||
chart: {{ template "webhooks-web.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ template "webhooks-web.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "webhooks-web.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
{{ if .Values.inf.registry -}}
|
||||
imagePullSecrets:
|
||||
- name: {{ .Values.inf.registry.secretName }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
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
|
||||
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 }}
|
||||
|
33
k8s/helm/webhooks-web/templates/ingress.yaml
Normal file
33
k8s/helm/webhooks-web/templates/ingress.yaml
Normal file
@ -0,0 +1,33 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $ingressPath := include "pathBase" . -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ template "webhooks-web.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "webhooks-web.name" . }}
|
||||
chart: {{ template "webhooks-web.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.ingress.tls }}
|
||||
- hosts:
|
||||
- {{ .Values.inf.k8s.dns }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
- host: {{ .Values.inf.k8s.dns }}
|
||||
http:
|
||||
paths:
|
||||
- path: {{ $ingressPath }}
|
||||
backend:
|
||||
serviceName: {{ .Values.app.svc.webhooksweb }}
|
||||
servicePort: http
|
||||
{{- end }}
|
19
k8s/helm/webhooks-web/templates/service.yaml
Normal file
19
k8s/helm/webhooks-web/templates/service.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Values.app.svc.ordering }}
|
||||
labels:
|
||||
app: {{ template "webhooks-web.name" . }}
|
||||
chart: {{ template "webhooks-web.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 "webhooks-web.name" . }}
|
||||
release: {{ .Release.Name }}
|
52
k8s/helm/webhooks-web/values.yaml
Normal file
52
k8s/helm/webhooks-web/values.yaml
Normal file
@ -0,0 +1,52 @@
|
||||
replicaCount: 1
|
||||
clusterName: eshop-aks
|
||||
pathBase: /webhooks-web
|
||||
|
||||
image:
|
||||
repository: eshop/webhooksweb
|
||||
tag: latest
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 80
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
annotations: {}
|
||||
hosts:
|
||||
- chart-example.local
|
||||
tls: []
|
||||
|
||||
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: WebhooksUrl
|
||||
key: urls__webhooks
|
||||
- name: IdentityUrl
|
||||
key: identity_e
|
||||
- name: CallbackUrl
|
||||
key: webhooksweb_e
|
||||
- name: SelfUrl
|
||||
key: webhooksweb_e
|
||||
# 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: Production
|
||||
- name: OrchestratorType
|
||||
value: 'K8S'
|
||||
- name: Token
|
||||
value: "WebHooks-Demo-Web" # Can use whatever you want
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user