Skip to content

Add istio yaml examples - #3

Merged
aljesusg merged 1 commit into
kiali:mainfrom
josunect:ossm-14791
Oct 14, 2026
Merged

aljesusg merged 1 commit into
kiali:mainfrom
josunect:ossm-14791

Conversation

@josunect

@josunect josunect commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Add 20 curated Istio YAML examples (docs/istio-yaml-examples/) covering traffic management, security, and resilience patterns, with inline comments and frontmatter metadata (Istio versions, CRD types, categories).

Wire them into the BYOK pipeline as a local source in config.yaml, copy docs/ in the Containerfile, and enhance build_index.py to parse frontmatter and enrich chunks for better RAG retrieval and citations.

Add tests to validate example structure, YAML blocks, and local document loading.

How to test it

export BYOK_DOCS="$HOME/dev/kiali-byok"
podman run -it --rm \
  --workdir /app-root \
  -v ./hack/lightspeed:/app-root/config:Z \
  -v ~/.google:/app-root/.google:Z \
  -v "${BYOK_DOCS}/vector_db:/app-root/vector_db:Z" \
  -e OLS_CONFIG_FILE=/app-root/config/dev_oslconfig_google.yaml \
  -p 8083:8080 \
  quay.io/openshift-lightspeed/lightspeed-service-api:latest

Wait for All indexes are loaded in logs, then:

curl -s -X POST http://127.0.0.1:8083/v1/query \
  -H "Content-Type: application/json" \
  -d '{"query": "blue-green deployment x-test-version exact green productpage blue green subset"}' \
  | python3 -c "
import sys, json
d = json.load(sys.stdin)
for i, x in enumerate(d.get('referenced_documents', []), 1):
    mark = ' <-- BYOK' if 'kiali-byok' in x['doc_url'] else ''
    print(f'{i}. {x[\"doc_title\"]}{mark}\n   {x[\"doc_url\"]}')

Example:

curl -s -X POST http://127.0.0.1:8083/v1/query -H "Content-Type: application/json" -d '{"query": "blue-green deployment x-test-version exact green productpage blue green subset"}'

{"conversation_id":"62ce29ee-aede-4401-9b77-dac6e4acc7a8","response":"You can implement a blue-green deployment in Istio using a DestinationRuleto define your versions and aVirtualService to control traffic flow.\n\n1. **DestinationRule**: Defines blue(v1) andgreen(v2) subsets for theproductpage service based on pod labels.\n2. **VirtualService**:\n * Routes traffic with the header x-test-version: greento thegreensubset for testing.\n * Routes all other production traffic to thebluesubset by default.\n\nTo perform the cutover, you would update the default route in theVirtualServiceto point to thegreen subset.\n\nHere is the configuration:\n\n```yaml\napiVersion: networking.istio.io/v1\nkind: DestinationRule\nmetadata:\n name: productpage\n namespace: bookinfo\nspec:\n host: productpage\n subsets:\n - name: blue\n labels:\n version: v1 # current production (blue)\n - name: green\n labels:\n version: v2 # new release (green)\n---\napiVersion: networking.istio.io/v1\nkind: VirtualService\nmetadata:\n name: productpage\n namespace: bookinfo\nspec:\n hosts:\n - productpage\n http:\n # Internal testers hit green via header\n - match:\n - headers:\n x-test-version:\n exact: green\n route:\n - destination:\n host: productpage\n subset: green\n # Default production traffic goes to blue\n - route:\n - destination:\n host: productpage\n subset: blue\n```","referenced_documents":[{"doc_url":"https://github.com/kiali/kiali-byok/blob/main/docs/istio-yaml-examples/traffic-management/blue-green-deployment.md","doc_title":"Blue-Green Deployment with VirtualService"},{"doc_url":"https://istio.io/latest/docs/releases/feature-stages/","doc_title":"Feature Status"}],"truncated":false,"input_tokens":2874,"output_tokens":359,"available_quotas":{},"tool_calls":[],"tool_results":[]}

@aljesusg
aljesusg merged commit 3e01432 into kiali:main Oct 14, 2026
1 check passed
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.

2 participants