Browse Source

Added azure configuration

pull/51/head
Halil İbrahim Kalkan 5 years ago
parent
commit
baf96e7f41
  1. 2
      etc/k8s/helm-chart/eventhub/charts/account/templates/account.yaml
  2. 2
      etc/k8s/helm-chart/eventhub/charts/admin-api/templates/admin-api.yaml
  3. 2
      etc/k8s/helm-chart/eventhub/charts/admin/templates/admin.yaml
  4. 2
      etc/k8s/helm-chart/eventhub/charts/api/templates/api.yaml
  5. 2
      etc/k8s/helm-chart/eventhub/charts/background-services/templates/background-services.yaml
  6. 2
      etc/k8s/helm-chart/eventhub/charts/dbmigrator/templates/migrator.yaml
  7. 2
      etc/k8s/helm-chart/eventhub/charts/www/templates/www.yaml
  8. 2
      etc/k8s/helm-chart/eventhub/templates/_helpers.tpl
  9. 34
      etc/k8s/helm-chart/eventhub/values.azure.yaml
  10. 2
      etc/k8s/helm-chart/eventhub/values.yaml
  11. 41
      etc/k8s/scripts/azure-install-nginx-ingress.ps1
  12. 6
      src/EventHub.Domain.Shared/Web/EventHubUrlOptions.cs
  13. 3
      src/EventHub.Web/EventHubWebModule.cs

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

@ -13,7 +13,7 @@ spec:
spec: spec:
containers: containers:
- image: {{ .Values.containerImage }} - image: {{ .Values.containerImage }}
imagePullPolicy: Never imagePullPolicy: {{ .Values.global.imagePullPolicy }}
name: {{ .Release.Name }}-{{ .Chart.Name }} name: {{ .Release.Name }}-{{ .Chart.Name }}
ports: ports:
- name: http - name: http

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

@ -13,7 +13,7 @@ spec:
spec: spec:
containers: containers:
- image: {{ .Values.containerImage }} - image: {{ .Values.containerImage }}
imagePullPolicy: Never imagePullPolicy: {{ .Values.global.imagePullPolicy }}
name: {{ .Release.Name }}-{{ .Chart.Name }} name: {{ .Release.Name }}-{{ .Chart.Name }}
ports: ports:
- name: http - name: http

2
etc/k8s/helm-chart/eventhub/charts/admin/templates/admin.yaml

@ -13,7 +13,7 @@ spec:
spec: spec:
containers: containers:
- image: {{ .Values.containerImage }} - image: {{ .Values.containerImage }}
imagePullPolicy: Never imagePullPolicy: {{ .Values.global.imagePullPolicy }}
name: {{ .Release.Name }}-{{ .Chart.Name }} name: {{ .Release.Name }}-{{ .Chart.Name }}
ports: ports:
- name: http - name: http

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

@ -13,7 +13,7 @@ spec:
spec: spec:
containers: containers:
- image: {{ .Values.containerImage }} - image: {{ .Values.containerImage }}
imagePullPolicy: Never imagePullPolicy: {{ .Values.global.imagePullPolicy }}
name: {{ .Release.Name }}-{{ .Chart.Name }} name: {{ .Release.Name }}-{{ .Chart.Name }}
ports: ports:
- name: http - name: http

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

@ -9,7 +9,7 @@ spec:
containers: containers:
- name: {{ .Release.Name }}-{{ .Chart.Name }} - name: {{ .Release.Name }}-{{ .Chart.Name }}
image: {{ .Values.containerImage }} image: {{ .Values.containerImage }}
imagePullPolicy: Never imagePullPolicy: {{ .Values.global.imagePullPolicy }}
env: env:
{{ include "eventhub.global.env" . | indent 8 }} {{ include "eventhub.global.env" . | indent 8 }}
- name: "ConnectionStrings__Default" - name: "ConnectionStrings__Default"

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

@ -9,7 +9,7 @@ spec:
containers: containers:
- name: {{ .Release.Name }}-{{ .Chart.Name }} - name: {{ .Release.Name }}-{{ .Chart.Name }}
image: {{ .Values.containerImage }} image: {{ .Values.containerImage }}
imagePullPolicy: Never imagePullPolicy: {{ .Values.global.imagePullPolicy }}
env: env:
{{ include "eventhub.global.env" . | indent 8 }} {{ include "eventhub.global.env" . | indent 8 }}
- name: "ConnectionStrings__Default" - name: "ConnectionStrings__Default"

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

