From 485abc79aca858d2a5748e24dac6d85c0983041e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 23:27:42 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- helm-charts/auth-apisix/README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/helm-charts/auth-apisix/README.md b/helm-charts/auth-apisix/README.md index a24fa5aee..4f78a1122 100644 --- a/helm-charts/auth-apisix/README.md +++ b/helm-charts/auth-apisix/README.md @@ -59,6 +59,7 @@ helm install auth-apisix-crds . --namespace auth-apisix ## Usage The published APIs in apisix gateway are accessible through auth-apisix-gateway kubernetes service. By default, it is a NodePort service and can be accessed as: + ```sh export NODE_PORT=$(kubectl get --namespace auth-apisix -o jsonpath="{.spec.ports[0].nodePort}" services auth-apisix-gateway) export NODE_IP=$(kubectl get nodes --namespace auth-apisix -o jsonpath="{.items[0].status.addresses[0].address}") @@ -68,6 +69,7 @@ export accessUrl=http://$NODE_IP:$NODE_PORT/ ``` +
Apisix helm chart provides configs to change the service type to other options like LoadBalancer (apisix.service.type) and externalTrafficPolicy to 'local'(apisix.service.externalTrafficPolicy). These can be added in values_apisix_gw.yaml

While accessing the published APIs, the HTTP Authorization header of the request should contain the Access token provided by Identity provider as 'Bearer \'

@@ -86,15 +88,18 @@ export KEYCLOAK_CLIENT_SECRET= export TOKEN=$(curl -X POST http://${KEYCLOAK_ADDR}/realms/${KEYCLOAK_REALM}/protocol/openid-connect/token -H 'Content-Type: application/x-www-form-urlencoded' -d "grant_type=password&client_id=${KEYCLOAK_CLIENT_ID}&client_secret=${KEYCLOAK_CLIENT_SECRET}&username=${USER}&password=${PASSWORD}" | jq -r .access_token) # follow instructions above to fetch the NODE_IP and NODE_PORT + export accessUrl="http://$NODE_IP:$NODE_PORT/chatqna-oidc" # try without token. Shall get response: "Authorization required 401 error" + curl -X POST $accessUrl -d '{"text":"What is the revenue of Nike in 2023?","parameters":{"max_new_tokens":17, "do_sample": true}}' -sS -H 'Content-Type: application/json' -w " %{http_code}\n" # try with token. Shall get the correct response from ChatQnA with http code 200 + curl -X POST $accessUrl -d '{"text":"What is the revenue of Nike in 2023?","parameters":{"max_new_tokens":17, "do_sample": true}}' -sS -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' -w " %{http_code}\n" -``` +```` ## Uninstall @@ -103,8 +108,8 @@ curl -X POST $accessUrl -d '{"text":"What is the revenue of Nike in 2023?","para # Uninstall apisix helm uninstall auth-apisix-crds --namespace auth-apisix helm uninstall auth-apisix --namespace auth-apisix -``` +```` + The crds installed by apisix won't be deleted by helm uninstall. Need to manually delete those crds
All APISIX specific crds can be obtained by 'kubectl get crds | grep apisix'
Each crd can be manually deleted by 'kubectl delete crd/\'
-