Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more details in guideline for Auth Istio&Apisix #485

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

XinyaoWa
Copy link

Description

Add more details in guideline for Auth Istio&Apisix

Issues

List the issue or RFC link this PR is working on. If there is no such link, please mark it as n/a.

Type of change

List the type of change like below. Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would break existing design and interface)

Dependencies

List the newly introduced 3rd party dependency if exists.

Tests

Describe the tests that you ran to verify your changes.

@XinyaoWa XinyaoWa requested a review from Ruoyu-y as a code owner October 18, 2024 10:29
@XinyaoWa
Copy link
Author

@ckhened Please help to have a review~

authN-authZ/auth-istio/README.md Show resolved Hide resolved
First export the router service through istio ingress gateway.

```bash
kubectl apply -f $(pwd)/$DEPLOY_METHOD/chatQnA_router_gateway.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is only used for option: via JWT token generated by OIDC providers with curl
Why it is defined in the prerequisite section?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this has no relationship with the token generation way. It is just from istio gateway, and should be added for all megaservices if you want to do authentication.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, understand. But for authentication with the oauth service, another gateway configuration needs to get applied since there are some extra configuration. Applying both of them might introduce conflicts or complexity. So if you want to set the gateway anyway, please put the steps in each section, instead of putting the step in the Prerequisite section.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your suggestion. Putting the steps in each section will be duplicated. Thus I add "Optional" to this part and add a suggestion for this, do you think it's work?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your suggestion. Putting the steps in each section will be duplicated. Thus I add "Optional" to this part and add a suggestion for this, do you think it's work?

Well. I think it is a must for all options to find the ingress port and ip address, but for the step kubectl apply -f $(pwd)/$DEPLOY_METHOD/chatQnA_router_gateway.yaml, it is ONLY used for the first two options of authentication, and NOT needed(instead of optional) for the third option, as it shall only use kubectl apply -f $(pwd)/$DEPLOY_METHOD/chatQnA_router_gateway_oauth.yaml instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your explanation!! I have just move this part to "Perform authentication and authorization via JWT tokens generated by OIDC provider" section as your original sequence, please have a check~

authN-authZ/auth-istio/README.md Outdated Show resolved Hide resolved
authN-authZ/auth-apisix/README.md Outdated Show resolved Hide resolved
authN-authZ/auth-apisix/keycloak_install.yaml Outdated Show resolved Hide resolved
@Ruoyu-y Ruoyu-y requested a review from ckhened November 4, 2024 01:44
@XinyaoWa XinyaoWa requested a review from Ruoyu-y November 6, 2024 03:34
authN-authZ/auth-istio/README.md Outdated Show resolved Hide resolved
First export the router service through istio ingress gateway.

```bash
kubectl apply -f $(pwd)/$DEPLOY_METHOD/chatQnA_router_gateway.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, understand. But for authentication with the oauth service, another gateway configuration needs to get applied since there are some extra configuration. Applying both of them might introduce conflicts or complexity. So if you want to set the gateway anyway, please put the steps in each section, instead of putting the step in the Prerequisite section.

authN-authZ/auth-istio/README.md Show resolved Hide resolved
authN-authZ/auth-apisix/keycloak_install.yaml Outdated Show resolved Hide resolved
Copy link
Collaborator

@Ruoyu-y Ruoyu-y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

XinyaoWa and others added 11 commits November 28, 2024 10:32
Signed-off-by: Xinyao Wang <xinyao.wang@intel.com>
Signed-off-by: Xinyao Wang <xinyao.wang@intel.com>
Signed-off-by: Xinyao Wang <xinyao.wang@intel.com>
Signed-off-by: Xinyao Wang <xinyao.wang@intel.com>
Signed-off-by: Xinyao Wang <xinyao.wang@intel.com>
Signed-off-by: Xinyao Wang <xinyao.wang@intel.com>
Signed-off-by: Xinyao Wang <xinyao.wang@intel.com>
Signed-off-by: Xinyao Wang <xinyao.wang@intel.com>
@@ -0,0 +1,33 @@
# Copyright (C) 2024 Intel Corporation
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding this file, could you re use the one in templates and add a new values file like values_megaservice.yaml and update the values accordingly so that the implementation will be consistent with helm charts

