diff --git a/etc/k8s/helm-chart/eventhub/charts/background-services/Chart.yaml b/etc/k8s/helm-chart/eventhub/charts/background-services/Chart.yaml new file mode 100644 index 0000000..ce84bfe --- /dev/null +++ b/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 \ No newline at end of file diff --git a/etc/k8s/helm-chart/eventhub/charts/background-services/templates/background-services.yaml b/etc/k8s/helm-chart/eventhub/charts/background-services/templates/background-services.yaml new file mode 100644 index 0000000..2b4d013 --- /dev/null +++ b/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 \ No newline at end of file diff --git a/etc/k8s/helm-chart/eventhub/charts/background-services/values.yaml b/etc/k8s/helm-chart/eventhub/charts/background-services/values.yaml new file mode 100644 index 0000000..e69de29 diff --git a/etc/k8s/helm-chart/eventhub/charts/dbmigrator/templates/migrator.yaml b/etc/k8s/helm-chart/eventhub/charts/dbmigrator/templates/migrator.yaml index 199cbc4..75c2727 100644 --- a/etc/k8s/helm-chart/eventhub/charts/dbmigrator/templates/migrator.yaml +++ b/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 \ No newline at end of file + backoffLimit: 10 \ No newline at end of file diff --git a/etc/k8s/helm-chart/eventhub/values.yaml b/etc/k8s/helm-chart/eventhub/values.yaml index b55052e..cd11cd5 100644 --- a/etc/k8s/helm-chart/eventhub/values.yaml +++ b/etc/k8s/helm-chart/eventhub/values.yaml @@ -27,4 +27,6 @@ admin-api: admin: containerImage: "eventhub.admin" dbmigrator: - containerImage: "eventhub.dbmigrator" \ No newline at end of file + containerImage: "eventhub.dbmigrator" +background-services: + containerImage: "eventhub.background-services" \ No newline at end of file diff --git a/etc/k8s/scripts/build-images.ps1 b/etc/k8s/scripts/build-images.ps1 index 3690b30..e86165b 100644 --- a/etc/k8s/scripts/build-images.ps1 +++ b/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 \ No newline at end of file diff --git a/src/EventHub.BackgroundServices/Dockerfile b/src/EventHub.BackgroundServices/Dockerfile new file mode 100644 index 0000000..9cf1f9e --- /dev/null +++ b/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"] \ No newline at end of file