@@ -58,12 +58,12 @@ In this example, we setup rules that only users with JWT token issued by "testin
58
58
``` sh
59
59
# make sure running under authN-authZ/auth-istio folder
60
60
# apply the yaml to request authentication using JWT token
61
- kubectl apply -f $( pwd) /$( DEPLOY_METHOD) /chatQnA_authZ_fakejwt.yaml -n chatqa
61
+ kubectl apply -f $( pwd) /$DEPLOY_METHOD /chatQnA_authZ_fakejwt.yaml -n chatqa
62
62
63
63
# apply the yaml file to request that only JWT token with
64
64
# issuer & sub == "[email protected] " and groups belongs to group1
65
65
# can access the endpoint of chatQnA service
66
- kubectl apply -f $( pwd) /$( DEPLOY_METHOD) /chatQnA_authN_fakejwt.yaml -n chatqa
66
+ kubectl apply -f $( pwd) /$DEPLOY_METHOD /chatQnA_authN_fakejwt.yaml -n chatqa
67
67
```
68
68
69
69
After applying these two yaml files, we have setup the policy that only user with a valid JWT token (with valid issuer and claims) could access the pipeline endpoint.
@@ -151,14 +151,14 @@ Use the commands to apply the authentication and authorization rules.
151
151
152
152
```bash
153
153
# export the router service through istio ingress gateway
154
- kubectl apply -f $(pwd)/$( DEPLOY_METHOD) /chatQnA_router_gateway.yaml
154
+ kubectl apply -f $(pwd)/$DEPLOY_METHOD/chatQnA_router_gateway.yaml
155
155
156
156
# ' envsubst' is used to substitute envs in yaml.
157
157
# use ' sudo apt-get install gettext-base' to install envsubst if it does not exist on your machine
158
158
# apply the authentication and authorization rule
159
159
# these files will restrict user access with valid token (with valid issuer, username and realm role)
160
- envsubst < $(pwd)/$( DEPLOY_METHOD) /chatQnA_authN_keycloak.yaml | kubectl -n chatqa apply -f -
161
- envsubst < $(pwd)/$( DEPLOY_METHOD) /chatQnA_authZ_keycloak.yaml | kubectl -n chatqa apply -f -
160
+ envsubst < $(pwd)/$DEPLOY_METHOD/chatQnA_authN_keycloak.yaml | kubectl -n chatqa apply -f -
161
+ envsubst < $(pwd)/$DEPLOY_METHOD/chatQnA_authZ_keycloak.yaml | kubectl -n chatqa apply -f -
162
162
```
163
163
164
164
User could customize the chatQnA_authZ_keycloak.yaml to reflect roles, groups or any other claims they defined in the OIDC provider for the user.
@@ -261,6 +261,7 @@ export CLIENT_SECRET=<YOUR_CLIENT_SECRET>
261
261
# Using bash here. More methods found here:
262
262
# https://oauth2-proxy.github.io/oauth2-proxy/configuration/overview#generating-a-cookie-secret
263
263
export COOKIE_SECRET=$( dd if=/dev/urandom bs=32 count=1 2> /dev/null | base64 | tr -d -- ' \n' | tr -- ' +/' ' -_' ; echo)
264
+ kubectl create ns oauth2-proxy
264
265
envsubst < $( pwd) /oauth2_install.yaml | kubectl apply -f -
265
266
` ` `
266
267
@@ -270,7 +271,7 @@ Here we expose the chatQnA endpoint through the ingress gateway and then install
270
271
271
272
` ` ` bash
272
273
# expose chatqna endpoint
273
- kubectl apply -f $( pwd) /$( DEPLOY_METHOD) /chatQnA_router_gateway_oauth.yaml
274
+ kubectl apply -f $( pwd) /$DEPLOY_METHOD /chatQnA_router_gateway_oauth.yaml
274
275
# build chatqna UI image if not exist on your machine
275
276
git clone https://github.com/opea-project/GenAIExamples.git
276
277
cd GenAIExamples/ChatQnA/docker/ui/
@@ -280,7 +281,11 @@ docker save -o ui.tar opea/chatqna-conversation-ui:latest
280
281
sudo ctr -n k8s.io image import ui.tar
281
282
# install chatqna conversation UI
282
283
cd && cd GenAIInfra
283
- helm install chatqna-ui $( pwd) /helm-charts/common/chatqna-ui --set BACKEND_SERVICE_ENDPOINT=" http://${INGRESS_HOST} :${INGRESS_PORT} /" ,DATAPREP_SERVICE_ENDPOINT=" http://${INGRESS_HOST} :${INGRESS_PORT} /dataprep"
284
+ if [ " ${DEPLOY_METHOD} " = " gmc-based" ]; then
285
+ helm install chatqna-ui $( pwd) /helm-charts/common/chatqna-ui --set BACKEND_SERVICE_ENDPOINT=" http://chatqna-service.com:${INGRESS_PORT} /" ,DATAPREP_SERVICE_ENDPOINT=" http://chatqna-service.com:${INGRESS_PORT} /dataprep"
286
+ else
287
+ helm install chatqna-ui $( pwd) /helm-charts/common/chatqna-ui --set BACKEND_SERVICE_ENDPOINT=" http://chatqna-service.com:${INGRESS_PORT} /v1/chatqna" ,DATAPREP_SERVICE_ENDPOINT=" http://chatqna-service.com:${INGRESS_PORT} /v1/dataprep"
288
+ fi
284
289
# expose ui service outside
285
290
kubectl apply -f $( pwd) /chatQnA_ui_gateway.yaml
286
291
` ` `
@@ -292,6 +297,7 @@ Here we apply the authentication and authorization rules.
292
297
` ` ` bash
293
298
# Before applying the authorization rule, need to add the oauth2-proxy as the external authorization provider
294
299
kubectl apply -f $( pwd) /chatQnA_istio_external_auth.yaml
300
+ kubectl rollout restart deployment/istiod -n istio-system
295
301
# 'envsubst' is used to substitute envs in yaml.
296
302
# use 'sudo apt-get install gettext-base' to install envsubst if it does not exist on your machine
297
303
# apply the authentication and authorization rule
0 commit comments