From 4362f40abddb0f83b0452fd77992d945ba39fac9 Mon Sep 17 00:00:00 2001 From: "Mike Ray (SQL)" Date: Fri, 5 Oct 2018 10:31:11 -0700 Subject: [PATCH 1/4] add failover manifest --- .../sample-manifest-files/failover.yaml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 samples/features/high availability/Kubernetes/sample-manifest-files/failover.yaml diff --git a/samples/features/high availability/Kubernetes/sample-manifest-files/failover.yaml b/samples/features/high availability/Kubernetes/sample-manifest-files/failover.yaml new file mode 100644 index 00000000..fccf8309 --- /dev/null +++ b/samples/features/high availability/Kubernetes/sample-manifest-files/failover.yaml @@ -0,0 +1,46 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: {name: manual-failover, namespace: ag1} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: {name: manual-failover, namespace: ag1} +rules: +- apiGroups: [''] + resourceNames: [ag1] + resources: [configmaps] + verbs: [get, update] +- apiGroups: [''] + resourceNames: [ag1] + resources: [endpoints] + verbs: [get] +- apiGroups: [''] + resources: [pods] + verbs: [list] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: {name: manual-failover, namespace: ag1} +roleRef: {apiGroup: rbac.authorization.k8s.io, kind: Role, name: manual-failover} +subjects: +- {kind: ServiceAccount, name: manual-failover} +--- +apiVersion: batch/v1 +kind: Job +metadata: {name: manual-failover, namespace: ag1} +spec: + template: + metadata: {name: manual-failover} + spec: + containers: + - command: [/mssql-server-k8s-failover] + env: + - {name: MSSQL_K8S_AG_NAME, value: ag1} + - {name: MSSQL_K8S_NEW_PRIMARY, value: } + - name: MSSQL_K8S_NAMESPACE + valueFrom: + fieldRef: {fieldPath: metadata.namespace} + image: mcr.microsoft.com/mssql/ha:vNext-CTP2.0-ubuntu + name: manual-failover + restartPolicy: Never + serviceAccount: manual-failover From bde824c3862d0225f4b5e85776f2bfbd7e10f3d4 Mon Sep 17 00:00:00 2001 From: Meet Bhagdev Date: Fri, 5 Oct 2018 21:32:20 +0200 Subject: [PATCH 2/4] Update requirements.txt --- .../SqlServerOnDocker/docker/web/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/development-frameworks/SqlServerOnDocker/docker/web/requirements.txt b/samples/development-frameworks/SqlServerOnDocker/docker/web/requirements.txt index ebeadbb7..c486ae5d 100644 --- a/samples/development-frameworks/SqlServerOnDocker/docker/web/requirements.txt +++ b/samples/development-frameworks/SqlServerOnDocker/docker/web/requirements.txt @@ -1,2 +1,2 @@ -Django==1.11.5 +django ~> 1.11.15 django-pyodbc-azure==1.11.0.0 From 3ee13a752bbdd4712868c8b73bcdc4767b9856ac Mon Sep 17 00:00:00 2001 From: Meet Bhagdev Date: Fri, 5 Oct 2018 21:32:55 +0200 Subject: [PATCH 3/4] Update requirements.txt --- samples/development-frameworks/django/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/development-frameworks/django/requirements.txt b/samples/development-frameworks/django/requirements.txt index 1b15913e..0bb0eeda 100644 --- a/samples/development-frameworks/django/requirements.txt +++ b/samples/development-frameworks/django/requirements.txt @@ -1,4 +1,4 @@ -Django==1.9.8 +django ~> 1.11.15 dj-database-url==0.3.0 dj-static==0.0.6 gunicorn==19.6.0 From c947a272038437ca9ffd20bd0c31ad208c72fcfd Mon Sep 17 00:00:00 2001 From: Jovan Popovic Date: Fri, 5 Oct 2018 22:01:33 +0200 Subject: [PATCH 4/4] Fixed RLS predicate in dublocated code Added access to WebApi in the duplicated RLS predicate --- .../Stored Procedures/Configuration_ApplyRowLevelSecurity.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/Application/Stored Procedures/Configuration_ApplyRowLevelSecurity.sql b/samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/Application/Stored Procedures/Configuration_ApplyRowLevelSecurity.sql index b3204af0..da7def4b 100644 --- a/samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/Application/Stored Procedures/Configuration_ApplyRowLevelSecurity.sql +++ b/samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/Application/Stored Procedures/Configuration_ApplyRowLevelSecurity.sql @@ -28,7 +28,7 @@ RETURN (SELECT 1 AS AccessResult INNER JOIN [Application].StateProvinces AS sp ON c.StateProvinceID = sp.StateProvinceID WHERE c.CityID = @CityID) + N'' Sales'') <> 0 - OR (ORIGINAL_LOGIN() = N''Website'' + OR (ORIGINAL_LOGIN() = N''Website'' OR ORIGINAL_LOGIN() = N''WebApi'' AND EXISTS (SELECT 1 FROM [Application].Cities AS c INNER JOIN [Application].StateProvinces AS sp