Ordering background tasks helm chart
This commit is contained in:
parent
3b6d08c0a0
commit
4ec4ecd92f
21
k8s/helm/ordering-backgroundtasks/.helmignore
Normal file
21
k8s/helm/ordering-backgroundtasks/.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/ordering-backgroundtasks/Chart.yaml
Normal file
5
k8s/helm/ordering-backgroundtasks/Chart.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
appVersion: "1.0"
|
||||||
|
description: A Helm chart for Kubernetes
|
||||||
|
name: ordering-backgroundtasks
|
||||||
|
version: 0.1.0
|
19
k8s/helm/ordering-backgroundtasks/templates/NOTES.txt
Normal file
19
k8s/helm/ordering-backgroundtasks/templates/NOTES.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
1. Get the application URL by running these commands:
|
||||||
|
{{- if .Values.ingress.enabled }}
|
||||||
|
{{- range .Values.ingress.hosts }}
|
||||||
|
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else if contains "NodePort" .Values.service.type }}
|
||||||
|
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "ordering-graceperiod.fullname" . }})
|
||||||
|
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||||
|
echo http://$NODE_IP:$NODE_PORT
|
||||||
|
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||||
|
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||||
|
You can watch the status of by running 'kubectl get svc -w {{ template "ordering-graceperiod.fullname" . }}'
|
||||||
|
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "ordering-graceperiod.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
|
||||||
|
echo http://$SERVICE_IP:{{ .Values.service.port }}
|
||||||
|
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||||
|
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "ordering-graceperiod.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||||
|
echo "Visit http://127.0.0.1:8080 to use your application"
|
||||||
|
kubectl port-forward $POD_NAME 8080:80
|
||||||
|
{{- end }}
|
32
k8s/helm/ordering-backgroundtasks/templates/_helpers.tpl
Normal file
32
k8s/helm/ordering-backgroundtasks/templates/_helpers.tpl
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Expand the name of the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "ordering-backgroundtasks.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 "ordering-backgroundtasks.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 "ordering-backgroundtasks.chart" -}}
|
||||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
33
k8s/helm/ordering-backgroundtasks/templates/_names.tpl
Normal file
33
k8s/helm/ordering-backgroundtasks/templates/_names.tpl
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{{- 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 "url-identity" -}}
|
||||||
|
{{- if .Values.app.ingress.suffix -}}
|
||||||
|
{{- $suffix := include "suffix-name" . -}}
|
||||||
|
{{- printf "%s/identity-api-%s" .Values.inf.k8s.dns $suffix -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s/identity-api" .Values.inf.k8s.dns -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{ define "pathBase" -}}
|
||||||
|
{{- if .Values.app.ingress.suffix -}}
|
||||||
|
{{- $suffix := include "suffix-name" . -}}
|
||||||
|
{{- printf "%s-%s" .Values.pathBase $suffix -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- .Values.pathBase -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
20
k8s/helm/ordering-backgroundtasks/templates/configmap.yaml
Normal file
20
k8s/helm/ordering-backgroundtasks/templates/configmap.yaml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{{- $name := include "ordering-backgroundtasks.fullname" . -}}
|
||||||
|
{{- $sqlsrv := include "sql-name" . -}}
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: "cfg-{{ $name }}"
|
||||||
|
labels:
|
||||||
|
app: {{ template "ordering-backgroundtasks.name" . }}
|
||||||
|
chart: {{ template "ordering-backgroundtasks.chart" .}}
|
||||||
|
release: {{ .Release.Name }}
|
||||||
|
heritage: {{ .Release.Service }}
|
||||||
|
data:
|
||||||
|
ordering__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.ordering.db }};User Id={{ .Values.inf.sql.ordering.user }};Password={{ .Values.inf.sql.ordering.pwd }};
|
||||||
|
ordering__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
|
||||||
|
all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
|
||||||
|
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
|
||||||
|
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"
|
||||||
|
graceperiodmanager__CheckUpdateTime: {{ .Values.cfg.checkUpdateTime }}
|
||||||
|
graceperiodmanager__GracePeriodTime : {{ .Values.cfg.gracePeriodTime }}
|
73
k8s/helm/ordering-backgroundtasks/templates/deployment.yaml
Normal file
73
k8s/helm/ordering-backgroundtasks/templates/deployment.yaml
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
{{- $name := include "ordering-backgroundtasks.fullname" . -}}
|
||||||
|
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
|
||||||
|
apiVersion: apps/v1beta2
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{ template "ordering-backgroundtasks.fullname" . }}
|
||||||
|
labels:
|
||||||
|
ufo: {{ $cfgname}}
|
||||||
|
app: {{ template "ordering-backgroundtasks.name" . }}
|
||||||
|
chart: {{ template "ordering-backgroundtasks.chart" . }}
|
||||||
|
release: {{ .Release.Name }}
|
||||||
|
heritage: {{ .Release.Service }}
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.replicaCount }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{ template "ordering-backgroundtasks.name" . }}
|
||||||
|
release: {{ .Release.Name }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ template "ordering-backgroundtasks.name" . }}
|
||||||
|
release: {{ .Release.Name }}
|
||||||
|
spec:
|
||||||
|
{{ if .Values.imagePullSecrets -}}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{ range .Values.imagePullSecrets -}}
|
||||||
|
- name: {{ .name }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
|
containers:
|
||||||
|
- name: {{ .Chart.Name }}
|
||||||
|
image: "{{ .Values.image.repository }}:{{ .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 }}
|
||||||
|
|
38
k8s/helm/ordering-backgroundtasks/templates/ingress.yaml
Normal file
38
k8s/helm/ordering-backgroundtasks/templates/ingress.yaml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{{- if .Values.ingress.enabled -}}
|
||||||
|
{{- $fullName := include "ordering-backgroundtasks.fullname" . -}}
|
||||||
|
{{- $ingressPath := include "pathBase" . -}}
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: {{ $fullName }}
|
||||||
|
labels:
|
||||||
|
app: {{ template "ordering-backgroundtasks.name" . }}
|
||||||
|
chart: {{ template "ordering-backgroundtasks.chart" . }}
|
||||||
|
release: {{ .Release.Name }}
|
||||||
|
heritage: {{ .Release.Service }}
|
||||||
|
{{- with .Values.ingress.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{ toYaml . | indent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- if .Values.ingress.tls }}
|
||||||
|
tls:
|
||||||
|
{{- range .Values.ingress.tls }}
|
||||||
|
- hosts:
|
||||||
|
{{- range .hosts }}
|
||||||
|
- {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
secretName: {{ .secretName }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
rules:
|
||||||
|
{{- range .Values.ingress.hosts }}
|
||||||
|
- host: {{ . }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: {{ $ingressPath }}
|
||||||
|
backend:
|
||||||
|
serviceName: {{ $fullName }}
|
||||||
|
servicePort: http
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
19
k8s/helm/ordering-backgroundtasks/templates/service.yaml
Normal file
19
k8s/helm/ordering-backgroundtasks/templates/service.yaml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ template "ordering-backgroundtasks.fullname" . }}
|
||||||
|
labels:
|
||||||
|
app: {{ template "ordering-backgroundtasks.name" . }}
|
||||||
|
chart: {{ template "ordering-backgroundtasks.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 "ordering-backgroundtasks.name" . }}
|
||||||
|
release: {{ .Release.Name }}
|
77
k8s/helm/ordering-backgroundtasks/values.yaml
Normal file
77
k8s/helm/ordering-backgroundtasks/values.yaml
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
replicaCount: 1
|
||||||
|
clusterName: eshop-aks
|
||||||
|
pathBase: /ordering-backgroundtasks
|
||||||
|
|
||||||
|
image:
|
||||||
|
repository: eshop/ordering.backgroundtasks
|
||||||
|
tag: latest
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
service:
|
||||||
|
type: ClusterIP
|
||||||
|
port: 80
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
enabled: false
|
||||||
|
annotations: {}
|
||||||
|
hosts:
|
||||||
|
- chart-example.local
|
||||||
|
tls: []
|
||||||
|
|
||||||
|
cfg:
|
||||||
|
checkUpdateTime: "15000"
|
||||||
|
gracePeriodTime: "1"
|
||||||
|
|
||||||
|
inf:
|
||||||
|
sql:
|
||||||
|
ordering:
|
||||||
|
user: sa
|
||||||
|
pwd: Pass@word
|
||||||
|
db: CatalogDb
|
||||||
|
eventbus:
|
||||||
|
constr: rabbitmq
|
||||||
|
useAzure: false
|
||||||
|
appinsights:
|
||||||
|
key: ""
|
||||||
|
k8s:
|
||||||
|
dns: ""
|
||||||
|
misc:
|
||||||
|
useLoadTest: false
|
||||||
|
|
||||||
|
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: ordering__ConnectionString
|
||||||
|
- name: ApplicationInsights__InstrumentationKey
|
||||||
|
key: all__InstrumentationKey
|
||||||
|
- name: EventBusConnection
|
||||||
|
key: all__EventBusConnection
|
||||||
|
- name: AzureServiceBusEnabled
|
||||||
|
key: all__UseAzureServiceBus
|
||||||
|
- name: IdentityUrl
|
||||||
|
key: urls__IdentityUrl
|
||||||
|
- name: UseLoadTest
|
||||||
|
key: ordering__EnableLoadTest
|
||||||
|
- name: CheckUpdateTime
|
||||||
|
key: graceperiodmanager__CheckUpdateTime
|
||||||
|
- name: GracePeriodTime
|
||||||
|
key: graceperiodmanager__GracePeriodTime
|
||||||
|
# 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'
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user