ข้อมูลรับรองบนการเชื่อมต่อ — หนึ่งคีย์ต่อการเชื่อมต่อ และคีย์เดียวที่ปลายทั้งสองด้าน
ที่
พื้นที่
สิ่งที่ตัวอย่างนี้บิลด์
┌── extraction_model ──► llm a hosted model API │ key on the connection, fetched from a secret store memory ───┤ │ └── embedding_model ──► embeddings an embedding server that checks a key key on the connection ═══ the server's own api_key (both read one parameter)| อินสแตนซ์ | Component ของ | สิ่ง |
|---|---|---|
memory | core/datastore/cognee | ผู้credential สำหรับ |
llm | core/ai-model/openai | โมเดลcomponent.aggrega.ai/hosting: managed เข้า |
embeddings | core/ai-model/tei | Text Embeddings Inference ในself-hosted ต้องapi_key ของ |
Releases สามmanifest.yaml และ
| Release | Aggregate | สิ่ง |
|---|---|---|
release-matched.yaml | aggregate-matched.yaml | การ |
release-mismatched.yaml | aggregate-mismatched.yaml | เหมือน |
release-operator-wired.yaml | aggregate-operator-wired.yaml | การinfra |
ร่างตัวอย่าง
คุณ
เขียน
aggrega draft --example connection-credentialsจาก
cd connection-credentialsบิลด์
บิลด์ Release หนึ่ง
aggrega build --release release-matched.yaml --auto-pull # → dist/matched/aggrega build --release release-mismatched.yaml --auto-pull # → dist/mismatched/aggrega build --release release-operator-wired.yaml --auto-pull # → dist/operator-wired/Release แต่ละ
Release ต้อง
aggrega pull --release release-matched.yaml # resolve, then build normallyaggrega build --release release-matched.yaml --auto-pull # or resolve during the buildพื้นที่.aggrega-config.yaml ระบุ--catalog
การ pull พิมพ์:
[… omitted: a warning that the declared-sensitive origin of llm.credential reaches the target with no per-key sensitivity marking, because its realization maps it through a valuesMapping]Pull complete: release-matched.lock (entities=15, source_artifacts=0, external_inputs=0)และ<workspace> แทน
[… omitted: the same warning about llm.credential the pull printed] notice: LINT: Feature "core/referenced-secret" at core/referenced-secret:1.0.0 declares property "origin" in both values: and infra: pillars (path: origin)[… omitted: a total build time, which differs per run]Build completed: 8 files written to <workspace>/distReleases อีกnotice: เกี่ยวcore/referenced-secret ซึ่งorigin จาก values ของinfra ของ
ที่
กับผู้ช่วย AI
ผู้
ใช้เครื่องมือของ Aggrega เท่านั้น และอย่าสร้างโฟลเดอร์เอง หากโฟลเดอร์พื้นที่ทำงานยังไม่มีโฟลเดอร์ `connection-credentials` เรียกเครื่องมือ `draft` หนึ่งครั้งโดยตั้ง `example` เป็น `connection-credentials` และไม่ระบุ `dir` เครื่องมือจะเขียนตัวอย่างลงในโฟลเดอร์ `connection-credentials` ใหม่ จากนั้นเรียกเครื่องมือ `build` หนึ่งครั้งต่อ Release ตามลำดับนี้ — `release-matched.yaml`, `release-mismatched.yaml`, `release-operator-wired.yaml` — โดยแต่ละครั้งตั้ง `workspace_root` เป็น `connection-credentials` ตั้ง `release` เป็นไฟล์นั้น ตั้ง `auto_pull` เป็น true และตั้ง `write` เป็น true บอกฉันว่าการบิลด์แต่ละครั้งเขียนไฟล์ใดบ้าง ไฟล์เหล่านั้นอยู่ใต้ `connection-credentials/dist/`ทรีที่เรนเดอร์
dist/matched/helm/├── embeddings-default-service.yaml├── embeddings-headless-service.yaml├── embeddings-statefulset.yaml├── llm-service.yaml├── memory--llm-zdcredential--memory-externalsecret-memory-memory-llm-credential.yaml├── memory-default-service.yaml├── memory-headless-service.yaml└── memory-statefulset.yamlไฟล์ExternalSecret ที่memory และllm.credential เขียนllm-zdcredential เพราะ
เอกสารใดเขียนอะไร
- แค็ตตาล็อก ประกาศ
จุด ผูก Component ของ ที่ จัด เก็บ ประกาศ สล็อต credentialบนซ็อกเก็ต โมเดล ทั้ง สอง Component ของ เซิร์ฟเวอร์ embedding ประกาศ api_keyบนตัว เอง และ Recipe แต่ละ รายการ ตัดสิน ว่า คีย์ ถูก ส่ง มอบ เป็น ตัวแปร ใด - Aggregate (นัก
พัฒนา) เขียน ว่าที่ จัด เก็บ เข้า ถึง โมเดล ใด ข้อมูล รับรอง บน แต่ละ การ เชื่อม ต่อ คีย์ ที่ เซิร์ฟเวอร์ ยืนยัน และ พารามิเตอร์ เดียว ที่ ทั้ง สอง ปลายข อง การ เชื่อม ต่อ embedding อ่าน - Manifest คือ
การ กำหนด เส้น ทาง ของ ผู้ ดำเนิน การ สำหรับ เป้า หมาย นี้ ตัดสิน ว่า ข้อมูล รับรอง แต่ละ รายการ กลาย เป็น อะไร บน Kubernetes คือ การ อ้างอิง ถึง Secret ที่ เนมสเปซ มี อยู่ แล้ว สำหรับ การ แนบ core/referenced-secretทุกรายการ ยกเว้น รายการ บน การ เชื่อม ต่อ ไป ยัง โมเดล ที่ โฮสต์ ไว้ ซึ่ง ถูก ดึง จาก ที่ จัด เก็บ ข้อมูล ลับ ของ คลัสเตอร์ - Release คือ
เอกสาร ของ ผู้ ดำเนิน การ สำหรับ หนึ่ง สภาพ แวดล้อม จัดหา ค่า ให้ พารามิเตอร์ วาง แนว เขต ไว้ ใน เนมสเปซ และ ใน Release แบบ ที่ ผู้ ดำเนิน การ เชื่อม โยง ก็ เชื่อม โยง การ เชื่อม ต่อ สำหรับ การ สกัด และ ระบุ ชื่อ คีย์ ที่ แสดง บน การ เชื่อม ต่อ นั้น
หนึ่งคีย์ต่อการเชื่อมต่อ
ที่extraction_model และ embedding_model และcredential คีย์aggregate-matched.yaml:
memory: type: core/datastore/cognee values: # The width of the vectors the embedding model above returns. embedding_dimensions: 384 uses: extraction_model: llm: target: llm features: credential: # the key presented to the hosted model type: core/referenced-secret values: key: api-key origin: "{{ .parameters.provider_key_entry }}" embedding_model: embeddings: target: embeddings features: credential: # the key presented to the embedding server type: core/referenced-secret values: key: api-key origin: "{{ .parameters.embedding_key_secret }}"การllm.credential และ embeddings.credential นี่env ของdist/matched/helm/memory-statefulset.yaml:
- name: LLM_API_KEY valueFrom: secretKeyRef: name: memory-llm.credential key: api-key- name: EMBEDDING_API_KEY valueFrom: secretKeyRef: name: embedding-server-key key: api-key[… omitted: the store's own settings, HTTP_PORT to EMBEDDING_DIMENSIONS]- name: EMBEDDING_ENDPOINT value: http://embeddings-default:8080/v1- name: EMBEDDING_MODEL value: BAAI/bge-small-en-v1.5- name: LLM_ENDPOINT value: https://api.openai.com/v1- name: LLM_MODEL value: gpt-4o-miniสองLLM_API_KEY สำหรับEMBEDDING_API_KEY สำหรับ embedding ทั้ง
Component ของmodel_api_key Recipe อ่าน
คีย์เดียวที่ปลายทั้งสองด้าน
เซิร์ฟเวอร์ embedding ตรวจapi_key และ Recipe ส่งAPI_KEY ซึ่งaggregate-matched.yaml:
embeddings: type: core/ai-model/tei values: model: BAAI/bge-small-en-v1.5 features: api_key: # the key the server verifies type: core/referenced-secret values: key: api-key origin: "{{ .parameters.embedding_key_secret }}"นั่นembedding_key_secret ซึ่ง Aggregate ประกาศ
parameters: provider_key_entry: ai/openai-api-key embedding_key_secret: embedding-server-keyManifest ผูก core/referenced-secret กับ k8s-existing-secret ซึ่งorigin เป็นenv ของdist/matched/helm/embeddings-statefulset.yaml:
- name: API_KEY valueFrom: secretKeyRef: name: embedding-server-key key: api-keyและdist/matched/helm/memory-statefulset.yaml:
- name: EMBEDDING_API_KEY valueFrom: secretKeyRef: name: embedding-server-key key: api-keySecret ถูก
เหตุใดเซิร์ฟเวอร์จึงไม่เห็นคีย์ของผู้เรียกเลย
การ
โมเดลspec ทั้งหมดdist/matched/helm/llm-service.yaml:
spec: type: ExternalName externalName: api.openai.com ports: - port: 443คีย์dist/mismatched/ ต่างdist/matched/ เฉพาะaggrega.ai/aggregate-name ซึ่ง
ดัง
คีย์เดียวต่อเซิร์ฟเวอร์
Text Embeddings Inference ตรวจapi_key ของcore/ai-model/vllm กับ core/ai-model/tgi ของ
คีย์ของหนึ่งการเชื่อมต่อจากที่จัดเก็บข้อมูลลับ
Manifest ผูกcore/referenced-secret ทุกmanifest.yaml:
features: # One realization for every core/referenced-secret attachment: the Secret # already exists in the namespace, and origin is its name. type: core/referenced-secret:1.0.0: helm/k8s-existing-secret:1.0.0 # One attachment bound differently, by its name. An attachment written on # a connection is named for the connection's alias, a dot and the slot, # so the memory store's credential on its llm connection is # llm.credential. That key is fetched from the store, and origin is the # store entry to fetch. name: llm.credential: helm/k8s-external-secret:1.0.0k8s-external-secret อ่าน origin เป็นorigin ของprovider_key_entry ซึ่งai/openai-api-key การExternalSecret ที่ Operator ของspec ทั้งหมดdist/matched/helm/memory--llm-zdcredential--memory-externalsecret-memory-memory-llm-credential.yaml:
spec: refreshInterval: "1h" secretStoreRef: name: platform-secret-store kind: ClusterSecretStore target: name: memory-llm.credential creationPolicy: Owner data: - secretKey: api-key remoteRef: key: "ai/openai-api-key"Secret ที่memory-llm.credential ตั้งLLM_API_KEY ของClusterSecretStore ชื่อ platform-secret-store
สิ่ง
ตำแหน่งที่ปลายทั้งสองหาค่าข้อมูลลับ
แพลตฟอร์ม
แต่ละaggrega.ai/namespace: memory และ
metadata: name: memory namespace: memory
# dist/matched/helm/embeddings-statefulset.yamlmetadata: name: embeddings namespace: memoryปลายapi_key และ embeddings.credential เข้าk8s-external-secret Release จัดหาExternalSecret ใน
ผู้ดำเนินการเชื่อมโยงการเชื่อมต่อ
aggregate-operator-wired.yaml เขียนextraction_model ของrelease-operator-wired.yaml:
memory: uses: # A connection the Aggregate does not write, into a socket the # store's catalog entity declares, to a component the Aggregate # declares. A Release writes no values, so the credential on it # names its secret in infra. extraction_model: llm: target: llm features: credential: type: core/referenced-secret infra: origin: ai/openai-api-keyRelease เชื่อมvalues ข้อมูลinfra core/referenced-secret รับ origin จาก values ของinfra ของ
การllm.credential เหมือนdist/operator-wired/ และ dist/matched/ คือ data ของ ExternalSecret:
data: - secretKey: value remoteRef: key: "ai/openai-api-key"และdist/operator-wired/helm/memory-statefulset.yaml:
- name: LLM_API_KEY valueFrom: secretKeyRef: name: memory-llm.credential key: valueคีย์value ไม่ใช่ api-key เพราะ key เป็นvalues ซึ่ง
โมเดลmanaged การvalues ของunauthenticated: true ข้อfeatures: ออกE0033 ซึ่ง
เมื่อปลายทั้งสองไม่ตรงกัน
aggregate-mismatched.yaml ให้
parameters: provider_key_entry: type: string description: > The store entry holding the key the memory store presents to the hosted model provider. embedding_key_secret: type: string description: The Secret holding the key the embedding server verifies. # The fault: a second parameter for what is meant to be the same key. memory_embedding_key_secret: type: string description: The Secret holding the key the memory store presents to the embedding server.api_key ของembedding_key_secret และmemory_embedding_key_secret ซึ่ง Release จัดหาembedding-server-key และdist/mismatched/helm/memory-statefulset.yaml:
- name: EMBEDDING_API_KEY valueFrom: secretKeyRef: name: embedding-client-key key: api-keyเมื่อ
การ
aggrega lint --release release-mismatched.yamlrelease-mismatched.yaml:warn: E0329 connection-credential-matches-target-key: connection "embeddings" on socket "embedding_model" of component "memory" carries a credential in its credential slot and its target "embeddings" holds a key in its api_key slot, but the two ends write their secret's locator differently, so they may name different secrets and the target would refuse the key this caller presents. The locators are compared as written, and neither is shown here. Reading one parameter at both ends keeps them one key; that agreement is the standard-catalog convention, and the build does not check it.conventions checked: 10 entities, 1 advisory finding(s)การ
aggrega lint --release release-matched.yamlconventions checked: 10 entities, 0 advisory finding(s)และ
กฎapi_key ของcredential ของorigin ที่managed ซึ่ง api_key ของllm จึงaggrega lint ออกallow_connection_credential_mismatches ตัวaggrega/lint ที่connection-credential-matches-target-key และE0329 กฎ
ความกำหนดแน่นอน
Release ทั้ง--verify-determinism ซึ่ง
aggrega build --release release-matched.yaml --verify-determinismการ
การปรับแต่งตัวอย่างนี้
- เพิ่ม
ผู้ ข้อมูลเรียก ราย ที่ สอง ของ เซิร์ฟเวอร์ embedding รับรอง บน การ เชื่อม ต่อ ของ ผู้ เรียก นั้น อ่าน embedding_key_secretด้วย เซิร์ฟเวอร์ถือ คีย์ เดียว สำหรับ ผู้ เรียก ทุก ราย ผู้ เรียก ราย ที่ สอง จึง แสดง คีย์ เดียวกัน - ดึง
คีย์ embedding จาก ผูกที่ จัด เก็บ ด้วย api_keyและembeddings.credentialตามชื่อ เข้า กับ k8s-external-secretและจัดหา ค่า embedding_key_secretด้วยรายการ ใน ที่ จัด เก็บ แทน ชื่อ ของ Secret ทั้ง สอง ปลาย เปลี่ยน พร้อม กัน เพราะ ทั้ง สอง อ่าน พารามิเตอร์ นั้น - เข้า
ถึง ปล่อยโมเดล ที่ ไม่ ตรวจ คีย์ ข้อมูล รับรอง ออก จาก การ เชื่อม ต่อ ที่ ที่ เป้า หมาย ติด ป้าย กำกับ managedบอกบน การ เชื่อม ต่อ ด้วย unauthenticated: trueในvaluesของการ เชื่อม ต่อ นั้น
สำหรับ