From 51b179e1c5b2fdc5bedb34be4a863fb5fdde95ef Mon Sep 17 00:00:00 2001 From: ehhuang Date: Wed, 16 Jul 2025 15:07:26 -0700 Subject: [PATCH] chore: update k8s template (#2786) # What does this PR do? - enables auth - updates to use distribution-starter docker ## Test Plan bash apply.sh --- docs/source/deploying/kubernetes_deployment.md | 13 ++++++++++++- docs/source/distributions/k8s/apply.sh | 18 ++++++++++++++++++ .../distributions/k8s/stack-configmap.yaml | 3 +++ .../distributions/k8s/stack-k8s.yaml.template | 2 +- .../distributions/k8s/stack_run_config.yaml | 3 +++ .../distributions/k8s/ui-k8s.yaml.template | 6 ++++++ 6 files changed, 43 insertions(+), 2 deletions(-) diff --git a/docs/source/deploying/kubernetes_deployment.md b/docs/source/deploying/kubernetes_deployment.md index c8fd075fc..7e9791d8d 100644 --- a/docs/source/deploying/kubernetes_deployment.md +++ b/docs/source/deploying/kubernetes_deployment.md @@ -222,10 +222,21 @@ llama-stack-client --endpoint http://localhost:5000 inference chat-completion -- ## Deploying Llama Stack Server in AWS EKS -We've also provided a script to deploy the Llama Stack server in an AWS EKS cluster. Once you have an [EKS cluster](https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html), you can run the following script to deploy the Llama Stack server. +We've also provided a script to deploy the Llama Stack server in an AWS EKS cluster. + +Prerequisites: +- Set up an [EKS cluster](https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html). +- Create a [Github OAuth app](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) and get the client ID and client secret. + - Set the `Authorization callback URL` to `http:///api/auth/callback/` +Run the following script to deploy the Llama Stack server: ``` +export HF_TOKEN= +export GITHUB_CLIENT_ID= +export GITHUB_CLIENT_SECRET= +export LLAMA_STACK_UI_URL= + cd docs/source/distributions/eks ./apply.sh ``` diff --git a/docs/source/distributions/k8s/apply.sh b/docs/source/distributions/k8s/apply.sh index 7b403d34e..3356da53e 100755 --- a/docs/source/distributions/k8s/apply.sh +++ b/docs/source/distributions/k8s/apply.sh @@ -21,6 +21,24 @@ else exit 1 fi +if [ -z "${GITHUB_CLIENT_ID:-}" ]; then + echo "ERROR: GITHUB_CLIENT_ID not set. You need it for Github login to work. Refer to https://llama-stack.readthedocs.io/en/latest/deploying/index.html#kubernetes-deployment-guide" + exit 1 +fi + +if [ -z "${GITHUB_CLIENT_SECRET:-}" ]; then + echo "ERROR: GITHUB_CLIENT_SECRET not set. You need it for Github login to work. Refer to https://llama-stack.readthedocs.io/en/latest/deploying/index.html#kubernetes-deployment-guide" + exit 1 +fi + +if [ -z "${LLAMA_STACK_UI_URL:-}" ]; then + echo "ERROR: LLAMA_STACK_UI_URL not set. Should be set to the external URL of the UI (excluding port). You need it for Github login to work. Refer to https://llama-stack.readthedocs.io/en/latest/deploying/index.html#kubernetes-deployment-guide" + exit 1 +fi + + + + set -euo pipefail set -x diff --git a/docs/source/distributions/k8s/stack-configmap.yaml b/docs/source/distributions/k8s/stack-configmap.yaml index 129471862..c505cba49 100644 --- a/docs/source/distributions/k8s/stack-configmap.yaml +++ b/docs/source/distributions/k8s/stack-configmap.yaml @@ -122,6 +122,9 @@ data: provider_id: rag-runtime server: port: 8321 + auth: + provider_config: + type: github_token kind: ConfigMap metadata: creationTimestamp: null diff --git a/docs/source/distributions/k8s/stack-k8s.yaml.template b/docs/source/distributions/k8s/stack-k8s.yaml.template index 1cfc63ef5..912445f68 100644 --- a/docs/source/distributions/k8s/stack-k8s.yaml.template +++ b/docs/source/distributions/k8s/stack-k8s.yaml.template @@ -27,7 +27,7 @@ spec: spec: containers: - name: llama-stack - image: llamastack/distribution-remote-vllm:latest + image: llamastack/distribution-starter:latest imagePullPolicy: Always # since we have specified latest instead of a version env: - name: ENABLE_CHROMADB diff --git a/docs/source/distributions/k8s/stack_run_config.yaml b/docs/source/distributions/k8s/stack_run_config.yaml index 23993ca5d..4da1bd8b4 100644 --- a/docs/source/distributions/k8s/stack_run_config.yaml +++ b/docs/source/distributions/k8s/stack_run_config.yaml @@ -119,3 +119,6 @@ tool_groups: provider_id: rag-runtime server: port: 8321 + auth: + provider_config: + type: github_token diff --git a/docs/source/distributions/k8s/ui-k8s.yaml.template b/docs/source/distributions/k8s/ui-k8s.yaml.template index ef1bf0c55..a6859cb86 100644 --- a/docs/source/distributions/k8s/ui-k8s.yaml.template +++ b/docs/source/distributions/k8s/ui-k8s.yaml.template @@ -26,6 +26,12 @@ spec: value: "http://llama-stack-service:8321" - name: LLAMA_STACK_UI_PORT value: "8322" + - name: GITHUB_CLIENT_ID + value: "${GITHUB_CLIENT_ID}" + - name: GITHUB_CLIENT_SECRET + value: "${GITHUB_CLIENT_SECRET}" + - name: NEXTAUTH_URL + value: "${LLAMA_STACK_UI_URL}:8322" args: - -c - |