Browse Source

Added background-services to k8s

pull/51/head
Halil İbrahim Kalkan 5 years ago
parent
commit
56f794b746
  1. 6
      etc/k8s/helm-chart/eventhub/charts/background-services/Chart.yaml
  2. 18
      etc/k8s/helm-chart/eventhub/charts/background-services/templates/background-services.yaml
  3. 0
      etc/k8s/helm-chart/eventhub/charts/background-services/values.yaml
  4. 4
      etc/k8s/helm-chart/eventhub/charts/dbmigrator/templates/migrator.yaml
  5. 4
      etc/k8s/helm-chart/eventhub/values.yaml
  6. 10
      etc/k8s/scripts/build-images.ps1
  7. 4
      src/EventHub.BackgroundServices/Dockerfile

6
etc/k8s/helm-chart/eventhub/charts/background-services/Chart.yaml

@ -0,0 +1,6 @@
apiVersion: v2
name: background-services
appVersion: "1.0"
description: EventHub Background Services Application
version: 1.0.0
type: application

18
etc/k8s/helm-chart/eventhub/charts/background-services/templates/background-services.yaml

@ -0,0 +1,18 @@
apiVersion: batch/v1
kind: Job
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
activeDeadlineSeconds: 180
template:
spec:
containers:
- name: {{ .Release.Name }}-{{ .Chart.Name }}
image: {{ .Values.containerImage }}
imagePullPolicy: Never
env:
{{ include "eventhub.global.env" . | indent 8 }}
- name: "ConnectionStrings__Default"
value: {{ .Values.global.defaultConnString }}
restartPolicy: Never
backoffLimit: 10

0
etc/k8s/helm-chart/eventhub/charts/background-services/values.yaml

4
etc/k8s/helm-chart/eventhub/charts/dbmigrator/templates/migrator.yaml

@ -3,7 +3,7 @@ kind: Job
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
activeDeadlineSeconds: 100
activeDeadlineSeconds: 180
template:
spec:
containers:
@ -21,4 +21,4 @@ spec:
- name: "IdentityServer__Clients__EventHub_Swagger__RootUrl"
value: {{ .Values.global.apiUrl }}
restartPolicy: Never
backoffLimit: 4
backoffLimit: 10

4
etc/k8s/helm-chart/eventhub/values.yaml

@ -27,4 +27,6 @@ admin-api:
admin:
containerImage: "eventhub.admin"
dbmigrator:
containerImage: "eventhub.dbmigrator"
containerImage: "eventhub.dbmigrator"
background-services:
containerImage: "eventhub.background-services"

10
etc/k8s/scripts/build-images.ps1

@ -6,6 +6,7 @@ $apiFolder = Join-Path $slnFolder "src/EventHub.HttpApi.Host"
$adminFolder = Join-Path $slnFolder "src/EventHub.Admin.Web"
$adminApiFolder = Join-Path $slnFolder "src/EventHub.Admin.HttpApi.Host"
$identityServerFolder = Join-Path $slnFolder "src/EventHub.IdentityServer"
$backgroundServicesFolder = Join-Path $slnFolder "src/EventHub.BackgroundServices"
### DB MIGRATOR
@ -49,5 +50,14 @@ Set-Location $identityServerFolder
dotnet publish -c Release
docker build -t eventhub.account .
### BACKGROUND SERVICES
Write-Host "*** BUILDING BACKGROUND SERVICES ****************" -ForegroundColor Green
Set-Location $backgroundServicesFolder
dotnet publish -c Release
docker build -t eventhub.background-services .
### ALL COMPLETED
Write-Host "ALL COMPLETED" -ForegroundColor Green
Set-Location $currentFolder

4
src/EventHub.BackgroundServices/Dockerfile

@ -0,0 +1,4 @@
FROM mcr.microsoft.com/dotnet/aspnet:5.0
COPY bin/Release/net5.0/ app/
WORKDIR /app
ENTRYPOINT ["dotnet", "EventHub.BackgroundServices.dll"]
Loading…
Cancel
Save