Browse Source

update for ingress ssl

dev
yusuf karatoprak 6 years ago
parent
commit
44bb377fcf
  1. 21
      Dockerfile.EventHub.Admin
  2. 2
      Dockerfile.EventHub.HttpApi.Host
  3. 4
      Dockerfile.EventHub.IdentityServer
  4. 2
      Dockerfile.EventHub.Web
  5. 67
      azure-pipelines.eventhub.admin.yml
  6. 23
      manifests/deployment.eventhub.admin.yml
  7. 2
      manifests/deployment.eventhub.identityserver.yml
  8. 2
      manifests/deployment.eventhub.web.yml
  9. 25
      manifests/eventhub.admin.ingress.yaml
  10. 4
      manifests/eventhub.httpapi.host.ingress.yaml
  11. 4
      manifests/eventhub.identityserver.ingress.yaml
  12. 4
      manifests/eventhub.web.ingress.yaml
  13. 11
      manifests/service.eventhub.admin.yml
  14. 6
      src/EventHub.Admin.Web/Properties/launchSettings.json
  15. 8
      src/EventHub.Admin.Web/wwwroot/appsettings.json
  16. 4
      src/EventHub.Web/Properties/launchSettings.json
  17. 6
      src/EventHub.Web/appsettings.json

21
Dockerfile.EventHub.Admin

@ -0,0 +1,21 @@
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["src/EventHub.Admin.Web/EventHub.Admin.Web.csproj", "src/EventHub.Admin.Web/"]
RUN dotnet restore "src/EventHub.Admin.Web/EventHub.Admin.Web.csproj"
COPY . .
WORKDIR "/src/src/EventHub.Admin.Web"
RUN dotnet build "EventHub.Admin.Web.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "EventHub.Admin.Web.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "EventHub.Admin.Web.dll"]

2
Dockerfile.EventHub.HttpApi.Host

@ -10,8 +10,6 @@ RUN dotnet restore "src/EventHub.HttpApi.Host/EventHub.HttpApi.Host.csproj"
COPY . .
WORKDIR "/src/src/EventHub.HttpApi.Host"
RUN dotnet dev-certs https -v -ep localhost.pfx -p e8202f07-66e5-4619-be07-72ba76fde97f
RUN dotnet build "EventHub.HttpApi.Host.csproj" -c Release -o /app
FROM build AS publish

4
Dockerfile.EventHub.IdentityServer

@ -10,10 +10,6 @@ RUN dotnet restore "src/EventHub.IdentityServer/EventHub.IdentityServer.csproj"
COPY . .
WORKDIR "/src/src/EventHub.IdentityServer"
RUN dotnet dev-certs https -ep aspnetapp.pfx -p mypassword123
RUN dotnet dev-certs https --trust
RUN dotnet dev-certs https -ep $env:USERPROFILE\.aspnet\https\aspnetapp.pfx -p mypassword123
RUN dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\aspnetapp.pfx -p mypassword123
RUN dotnet build "EventHub.IdentityServer.csproj" -c Release -o /app

2
Dockerfile.EventHub.Web

@ -10,8 +10,6 @@ RUN dotnet restore "src/EventHub.Web/EventHub.Web.csproj"
COPY . .
WORKDIR "/src/src/EventHub.Web"
RUN dotnet dev-certs https -v -ep localhost.pfx -p e8202f07-66e5-4619-be07-72ba76fde97f
RUN dotnet build "EventHub.Web.csproj" -c Release -o /app
FROM build AS publish

67
azure-pipelines.eventhub.admin.yml

@ -0,0 +1,67 @@
trigger:
- dev
variables:
# Container registry service connection established during pipeline creation
dockerRegistryServiceConnection: '855289e7-1034-4e42-90b4-38c072ecefcb'
imageRepository: 'voloeventhub'
containerRegistry: 'voloeventhub.azurecr.io'
dockerfilePath: '**/Dockerfile.EventHub.Web'
tag: '$(Build.BuildNumber)'
# Agent VM image name
vmImageName: 'ubuntu-latest'
stages:
- stage: Build
displayName: Build stage
jobs:
- job: Build
displayName: Build
pool:
vmImage: $(vmImageName)
steps:
- task: Docker@2
displayName: Build and push an image to container registry
inputs:
command: buildAndPush
repository: $(imageRepository)
dockerfile: $(dockerfilePath)
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tag)
- upload: manifests
artifact: manifests
- stage: Deploy
displayName: Deploy stage
dependsOn: Build
jobs:
- deployment: Deploy
displayName: Deploy-EventHub-Web
pool:
vmImage: $(vmImageName)
environment: 'volosofteventhub-3839.default'
strategy:
runOnce:
deploy:
steps:
- task: KubernetesManifest@0
displayName: Deploy to Kubernetes cluster
inputs:
action: deploy
manifests: |
$(Pipeline.Workspace)/manifests/deployment.eventhub.web.yml
$(Pipeline.Workspace)/manifests/service.eventhub.web.yml
containers: |
$(containerRegistry)/$(imageRepository):$(tag)

23
manifests/deployment.eventhub.admin.yml