@ -13,7 +13,7 @@ spec:
spec: spec:
containers: containers:
- image: {{ .Values.containerImage }} - image: {{ .Values.containerImage }}
imagePullPolicy: Never imagePullPolicy: {{ .Values.global.imagePullPolicy }}
name: {{ .Release.Name }}-{{ .Chart.Name }} name: {{ .Release.Name }}-{{ .Chart.Name }}
ports: ports:
- name: http - name: http

2
etc/k8s/helm-chart/eventhub/templates/_helpers.tpl

@ -5,6 +5,8 @@
value: "{{ .Values.global.wwwUrl }}" value: "{{ .Values.global.wwwUrl }}"
- name: "AppUrls__Api" - name: "AppUrls__Api"
value: "{{ .Values.global.apiUrl }}" value: "{{ .Values.global.apiUrl }}"
- name: "AppUrls__ApiInternal"
value: "{{ .Values.global.apiUrlInternal }}"
- name: "AppUrls__Admin" - name: "AppUrls__Admin"
value: "{{ .Values.global.adminUrl }}" value: "{{ .Values.global.adminUrl }}"
- name: "AppUrls__AdminApi" - name: "AppUrls__AdminApi"

34
etc/k8s/helm-chart/eventhub/values.azure.yaml

@ -0,0 +1,34 @@
global:
accountDomain: account.openeventhub.com
accountUrl: https://account.openeventhub.com
apiDomain: api.openeventhub.com
apiUrl: https://api.openeventhub.com
apiUrlInternal: http://eh-az-api
wwwDomain: openeventhub.com
wwwUrl: "https://openeventhub.com"
adminDomain: admin.openeventhub.com
adminUrl: https://admin.openeventhub.com
adminApiDomain: admin-api.openeventhub.com
adminApiUrl: https://admin-api.openeventhub.com
nginxProxyBufferSize: "32k"
nginxProxyBuffersNumber: "8"
defaultConnString: "Host=eh-az-postgresql;Port=5432;Database=EventHub;Username=root;Password=root"
redisConfiguration: "eh-az-redis"
internalAuthServerAuthority: "http://eh-az-account"
internalAuthServerRequireHttpsMetadata: "false"
stringEncryptionDefaultPassPhrase: "TxVIZFPxK33czbbv"
imagePullPolicy: Always
account:
containerImage: "volocr.azurecr.io/eventhub.account"
api:
containerImage: "volocr.azurecr.io/eventhub.api"
www:
containerImage: "volocr.azurecr.io/eventhub.www"
admin-api:
containerImage: "volocr.azurecr.io/eventhub.admin-api"
admin:
containerImage: "volocr.azurecr.io/eventhub.admin"
dbmigrator:
containerImage: "volocr.azurecr.io/eventhub.dbmigrator"
background-services:
containerImage: "volocr.azurecr.io/eventhub.background-services"

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

@ -3,6 +3,7 @@ global:
accountUrl: https://eh-st-account accountUrl: https://eh-st-account
apiDomain: eh-st-api apiDomain: eh-st-api
apiUrl: https://eh-st-api apiUrl: https://eh-st-api
apiUrlInternal: http://api.openeventhub.com
wwwDomain: eh-st-www wwwDomain: eh-st-www
wwwUrl: "https://eh-st-www" wwwUrl: "https://eh-st-www"
adminDomain: eh-st-admin adminDomain: eh-st-admin
@ -16,6 +17,7 @@ global:
internalAuthServerAuthority: "http://eh-st-account" internalAuthServerAuthority: "http://eh-st-account"
internalAuthServerRequireHttpsMetadata: "false" internalAuthServerRequireHttpsMetadata: "false"
stringEncryptionDefaultPassPhrase: "TxVIZFPxK33czbbv" stringEncryptionDefaultPassPhrase: "TxVIZFPxK33czbbv"
imagePullPolicy: Never
account: account:
containerImage: "eventhub.account" containerImage: "eventhub.account"
api: api:

41
etc/k8s/scripts/azure-install-nginx-ingress.ps1

@ -0,0 +1,41 @@
$REGISTRY_NAME="volocr.azurecr.io"
$CONTROLLER_REGISTRY="k8s.gcr.io"
$CONTROLLER_IMAGE="ingress-nginx/controller"
$CONTROLLER_TAG="v0.48.1"
$PATCH_REGISTRY="docker.io"
$PATCH_IMAGE="jettech/kube-webhook-certgen"
$PATCH_TAG="v1.5.1"
$DEFAULTBACKEND_REGISTRY="k8s.gcr.io"
$DEFAULTBACKEND_IMAGE="defaultbackend-amd64"
$DEFAULTBACKEND_TAG="1.5"
az acr import --name $REGISTRY_NAME --source ${CONTROLLER_REGISTRY}/${CONTROLLER_IMAGE}:${CONTROLLER_TAG} --image ${CONTROLLER_IMAGE}:${CONTROLLER_TAG}
az acr import --name $REGISTRY_NAME --source ${PATCH_REGISTRY}/${PATCH_IMAGE}:${PATCH_TAG} --image ${PATCH_IMAGE}:${PATCH_TAG}
az acr import --name $REGISTRY_NAME --source ${DEFAULTBACKEND_REGISTRY}/${DEFAULTBACKEND_IMAGE}:${DEFAULTBACKEND_TAG} --image ${DEFAULTBACKEND_IMAGE}:${DEFAULTBACKEND_TAG}
# Create a namespace for your ingress resources
kubectl create namespace ingress-basic
# Add the ingress-nginx repository
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
# Set variable for ACR location to use for pulling images
$ACR_URL="volocr.azurecr.io"
# Use Helm to deploy an NGINX ingress controller
helm install nginx-ingress ingress-nginx/ingress-nginx `
--namespace ingress-basic `
--set controller.replicaCount=1 `
--set controller.nodeSelector."kubernetes\.io/os"=linux `
--set controller.image.registry=$ACR_URL `
--set controller.image.image=$CONTROLLER_IMAGE `
--set controller.image.tag=$CONTROLLER_TAG `
--set controller.image.digest="" `
--set controller.admissionWebhooks.patch.nodeSelector."kubernetes\.io/os"=linux `
--set controller.admissionWebhooks.patch.image.registry=$ACR_URL `
--set controller.admissionWebhooks.patch.image.image=$PATCH_IMAGE `
--set controller.admissionWebhooks.patch.image.tag=$PATCH_TAG `
--set defaultBackend.nodeSelector."kubernetes\.io/os"=linux `
--set defaultBackend.image.registry=$ACR_URL `
--set defaultBackend.image.image=$DEFAULTBACKEND_IMAGE `
--set defaultBackend.image.tag=$DEFAULTBACKEND_TAG

6
src/EventHub.Domain.Shared/Web/EventHubUrlOptions.cs

@ -7,6 +7,7 @@
public string Account { get; set; } = "https://localhost:44313"; public string Account { get; set; } = "https://localhost:44313";
public string Www { get; set; } = "https://localhost:44308"; public string Www { get; set; } = "https://localhost:44308";
public string Api { get; set; } = "https://localhost:44362"; public string Api { get; set; } = "https://localhost:44362";
public string ApiInternal { get; set; } = "https://localhost:44362";
public string Admin { get; set; } = "https://localhost:44307"; public string Admin { get; set; } = "https://localhost:44307";
public string AdminApi { get; set; } = "https://localhost:44305"; public string AdminApi { get; set; } = "https://localhost:44305";
@ -20,6 +21,11 @@
return GetConfigKey(nameof(Www)); return GetConfigKey(nameof(Www));
} }
public static string GetApiInternalConfigKey()
{
return GetConfigKey(nameof(ApiInternal));
}
public static string GetApiConfigKey() public static string GetApiConfigKey()
{ {
return GetConfigKey(nameof(Api)); return GetConfigKey(nameof(Api));

3
src/EventHub.Web/EventHubWebModule.cs

@ -118,8 +118,7 @@ namespace EventHub.Web
Configure<AbpRemoteServiceOptions>(options => Configure<AbpRemoteServiceOptions>(options =>
{ {
options.RemoteServices.Default = new RemoteServiceConfiguration( options.RemoteServices.Default = new RemoteServiceConfiguration(
configuration[EventHubUrlOptions.GetApiConfigKey()] configuration[EventHubUrlOptions.GetApiInternalConfigKey()]
.Replace("https", "http")
.EnsureEndsWith('/') .EnsureEndsWith('/')
); );
}); });

Loading…
Cancel
Save