diff --git a/config/samples/README.md b/config/samples/README.md index 2139acf9..38a81c73 100644 --- a/config/samples/README.md +++ b/config/samples/README.md @@ -118,48 +118,6 @@ oc create secret generic exploit-iq-secret \ --from-literal=hmac-secret-key="$HMAC_SECRET_KEY" ``` -```bash -oc apply -f exploitiq_v1alpha1_exploitiqstack_custom_images2.yaml -``` - ---- - -### 3. **exploitiq_v1alpha1_exploitiqstack_full.yaml** - -**Platform**: OpenShift or Kubernetes -**Use Case**: OpenAI-hosted (or OpenAI-compatible) LLM with NVIDIA-hosted embedding API - -**Features**: - -- OpenAI-compatible LLM with API key auth (`llm.authSecretRef`) -- NVIDIA-hosted embedding endpoint with independent API key (`embedding.authSecretRef`) -- Custom engine and webapp images - -**Use this when**: - -- Your LLM is OpenAI or another hosted OpenAI-compatible API that requires a key -- Embeddings are served by the NVIDIA-hosted embedding API (not self-hosted) -- Both services require separate API keys - -**Why `embedding.authSecretRef` is required here**: when `llm.mode` is `openai`, the -operator does not use `exploit-iq-secret.nvidia_api_key` for the nginx embedding route. -Without `embedding.authSecretRef` the cache renders `Authorization: Bearer EMPTY` for -`/nim_embed` requests, causing 401 errors from the NVIDIA embedding API. - -**Before applying**: - -1. Create `exploit-iq-secret` with both the OpenAI and NVIDIA keys: - -```bash -export HMAC_SECRET_KEY=$(openssl rand -base64 32) -oc create secret generic exploit-iq-secret \ - --from-literal=ghsa_api_key=YOUR_GITHUB_TOKEN \ - --from-literal=nvidia_api_key=YOUR_NVIDIA_API_KEY \ - --from-literal=openai_api_key=YOUR_OPENAI_API_KEY \ - --from-literal=serpapi_api_key=YOUR_SERPAPI_KEY \ - --from-literal=hmac-secret-key="$HMAC_SECRET_KEY" -``` - ```bash oc apply -f exploitiq_v1alpha1_exploitiqstack_full.yaml ``` @@ -235,6 +193,49 @@ kubectl apply -f exploitiq_v1alpha1_exploitiqstack_kubernetes_oidc_cognito.yaml --- +### 6. **exploitiq_v1alpha1_exploitiqstack_self_hosted_llm_oidc.yaml** + +**Platform**: Kubernetes (or OpenShift) +**Use Case**: Self-hosted LLM with OIDC authentication + +**Features**: + +- Self-hosted LLM with OpenAI-compatible API +- Self-hosted embedding NIM (optional — omit `embedding` block for NVIDIA-hosted) +- OIDC authentication via Keycloak (or any OIDC provider) + +**Use this when**: + +- You have a self-hosted LLM and want OIDC authentication +- You are running on Kubernetes (not OpenShift) or OpenShift with external OIDC + +**Before applying**: + +1. Replace `spec.llm.baseURL` and `spec.llm.modelName` with your LLM endpoint and model +2. Replace `spec.auth.oidc.issuerURL` and `spec.auth.oidc.clientID` with your OIDC provider details +3. Create the required secrets: + + ```bash + export HMAC_SECRET_KEY=$(openssl rand -base64 32) + + kubectl create secret generic exploit-iq-secret \ + --from-literal=ghsa_api_key=YOUR_GITHUB_TOKEN \ + --from-literal=serpapi_api_key=YOUR_SERPAPI_KEY \ + --from-literal=hmac-secret-key="$HMAC_SECRET_KEY" + + kubectl create secret generic oidc-client-secret \ + --from-literal=client-secret=YOUR_OIDC_CLIENT_SECRET + ``` + + > **Note**: `nvidia_api_key` is not required when both LLM and embedding are self-hosted. + > Add it only if you remove the `embedding` block to fall back to the NVIDIA-hosted endpoint. + +```bash +kubectl apply -f exploitiq_v1alpha1_exploitiqstack_self_hosted_llm_oidc.yaml +``` + +--- + ## Quick Start Workflow Generate the HMAC_SECRET_KEY: diff --git a/config/samples/exploitiq_v1alpha1_exploitiqstack_full.yaml b/config/samples/exploitiq_v1alpha1_exploitiqstack_full.yaml index 1e7222ba..d762e313 100644 --- a/config/samples/exploitiq_v1alpha1_exploitiqstack_full.yaml +++ b/config/samples/exploitiq_v1alpha1_exploitiqstack_full.yaml @@ -21,6 +21,16 @@ spec: authSecretRef: # Set when embedding upstream requires API key auth name: exploit-iq-secret key: nvidia_api_key + auth: + oidc: + issuerURL: https://keycloak.example.com/realms/exploit-iq # Replace with your OIDC provider + clientID: exploit-iq-client # Replace with your OIDC client ID + clientSecretRef: + name: oidc-client-secret + key: client-secret + provider: keycloak # keycloak (default), cognito, or entra + # cognitoDomain: exploit-iq.auth.us-east-1.amazoncognito.com # Required when provider is cognito + # entraScope: api:///.default # Required when provider is entra; must end with /.default engine: mainContainer: # Override the agent (engine) image. Omit to use the operator's default image. diff --git a/config/samples/exploitiq_v1alpha1_exploitiqstack_self_hosted_llm_oidc.yaml b/config/samples/exploitiq_v1alpha1_exploitiqstack_self_hosted_llm_oidc.yaml new file mode 100644 index 00000000..21f9257f --- /dev/null +++ b/config/samples/exploitiq_v1alpha1_exploitiqstack_self_hosted_llm_oidc.yaml @@ -0,0 +1,32 @@ +apiVersion: exploitiq.openshift.io/v1alpha1 +kind: ExploitIQStack +metadata: + labels: + app.kubernetes.io/name: exploitiq-operator + name: exploitiqstack-self-hosted-llm-oidc +spec: + llm: + mode: openai # Self-hosted LLM with OpenAI-compatible API + baseURL: http://vllm.ai-namespace.svc:8000 # Replace with your self-hosted LLM endpoint + modelName: meta-llama/Meta-Llama-3.1-70B-Instruct # Replace with your model name + embedding: + # Self-hosted embedding NIM. Omit this block to use the NVIDIA-hosted endpoint. + baseURL: http://nim-embed.ai-namespace.svc:8000 # Replace with your embedding endpoint + modelName: nvidia/nv-embedqa-e5-v5 # Replace with the model your embedder serves + auth: + oidc: + issuerURL: https://keycloak.example.com/realms/exploit-iq # Replace with your OIDC provider + clientID: exploit-iq-client # Replace with your OIDC client ID + clientSecretRef: + name: oidc-client-secret # Create this Secret with your OIDC client secret + key: client-secret + provider: keycloak # keycloak (default), cognito, or entra + webApp: + registryCredentialsSecretRef: + name: image-registry-credentials + # External MongoDB connection (Mode A — host + port). + # Secret must contain keys: host, username, password + database: + mode: hostPort + secretRef: + name: mongodb-credentials diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index 0cdcb120..1c7f1830 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -4,4 +4,5 @@ resources: - exploitiq_v1alpha1_exploitiqstack_self_hosted_llm.yaml - exploitiq_v1alpha1_exploitiqstack_kubernetes_oidc_keycloak.yaml - exploitiq_v1alpha1_exploitiqstack_kubernetes_oidc_cognito.yaml +- exploitiq_v1alpha1_exploitiqstack_self_hosted_llm_oidc.yaml # +kubebuilder:scaffold:manifestskustomizesamples