Browse Source

Used release name in helm templates

pull/51/head
Halil İbrahim Kalkan 5 years ago
parent
commit
d87fa068bd
  1. 10
      etc/k8s/helm-chart/eventhub/charts/account/templates/account-ingress.yaml
  2. 6
      etc/k8s/helm-chart/eventhub/charts/account/templates/account-service.yaml
  3. 2
      etc/k8s/helm-chart/eventhub/charts/account/templates/account-tls-secret.yaml
  4. 12
      etc/k8s/helm-chart/eventhub/charts/account/templates/account.yaml
  5. 3
      etc/k8s/helm-chart/eventhub/charts/account/values.yaml
  6. 6
      etc/k8s/helm-chart/eventhub/charts/api/templates/api-ingress.yaml
  7. 6
      etc/k8s/helm-chart/eventhub/charts/api/templates/api-service.yaml
  8. 20
      etc/k8s/helm-chart/eventhub/charts/api/templates/api.yaml
  9. 3
      etc/k8s/helm-chart/eventhub/charts/api/values.yaml
  10. 4
      etc/k8s/helm-chart/eventhub/charts/dbmigrator/templates/migrator.yaml
  11. 3
      etc/k8s/helm-chart/eventhub/charts/dbmigrator/values.yaml
  12. 2
      etc/k8s/helm-chart/eventhub/charts/postgresql/Chart.yaml
  13. 6
      etc/k8s/helm-chart/eventhub/charts/postgresql/templates/postgresql-service.yaml
  14. 8
      etc/k8s/helm-chart/eventhub/charts/postgresql/templates/postgresql.yaml
  15. 6
      etc/k8s/helm-chart/eventhub/charts/redis/templates/redis-service.yaml
  16. 15
      etc/k8s/helm-chart/eventhub/charts/redis/templates/redis.yaml
  17. 6
      etc/k8s/helm-chart/eventhub/charts/www/Chart.yaml
  18. 23
      etc/k8s/helm-chart/eventhub/charts/www/templates/www-ingress.yaml
  19. 14
      etc/k8s/helm-chart/eventhub/charts/www/templates/www-service.yaml
  20. 22
      etc/k8s/helm-chart/eventhub/charts/www/templates/www.yaml
  21. 3
      etc/k8s/helm-chart/eventhub/charts/www/values.yaml
  22. 3
      etc/k8s/helm-chart/eventhub/values.yaml
  23. 8
      src/EventHub.DbMigrator/appsettings.json
  24. 10
      src/EventHub.HttpApi.Host/appsettings.json
  25. 2
      src/EventHub.IdentityServer/EventHubIdentityServerModule.cs
  26. 10
      src/EventHub.IdentityServer/appsettings.json
  27. 4
      src/EventHub.Web/Dockerfile
  28. 13
      src/EventHub.Web/EventHubWebModule.cs
  29. 1
      src/EventHub.Web/Program.cs
  30. 10
      src/EventHub.Web/appsettings.json

10
etc/k8s/helm-chart/eventhub/charts/account/templates/account-ingress.yaml

@ -1,23 +1,23 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: account-ingress
name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
spec:
tls:
- hosts:
- account.openeventhub.com
secretName: account-tls
- {{ .Values.accountUrl }}
secretName: {{ .Release.Name }}-{{ .Chart.Name }}-tls
rules:
- host: "account.openeventhub.com"
- host: "{{ .Values.accountUrl }}"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: account
name: {{ .Release.Name }}-{{ .Chart.Name }}
port:
number: 80

6
etc/k8s/helm-chart/eventhub/charts/account/templates/account-service.yaml

@ -2,8 +2,8 @@ apiVersion: v1
kind: Service
metadata:
labels:
name: account
name: account
name: {{ .Release.Name }}-{{ .Chart.Name }}
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
ports:
- name: "80"
@ -11,4 +11,4 @@ spec:
- name: "443"
port: 443
selector:
app: account
app: {{ .Release.Name }}-{{ .Chart.Name }}

2
etc/k8s/helm-chart/eventhub/charts/account/templates/account-tls-secret.yaml

@ -2,7 +2,7 @@ apiVersion: v1
type: kubernetes.io/tls
kind: Secret
metadata:
name: account-tls
name: {{ .Release.Name }}-{{ .Chart.Name }}-tls
data:
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURUVENDQWpXZ0F3SUJBZ0lVZTVMQzk5RVFUcHRJQitzTHRobi9Kc1RjR1Zzd0RRWUpLb1pJaHZjTkFRRUwKQlFBd05qRWhNQjhHQTFVRUF3d1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vTHVPS3YwbTV3R2xlVE9EL3E4aGtUSThYQ3g2N1FldGpYM3ZBT2d0a3NRUUtCZ0ZFQgpXNHoraUJKTEJjZFViWjZhaFdwWkFMWGlhR2JCWTVaL2NVWjdrbzBHQ2hKZzhHellZVkJvcFd4dUk1aVdjUHIzCk0vMnoyK2RIWUI3QUFTUFRhS21DV1hHaGJtakZpNzVzMXRyWVV6WWhxMTNENWl5dS9lRHdtZVlDQ3Q2ZW9oL20KeXhZK2JJVVVtWE41WG5jSWNkRUhKd21NbFlmUGhNQjJPZUphZFJuRkFvR0FGQ3ZiMGRrcWJxblNWTFFoY09DcQo5REp5aTYvRUV5VzhmcVlXc2lrYW9aT01oUnB2b1F6VWpqVTFqaWt4VkVFdnNFRzYwYU56WVdLT0hKRFFsaXNLCkNvZUJXNWZLS2RZeE96L1R5bFRzcncycXZYVnJUTm91WFRSeDByYVdNMWJ2alFQWUpjYUV3aE5TY1dxVjR2VlIKeDhSVWd1QmlVaHhQb0NyOHg0SitGQ3M9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K

12
etc/k8s/helm-chart/eventhub/charts/account/templates/account.yaml

@ -1,22 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: account
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
selector:
matchLabels:
app: account
app: {{ .Release.Name }}-{{ .Chart.Name }}
template:
metadata:
labels:
app: account
app: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
containers:
- image: eventhub.account
imagePullPolicy: Never
name: account
name: {{ .Release.Name }}-{{ .Chart.Name }}
ports:
- name: accounthttp
- name: http
containerPort: 80
- name: accounthttps
- name: https
containerPort: 443

3
etc/k8s/helm-chart/eventhub/charts/account/values.yaml

@ -0,0 +1,3 @@
accountUrl: eh-st-account
apiUrl: eh-st-api
wwwUrl: eh-st-www

6
etc/k8s/helm-chart/eventhub/charts/api/templates/api-ingress.yaml

@ -1,18 +1,18 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: api-ingress
name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: "api.openeventhub.com"
- host: "{{ .Values.apiUrl }}"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: api
name: {{ .Release.Name }}-{{ .Chart.Name }}
port:
number: 80

6
etc/k8s/helm-chart/eventhub/charts/api/templates/api-service.yaml

@ -2,8 +2,8 @@ apiVersion: v1
kind: Service
metadata:
labels:
name: api
name: api
name: {{ .Release.Name }}-{{ .Chart.Name }}
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
ports:
- name: "80"
@ -11,4 +11,4 @@ spec:
- name: "443"
port: 443
selector:
app: api
app: {{ .Release.Name }}-{{ .Chart.Name }}

20
etc/k8s/helm-chart/eventhub/charts/api/templates/api.yaml

@ -1,28 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: api
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
selector:
matchLabels:
app: api
app: {{ .Release.Name }}-{{ .Chart.Name }}
template:
metadata:
labels:
app: api
app: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
containers:
- image: eventhub.api
imagePullPolicy: Never
name: api
name: {{ .Release.Name }}-{{ .Chart.Name }}
ports:
- name: apihttp
- name: http
containerPort: 80
- name: apihttps
containerPort: 443
hostAliases:
- ip: 10.105.172.183
hostnames:
- "account.openeventhub.com"
- "openeventhub.com"
- "api.openeventhub.com"
- name: https
containerPort: 443

3
etc/k8s/helm-chart/eventhub/charts/api/values.yaml

@ -0,0 +1,3 @@
accountUrl: eh-st-account
apiUrl: eh-st-api
wwwUrl: eh-st-www

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

@ -1,13 +1,13 @@
apiVersion: batch/v1
kind: Job
metadata:
name: migrator
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
activeDeadlineSeconds: 100
template:
spec:
containers:
- name: migrator
- name: {{ .Release.Name }}-{{ .Chart.Name }}
image: eventhubmigrator
imagePullPolicy: Never
restartPolicy: Never

3
etc/k8s/helm-chart/eventhub/charts/dbmigrator/values.yaml

@ -0,0 +1,3 @@
accountUrl: eh-st-account
apiUrl: eh-st-api
wwwUrl: eh-st-www

2
etc/k8s/helm-chart/eventhub/charts/postgresql/Chart.yaml

@ -1,5 +1,5 @@
apiVersion: v2
name: database
name: postgresql
appVersion: "1.0"
description: Runs PostgreSQL Instance
version: 1.0.0

6
etc/k8s/helm-chart/eventhub/charts/postgresql/templates/postgresql-service.yaml

@ -2,8 +2,8 @@ apiVersion: v1
kind: Service
metadata:
labels:
name: postgresql
name: postgresql
name: {{ .Release.Name }}-{{ .Chart.Name }}
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
type: LoadBalancer
ports:
@ -11,5 +11,5 @@ spec:
port: 5435
targetPort: 5432
selector:
app: postgresql
app: {{ .Release.Name }}-{{ .Chart.Name }}

8
etc/k8s/helm-chart/eventhub/charts/postgresql/templates/postgresql.yaml

@ -1,20 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgresql
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
replicas: 1
selector:
matchLabels:
app: postgresql
app: {{ .Release.Name }}-{{ .Chart.Name }}
template:
metadata:
labels:
app: postgresql
app: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
containers:
- image: postgres
name: postgresql
name: {{ .Release.Name }}-{{ .Chart.Name }}
ports:
- name: postgresql
containerPort: 5432

6
etc/k8s/helm-chart/eventhub/charts/redis/templates/redis-service.yaml

@ -2,8 +2,8 @@ apiVersion: v1
kind: Service
metadata:
labels:
name: redis
name: redis
name: {{ .Release.Name }}-{{ .Chart.Name }}
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
type: ClusterIP
ports:
@ -11,5 +11,5 @@ spec:
port: 6379
targetPort: 6379
selector:
app: redis
app: {{ .Release.Name }}-{{ .Chart.Name }}

15
etc/k8s/helm-chart/eventhub/charts/redis/templates/redis.yaml

@ -1,25 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
replicas: 1
selector:
matchLabels:
app: redis
app: {{ .Release.Name }}-{{ .Chart.Name }}
template:
metadata:
labels:
app: redis
app: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
containers:
- image: redis:6.0.10-alpine
name: redis
name: {{ .Release.Name }}-{{ .Chart.Name }}
ports:
- name: redis
containerPort: 6379
env:
- name: POSTGRES_USER
value: "root"
- name: POSTGRES_PASSWORD
value: "root"
containerPort: 6379

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

@ -0,0 +1,6 @@
apiVersion: v2
name: www
appVersion: "1.0"
description: EventHub WWW Application
version: 1.0.0
type: application

23
etc/k8s/helm-chart/eventhub/charts/www/templates/www-ingress.yaml

@ -0,0 +1,23 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
spec:
tls:
- hosts:
- {{ .Values.wwwUrl }}
secretName: {{ .Release.Name }}-{{ .Chart.Name }}-tls
rules:
- host: "{{ .Values.wwwUrl }}"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-{{ .Chart.Name }}
port:
number: 80

14
etc/k8s/helm-chart/eventhub/charts/www/templates/www-service.yaml

@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
labels:
name: {{ .Release.Name }}-{{ .Chart.Name }}
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
ports:
- name: "80"
port: 80
- name: "443"
port: 443
selector:
app: {{ .Release.Name }}-{{ .Chart.Name }}

22
etc/k8s/helm-chart/eventhub/charts/www/templates/www.yaml

@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
selector:
matchLabels:
app: {{ .Release.Name }}-{{ .Chart.Name }}
template:
metadata:
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}
spec:
containers:
- image: eventhub.www
imagePullPolicy: Never
name: {{ .Release.Name }}-{{ .Chart.Name }}
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443

3
etc/k8s/helm-chart/eventhub/charts/www/values.yaml

@ -0,0 +1,3 @@
accountUrl: eh-st-account
apiUrl: eh-st-api
wwwUrl: eh-st-www

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

@ -0,0 +1,3 @@
accountUrl: eh-st-account
apiUrl: eh-st-api
wwwUrl: eh-st-www

8
src/EventHub.DbMigrator/appsettings.json

@ -1,22 +1,22 @@
{
"ConnectionStrings": {
"Default": "Host=postgresql;Port=5435;Database=EventHub;Username=root;Password=root"
"Default": "Host=eh-st-postgresql;Port=5435;Database=EventHub;Username=root;Password=root"
},
"IdentityServer": {
"Clients": {
"EventHub_Web": {
"ClientId": "EventHub_Web",
"ClientSecret": "1q2w3e*",
"RootUrl": "https://openeventhub.com"
"RootUrl": "https://eh-st-www"
},
"EventHub_Blazor": {
"ClientId": "EventHub_Blazor",
"RootUrl": "https://admin.openeventhub.com"
"RootUrl": "https://eh-st-admin"
},
"EventHub_Swagger": {
"ClientId": "EventHub_Swagger",
"ClientSecret": "1q2w3e*",
"RootUrl": "https://api.openeventhub.com"
"RootUrl": "https://eh-st-api"
}
}
}

10
src/EventHub.HttpApi.Host/appsettings.json

@ -1,16 +1,16 @@
{
"App": {
"CorsOrigins": "https://*.openeventhub.com,https://localhost:44307,https://localhost:44308"
"CorsOrigins": "https://eh-st-www,eh-st-admin"
},
"ConnectionStrings": {
"Default": "Host=postgresql;Port=5435;Database=EventHub;Username=root;Password=root"
"Default": "Host=eh-st-postgresql;Port=5435;Database=EventHub;Username=root;Password=root"
},
"Redis": {
"Configuration": "redis"
"Configuration": "eh-st-redis"
},
"AuthServer": {
"Authority": "https://account.openeventhub.com",
"RequireHttpsMetadata": "true",
"Authority": "http://eh-st-account",
"RequireHttpsMetadata": "false",
"SwaggerClientId": "EventHub_Swagger",
"SwaggerClientSecret": "1q2w3e*"
},

2
src/EventHub.IdentityServer/EventHubIdentityServerModule.cs

@ -187,11 +187,13 @@ namespace EventHub
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
/*
app.Use((context, next) =>
{
context.Request.Scheme = "https";
return next();
});
*/
if (env.IsDevelopment())
{

10
src/EventHub.IdentityServer/appsettings.json

@ -1,14 +1,14 @@
{
"App": {
"SelfUrl": "https://account.openeventhub.com",
"CorsOrigins": "https://*.openeventhub.com,http://localhost:4200,https://localhost:44307,https://localhost:44362",
"RedirectAllowedUrls": "https://openeventhub.com,https://admin.openeventhub.com"
"SelfUrl": "https://eh-st-account",
"CorsOrigins": "https://eh-st-www,https://eh-st-api,https://localhost:44307,https://localhost:44362",
"RedirectAllowedUrls": "https://eh-st-api,https://eh-st-www,http://eh-st-api,http://eh-st-www"
},
"ConnectionStrings": {
"Default": "Host=postgresql;Port=5435;Database=EventHub;Username=root;Password=root"
"Default": "Host=eh-st-postgresql;Port=5435;Database=EventHub;Username=root;Password=root"
},
"Redis": {
"Configuration": "redis"
"Configuration": "eh-st-redis"
},
"StringEncryption": {
"DefaultPassPhrase": "TxVIZFPxK33czbbv"

4
src/EventHub.Web/Dockerfile

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

13
src/EventHub.Web/EventHubWebModule.cs

@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Hosting;
@ -150,6 +151,12 @@ namespace EventHub.Web
options.Scope.Add("email");
options.Scope.Add("phone");
options.Scope.Add("EventHub");
options.Events.OnRedirectToIdentityProvider = redirectContext =>
{
redirectContext.ProtocolMessage.RedirectUri = $"{configuration["App:SelfUrl"]}/signin-oidc";
return Task.CompletedTask;
};
});
}
@ -214,6 +221,12 @@ namespace EventHub.Web
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
app.Use((context, next) =>
{
context.Request.Scheme = "https";
return next();
});
if (env.IsDevelopment())
{

1
src/EventHub.Web/Program.cs

@ -45,6 +45,7 @@ namespace EventHub.Web
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
//webBuilder.UseUrls("http://localhost:80", "https://localhost:443");
})
.UseAutofac()
.UseSerilog();

10
src/EventHub.Web/appsettings.json

@ -1,18 +1,18 @@
{
"App": {
"SelfUrl": "https://localhost:44308"
"SelfUrl": "https://eh-st-www"
},
"RemoteServices": {
"Default": {
"BaseUrl": "https://localhost:44362/"
"BaseUrl": "http://eh-st-api/"
}
},
"Redis": {
"Configuration": "127.0.0.1"
"Configuration": "eh-st-redis"
},
"AuthServer": {
"Authority": "https://localhost:44313",
"RequireHttpsMetadata": "true",
"Authority": "http://eh-st-account",
"RequireHttpsMetadata": "false",
"ClientId": "EventHub_Web",
"ClientSecret": "1q2w3e*"
},

Loading…
Cancel
Save