@ -0,0 +1,23 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: admin
spec:
selector:
matchLabels:
app: admin
template:
metadata:
labels:
app: admin
spec:
containers:
- name: admin
image: eventhubregistry.azurecr.io/eventhubadmin:v2
imagePullPolicy: Always
resources:
requests:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 80

2
manifests/deployment.eventhub.identityserver.yml

@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: identityserver
image: eventhubregistry.azurecr.io/eventhubidentityserver:v1
image: eventhubregistry.azurecr.io/eventhubidentityserver:v2
imagePullPolicy: Always
resources:
requests:

2
manifests/deployment.eventhub.web.yml

@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: web
image: eventhubregistry.azurecr.io/eventhubweb:v4
image: eventhubregistry.azurecr.io/eventhubweb:v5
imagePullPolicy: Always
resources:
requests:

25
manifests/eventhub.admin.ingress.yaml

@ -0,0 +1,25 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: admin
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "true"
cert-manager.io/issuer: letsencrypt-prod
spec:
tls:
- hosts:
- admin.openeventhub.com
secretName: admin-tls
rules:
- host: admin.openeventhub.com
http:
paths:
- backend:
service:
name: admin
port:
number: 80
path: /
pathType: Prefix

4
manifests/eventhub.httpapi.host.ingress.yaml

@ -9,10 +9,10 @@ metadata:
spec:
tls:
- hosts:
- api.eventhub.gokhansengun.com
- api.openeventhub.com
secretName: httpapi-host-tls
rules:
- host: api.eventhub.gokhansengun.com
- host: api.openeventhub.com
http:
paths:
- backend:

4
manifests/eventhub.identityserver.ingress.yaml

@ -9,10 +9,10 @@ metadata:
spec:
tls:
- hosts:
- identityserver.eventhub.gokhansengun.com
- identityserver.openeventhub.com
secretName: identityserver-tls
rules:
- host: identityserver.eventhub.gokhansengun.com
- host: identityserver.openeventhub.com
http:
paths:
- backend:

4
manifests/eventhub.ingress.yaml → manifests/eventhub.web.ingress.yaml

@ -9,10 +9,10 @@ metadata:
spec:
tls:
- hosts:
- api.eventhub.gokhansengun.com
- web.openeventhub.com
secretName: web-tls
rules:
- host: web.eventhub.gokhansengun.com
- host: web.openeventhub.com
http:
paths:
- backend:

11
manifests/service.eventhub.admin.yml

@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: admin
spec:
selector:
app: admin
ports:
- port: 80
targetPort: 80
type: ClusterIP

6
src/EventHub.Admin.Web/Properties/launchSettings.json

@ -3,8 +3,8 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "https://localhost:44307",
"sslPort": 44307
"applicationUrl": "https://admin.openeventhub.com/",
"sslPort": 80
}
},
"profiles": {
@ -20,7 +20,7 @@
"commandName": "Project",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:44307",
"applicationUrl": "https://admin.openeventhub.com/",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}

8
src/EventHub.Admin.Web/wwwroot/appsettings.json

@ -1,20 +1,20 @@
{
"App": {
"SelfUrl": "https://localhost:44307"
"SelfUrl": "https://admin.openeventhub.com/"
},
"AuthServer": {
"Authority": "https://localhost:44313",
"Authority": "https://identityserver.openeventhub.com",
"ClientId": "EventHub_Blazor",
"ResponseType": "code"
},
"RemoteServices": {
"Default": {
"BaseUrl": "https://localhost:44362"
"BaseUrl": "https://api.openeventhub.com"
}
},
"AbpCli": {
"Bundle": {
"Mode": "BundleAndMinify", /* Options: None, Bundle, BundleAndMinify */
"Mode": "BundleAndMinify",
"Name": "global",
"Parameters": {

4
src/EventHub.Web/Properties/launchSettings.json

@ -3,7 +3,7 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "https://web.eventhub.gokhansengun.com/",
"applicationUrl": "https://web.openeventhub.com/",
"sslPort": 80
}
},
@ -18,7 +18,7 @@
"EventHub.Web": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "https://web.eventhub.gokhansengun.com/",
"applicationUrl": "https://web.openeventhub.com/",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}

6
src/EventHub.Web/appsettings.json

@ -1,17 +1,17 @@
{
"App": {
"SelfUrl": "https://web.eventhub.gokhansengun.com/"
"SelfUrl": "https://web.openeventhub.com/"
},
"RemoteServices": {
"Default": {
"BaseUrl": "https://api.eventhub.gokhansengun.com"
"BaseUrl": "https://api.openeventhub.com"
}
},
"Redis": {
"Configuration": "volosofteventhub.redis.cache.windows.net:6380,password=9Kc6E1lbwy5c+RHR1KZS26JPydYR5SeR8UixdECQWv4=,ssl=True,abortConnect=False"
},
"AuthServer": {
"Authority": "https://identityserver.eventhub.gokhansengun.com",
"Authority": "https://identityserver.openeventhub.com",
"RequireHttpsMetadata": "true",
"ClientId": "EventHub_Web",
"ClientSecret": "1q2w3e*"

Loading…
Cancel
Save