@joshuayao joshuayao added this to the v1.2 milestone Jan 7, 2025
@joshuayao joshuayao linked an issue Jan 7, 2025 that may be closed by this pull request
@joshuayao joshuayao requested review from ckhened and Ruoyu-y January 17, 2025 03:27
Copy link
Collaborator

@mkbhanda mkbhanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consistently write apisix in text as APISIX, that is how it is on their site. @chickenrae comment -- may want to talk to @yongfengdu - what/how. Please number the steps for installing/configuring keycloak, it helps people. Please add a statement to the effect that envsubst is needed only on the machine from which one is launching the kubectl commands, it is not needed on any of the kubernetes cluster machines.

export USER='mary'
export PASSWORD=<password>
export KEYCLOAK_REALM='apisix'
export KEYCLOAK_CLIENT_ID='apisix'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

realm and client_id have to be same? or any reason you choose same?


2. Run keycloak, setup a realm with OIDC based authentication and add users with passwords for each user.
## Start Keycloak and configuration
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Start Keycloak and configuration
## Starting and Configuring Keycloak


In this case, we add a realm called `apisix` and add a user called `mary` with password. In the authentication step, only the user from `apisix` realm can access the chatQnA pipeline.

Steps to start keycloak.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you cannot start something before installing it.

Description and step don't match.

If you have numbered steps, let step 1 be "Create a persistent volume for keycloak"


# install keycloak with helm by setting
Then install keycloak.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this (2) for your step 2. Install keycloak

kubectl apply -f ./keycloak_install.yaml
```

Get the ip and port to access keycloak.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

step 3 3) Determine keycloak service ip and port.

@@ -151,18 +174,63 @@ The user management is done via Keycloak and the configuration steps look like t

4. Create a new user name as `mary` and another user as `bob`. Set passwords for both users (set 'Temporary' to 'Off'). Select Role mapping on the top, assign the `user` role to `mary` and assign the `viewer` role to `bob`.

**Apply authentication and authorization policies to the pipeline endpoint based on OIDC provider**
5. Turn off the all the 'Required actions' under the 'Authentication' section in Keycloak
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
5. Turn off the all the 'Required actions' under the 'Authentication' section in Keycloak
5. Turn off the 'Required actions' under the 'Authentication' section in Keycloak

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grammar is wrong with "the all the" but wondering if there is an "all" somewhere in the console ..

./kcadm.sh update realms/master -s sslRequired=NONE --server ${KEYCLOAK_ADDR}
```

Then after open the console and create `istio` realm, go to "Realm setting", set "Require SSL" to "None"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Then after open the console and create `istio` realm, go to "Realm setting", set "Require SSL" to "None"
Then after opening the console, create the `istio` realm. Next go to "Realm setting", and set "Require SSL" to "None"


**Export the router service through istio ingress gateway**

For authentication safegard, we should add a gateway for the service. Here we the istio ingress gateway will be used to access the chatQnA service in different setups.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For authentication safegard, we should add a gateway for the service. Here we the istio ingress gateway will be used to access the chatQnA service in different setups.
For authentication safegard, we should add a gateway for the service. Here we show how to set up the istio ingress gateway to control access to the chatQnA service.

# set the INGRESS_PORT to the istio-ingressgateway svc port
export INGRESS_PORT=${gateway_svc_port}

#Case2: If your environment support external load balancers
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#Case2: If your environment support external load balancers
#Case2: If your environment supports external load balancers

@@ -330,3 +398,15 @@ sudo sed -i '1i\127.0.0.1 chatqna-ui.com' /etc/hosts
Open browser with address `"chatqna-ui.com:${INGRESS_PORT}"` if using GMC based deployment. Otherwise, open the browser with address `"chatqna-service.com:${INGRESS_PORT}"`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we never told folks how to find the address of chatqna-ui.com. the way it is written it feels like a fully qualified domain name like google.com!

@poussa
Copy link
Collaborator

poussa commented Jan 17, 2025

Looks like we need more time to adapt all the changes, so this will not make v1.2 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants