Add keycloak configuration to aai-resource in order to support multi-tenency 72/112372/12
authoryoonsoonjahng <yoonsoon.jahng@yoppworks.com>
Tue, 8 Sep 2020 23:06:00 +0000 (19:06 -0400)
committerYoonsoon Jahng <yoonsoon.jahng@yoppworks.com>
Wed, 23 Sep 2020 14:36:09 +0000 (14:36 +0000)
- Change Values.yaml to add host, port of keycloak server
- add application-keycloak.properties
- Update template/deployment.yaml to include application-keycloak.properties

Issue-ID: AAI-3130
Change-Id: I2b741457a4d8c87e4b70b1f3903974170f35d571
Signed-off-by: yoonsoonjahng <yoonsoon.jahng@yoppworks.com>
components/aai-resources/resources/config/application-keycloak.properties [new file with mode: 0644]
components/aai-resources/templates/configmap.yaml
components/aai-resources/templates/deployment.yaml
components/aai-resources/values.yaml

diff --git a/components/aai-resources/resources/config/application-keycloak.properties b/components/aai-resources/resources/config/application-keycloak.properties
new file mode 100644 (file)
index 0000000..0aee217
--- /dev/null
@@ -0,0 +1,14 @@
+
+spring.autoconfigure.exclude=\
+  org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,\
+  org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
+
+
+keycloak.auth-server-url=http://{{ .Values.config.keycloak.host }}:{{ .Values.config.keycloak.port }}/auth
+keycloak.realm=aai-resources
+keycloak.resource=aai-resources-app
+keycloak.public-client=true
+keycloak.principal-attribute=preferred_username
+
+keycloak.ssl-required=external
+keycloak.bearer-only=true
\ No newline at end of file
index ccbeae3..1a1192a 100644 (file)
@@ -29,6 +29,7 @@ data:
 {{ tpl (.Files.Glob "resources/config/janusgraph-cached.properties").AsConfig . | indent 2 }}
 {{ tpl (.Files.Glob "resources/config/aaiconfig.properties").AsConfig . | indent 2 }}
 {{ tpl (.Files.Glob "resources/config/application.properties").AsConfig . | indent 2 }}
+{{ tpl (.Files.Glob "resources/config/application-keycloak.properties").AsConfig . | indent 2 }}
 {{ tpl (.Files.Glob "resources/config/realm.properties").AsConfig . | indent 2 }}
 ---
 apiVersion: v1
index 2440da6..ae328f5 100644 (file)
@@ -1288,6 +1288,9 @@ spec:
         - mountPath: /opt/app/aai-resources/resources/application.properties
           name: {{ include "common.fullname" . }}-config
           subPath: application.properties
+        - mountPath: /opt/app/aai-resources/resources/application-keycloak.properties
+          name: {{ include "common.fullname" . }}-config
+          subPath: application-keycloak.properties
           {{ $global := . }}
           {{ range $job := .Values.global.config.auth.files }}
         - mountPath: /opt/app/aai-resources/resources/etc/auth/{{ . }}
index 4e19ea4..4b77e31 100644 (file)
@@ -32,6 +32,9 @@ replicaCount: 1
 
 # Configuration for the resources deployment
 config:
+  keycloak:
+    host: localhost
+    port: 8180
 
   # Specifies crud related operation timeouts and overrides
   crud: