연결의 자격 증명 — 연결마다 하나의 키, 그리고 양 끝에서 하나의 키
두 모델에 연결하고 각 모델에 서로 다른 키를 제시하는 시맨틱 메모리 저장소를 Kubernetes 매니페스트로 컴파일한 예제입니다. 이 저장소는 수집된 자료를 호스팅된 모델로 읽고, 클러스터 안에서 함께 실행되는 임베딩 서버로 인코딩합니다. 호스팅된 모델에 제시하는 키는 클러스터 시크릿 저장소에서 가져옵니다. 임베딩 서버는 자체 키를 검사하며, 저장소는 그와 같은 키를 제시합니다. 양 끝이 하나의 파라미터에서 키를 읽으므로, 두 키가 서로 다르게 작성될 수 없습니다.
이 워크스페이스는 자체 카탈로그 엔터티를 하나도 작성하지 않습니다. 여기서 이름을 지정하는 모든 Component, Feature, Recipe는 표준 라이브러리 카탈로그에 포함되어 제공됩니다. 이곳의 파일들, 즉 세 개의 Aggregates, 하나의 Manifest, 세 개의 Releases가 작성해야 하는 전부입니다.
구성되는 내용
┌── 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 슬롯에 보관합니다 |
세 릴리스가 하나의 Manifest인 manifest.yaml을 공유하며, 각각 자체 Aggregate를 가집니다:
| 릴리스 | Aggregate | 보여 주는 내용 |
|---|---|---|
release-matched.yaml | aggregate-matched.yaml | 두 연결 모두 개발자가 작성하며, 임베딩 연결의 양 끝이 하나의 파라미터를 읽습니다 |
release-mismatched.yaml | aggregate-mismatched.yaml | 위와 같지만 양 끝이 두 개의 파라미터를 읽습니다. 빌드는 성공하고, 관례 검사가 권고를 표시합니다 |
release-operator-wired.yaml | aggregate-operator-wired.yaml | 추출 연결을 운영자에게 맡깁니다. Release가 이를 연결하고 infra에서 키의 이름을 지정합니다 |
예제 생성하기
아래 명령으로 이 예제를 빌드하거나, AI 어시스턴트에게 대신 빌드하게 할 수 있습니다.
예제 이름을 딴 새 폴더에 예제를 씁니다:
aggrega scaffold --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는 자체 디렉터리에 기록하므로 세 개의 렌더링된 트리가 공존하며 서로 diff할 수 있습니다.
release는 빌드 전에 lockfile이 필요하며, lockfile은 배포되지 않고 생성됩니다. 먼저 하나를 해석하거나, 빌드가 채우도록 둡니다:
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>/dist나머지 두 release도 같은 줄을 출력하며, 각 pull은 자체
lockfile을 명시하고 각 빌드는 파일 여덟 개를 기록합니다. notice:
줄은 여기의 모든 attachment가 사용하는 credential Feature에 관한 것입니다.
core/referenced-secret은 시크릿의 이름인 origin을
개발자의 values 또는 운영자의 infra 어느 쪽에서든 받으며, 이 권고는
하나의 leaf가 두 pillar 모두에 선언되어 있음을 보고합니다. 이는 어떤 판정도,
렌더링된 어떤 바이트도 바꾸지 않습니다. Credential Features에서
leaf가 양쪽에 있는 이유를 설명합니다.
이 페이지에서 빌드 결과를 출력하는 블록은 실제 실행에서 복사한 것입니다. 관례와 생략된 줄에 사용하는 표시는 이 페이지의 출력 읽기를 참조하십시오.
AI 어시스턴트 사용
Aggrega 도구로 설정한 AI 어시스턴트도 같은 작업을 할 수 있습니다. 다음 프롬프트를 붙여 넣으십시오.
Aggrega 도구만 사용하고, 폴더는 직접 만들지 마십시오. 작업 영역 폴더에 아직 `connection-credentials` 폴더가 없으면 `example`을 `connection-credentials`로 설정하고 `dir`은 지정하지 않은 채 `scaffold` 도구를 한 번 호출하십시오. 이 도구는 예제를 새 `connection-credentials` 폴더에 씁니다. 그런 다음 각 Release마다 `build` 도구를 `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파일 하나는 component 자체의 Recipe가 아니라 attachment가 가져온 것입니다.
바로 스토어가 호스팅된 모델에 제시하는 키를 가져오는 ExternalSecret입니다. 파일 이름에는 attachment가 붙은 component인 memory와
attachment의 이름인 llm.credential이 들어가며, 점이 파일 자체의 이름과 하나의 문자열을 공유하기 때문에 llm-zdcredential로 표기됩니다.
렌더링된 리소스의 이름 지정을 참고하십시오.
임베딩 키를 담은 파일은 없습니다. 아래 섹션에서 보여 주듯이 이 키는 네임스페이스가 이미 보유한 Secret에 있습니다.
어느 문서가 무엇을 작성했는가
- 카탈로그는 바인딩 지점을 선언합니다. 저장소의 Component는
두 모델 소켓 각각에
credential슬롯을 선언하고, 임베딩 서버의 Component는 자기 자신에api_key를 선언하며, 각 Recipe는 키가 어떤 변수로 전달될지 정합니다. - Aggregate(개발자)는 저장소가 어떤 모델에 연결되는지, 각 연결의 자격 증명, 서버가 검증하는 키, 그리고 임베딩 연결의 양 끝이 모두 읽는 하나의 매개변수를 작성합니다.
- Manifest(이 대상에 대한 운영자의 라우팅)는 각 자격 증명이
Kubernetes에서 무엇이 될지 정합니다. 모든
core/referenced-secret첨부는 네임스페이스가 이미 보유한 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처음 두 항목은 키이며, 각각 자신의 연결에 있는 자격 증명에서 오고,
저장소의 Recipe가 각 측에 부여하는 변수 이름을 가집니다. 추출에는 LLM_API_KEY,
임베딩에는 EMBEDDING_API_KEY입니다. 둘 다 값이 아니라 참조이며, helm provider는 Secret에서 읽는 항목을
일반 항목보다 앞에 씁니다. 마지막 네 항목은 두 연결에서 왔습니다. 각 모델은
자신의 주소와 모델 이름을 게시하고, 저장소의 Recipe는 이를 소켓별로
읽습니다.
저장소의 Component는 자신에게도 키 슬롯 model_api_key를 선언합니다.
Recipe는 연결되지 않은 소켓에 대해서만 이 슬롯을 읽습니다. 이 경우 저장소는 provider 자체 주소로
provider에 도달하며, 키를 전달할 연결이 없습니다. 여기서는 두 소켓이 모두 연결되어 있으므로 이 슬롯은 읽히지 않습니다.
양 끝의 하나의 키
임베딩 서버는 키를 검사합니다. 서버는 그 키를 자신의
Component의 슬롯인 api_key에 보관하고, 서버의 Recipe는 이 슬롯을 채운 값을 무엇이든
API_KEY로 전달합니다. 이는 Text Embeddings Inference가 시작 시 읽는 변수입니다.
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가 선언하고 Release가 채웁니다:
parameters: provider_key_entry: ai/openai-api-key embedding_key_secret: embedding-server-keyManifest는 core/referenced-secret을 k8s-existing-secret에 바인딩합니다. 이는
origin을 네임스페이스에 이미 있는 Secret의 이름으로 읽으며 아무것도 렌더링하지
않습니다. 따라서 양 끝은 그 하나의 Secret을 참조합니다. 서버의 컨테이너
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은 Release 외부에서 배포하는 사람이 생성하므로, 키의 실제 값은 작성된 파일이나 렌더링된 아티팩트를 결코 거치지 않습니다.
서버가 호출자의 키를 보지 않는 이유
연결에 붙인 첨부는 호출자에게만 적용됩니다. 스토어의 두 자격 증명은 스토어의 첨부입니다. 이들이 렌더링하는 것은 스토어 옆에 놓이고, 스토어의 컨테이너가 그것을 참조합니다. 이들에 관한 어떤 것도 연결이 가리키는 컴포넌트에 도달하지 않으므로, 대상은 자신에게 도달하는 연결이 무엇을 담고 있든 똑같이 렌더링됩니다.
호스팅된 모델이 이를 분명히 보여 줍니다. 이 모델은 클러스터 내부 이름을
공급자의 호스트에 매핑하는 Service 하나만 파일로 렌더링합니다. 다음은
dist/matched/helm/llm-service.yaml의 spec 전체입니다.
spec: type: ExternalName externalName: api.openai.com ports: - port: 443스토어가 이 모델에 제시하는 키는 다음 절에서 보듯이 스토어 옆에서 가져옵니다.
임베딩 서버는 비교를 통해 이를 보여 줍니다. 아래의 불일치 릴리스는 스토어의
임베딩 연결에 있는 키를 바꾸고 서버의 키는 그대로 두는데, dist/mismatched/에
있는 서버의 세 파일은 dist/matched/에 있는 파일과 각 파일이 빌드된 Aggregate의
이름을 나타내는 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은 ai/openai-api-key로 채워지는 파라미터 provider_key_entry이므로,
첨부는 클러스터의 시크릿 저장소 오퍼레이터가 Secret으로 조정하는 ExternalSecret을
렌더링합니다.
dist/matched/helm/memory--llm-zdcredential--memory-externalsecret-memory-memory-llm-credential.yaml의
spec 전체:
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가 참조하는 이름입니다.
이 구현은 platform-secret-store라는 이름의 ClusterSecretStore에서 읽습니다.
파라미터가 담는 내용은 그것을 읽는 구현에 따라 정해집니다. 호스팅 모델의 키에는 저장소 항목이, 임베딩 키에는 Secret의 이름이 담깁니다. 한 연결의 키는 자체 구현을 사용하고, 같은 타입의 다른 모든 첨부는 해당 타입의 구현을 그대로 유지합니다.
양 끝이 secret을 해석하는 위치
대상 플랫폼은 secret 범위 안에서 참조로 secret을 해석합니다. secret 범위란 한 리소스가 다른 리소스를 이름으로 지정할 수 있는 경계입니다. 연결의 양 끝이 하나의 범위에 있으면 양쪽 모두 하나의 secret 리소스를 참조합니다. 서로 다른 범위에 있으면 각 끝은 동일한 저장소 항목에서 구현된 자체 secret 리소스를 가집니다. Manifest는 각 끝의 구현을 선택합니다. Feature 유형별로 해당 유형의 모든 연결 요소에 대해 선택하거나, 이름으로 하나의 연결 요소에 대해 선택합니다.
각 대상은 범위를 자체 방식으로 정합니다. 이
워크스페이스가 빌드 대상으로 삼는 Kubernetes에서는 네임스페이스가 범위입니다. 워크로드는 자신의 네임스페이스에 있는 Secret만 참조합니다. 여기서 각 release는 하나의 경계를 하나의 네임스페이스
aggrega.ai/namespace: memory에 두며, 렌더링된 모든 문서가 이를 담고 있습니다. 다음은
두 StatefulSet의 앞부분입니다.
metadata: name: memory namespace: memory
# dist/matched/helm/embeddings-statefulset.yamlmetadata: name: embeddings namespace: memory따라서 양 끝은 위의 하나의 Secret을 참조합니다. 임베딩 서버가 별도의
네임스페이스에 있다면 Manifest는 양 끝의 자격 증명을 이름으로 —
api_key와 embeddings.credential — k8s-external-secret에 바인딩하고, Release는
파라미터를 저장소 항목으로 채우며, 각 끝은 자신의 네임스페이스에
ExternalSecret을 가지고 둘 다 그 하나의 항목을 가져옵니다. 이때 저장소는
네임스페이스를 넘어 서버에 도달하며, 이는
cross-boundary-networking에서 다룹니다. 다른
대상에서는 범위가 Compose 프로젝트, Terraform 루트 구성,
CloudFormation 스택이며, Credential Model(자격 증명 모델)에서
각각을 설명합니다.
운영자가 연결을 배선합니다
aggregate-operator-wired.yaml은 임베딩 연결을 작성하고 저장소의 extraction_model 소켓은 바인딩하지 않은 채로 둡니다. 저장소의 카탈로그 엔터티가 이 소켓을 선언하며, 개발자는 이를 운영자에게 맡깁니다. Release는 이 소켓을 Aggregate가 선언한 호스팅 모델에 배선합니다. 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는 카탈로그 엔터티가 선언하고 Aggregate가 바인딩하지 않은 채로 둔 소켓에, Aggregate가 선언한 컴포넌트로 향하는 연결을 배선할 수 있습니다. Release는 컴포넌트를 추가하지 않으며, Aggregate가 작성한 연결의 대상을 바꾸지도 않습니다. Release는 values를 작성하지 않으므로, 그 연결의 자격 증명은 infra에서 자신의 시크릿을 지정합니다. core/referenced-secret은 origin을 개발자의 values 또는 운영자의 infra 중 정확히 하나에서 가져오며, 둘 다 가지거나 둘 다 가지지 않은 첨부가 있으면 빌드가 중단됩니다.
첨부의 이름은 matched release에서와 똑같이 llm.credential이므로, Manifest의 이름 계층이 이를 같은 방식으로 바인딩합니다. Aggregate를 지정하는 레이블 외에, dist/operator-wired/와 dist/matched/ 사이에는 두 줄이 다릅니다. ExternalSecret의 data:
data: - secretKey: value remoteRef: key: "ai/openai-api-key"그리고 dist/operator-wired/helm/memory-statefulset.yaml에서, 저장소가 자신이 채우는 Secret을 참조하는 부분:
- name: LLM_API_KEY valueFrom: secretKeyRef: name: memory-llm.credential key: value데이터 키가 api-key가 아니라 value인 이유는 key가 values 리프이고 이를 Aggregate만 작성하기 때문입니다. 따라서 Release만이 만드는 첨부는 Feature의 기본값을 읽습니다. 실현은 그 키를 게시하고 저장소는 게시된 내용에서 키를 읽으므로, 양쪽은 여전히 일치합니다.
호스팅 모델에는 managed 레이블이 붙어 있으므로, 이 모델에 도달하는 연결은 자격 증명을 가지거나, 자신의 values에서 unauthenticated: true로 모델이 자격 증명을 받지 않는다고 명시합니다. 이는 어느 문서가 연결을 작성했든 마찬가지입니다. Release의 연결에서 features: 블록을 제거하면 빌드가 중단됩니다. 이 중단은 저장소 Component의 어서션 실패인 E0033이며, 그 메시지는 규칙 자체의 문장으로 끝납니다: the extraction_model connection llm of “memory” reaches “llm”, whose component.aggrega.ai/hosting label is managed, with no credential: attach one under credential on that connection, or set unauthenticated: true in its values (“memory”의 extraction_model 연결 llm이 component.aggrega.ai/hosting 레이블이 managed인 “llm”에 자격 증명 없이 도달합니다. 그 연결의 credential 아래에 자격 증명을 첨부하거나, values에 unauthenticated: true를 설정하십시오).
양 끝이 일치하지 않을 때
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는 이 둘을 서로 다른 두 Secret으로 채웁니다. 빌드는 성공하고 여덟 개의 파일을 씁니다. 컴파일러는 주어진 각 첨부를 평가할 뿐 양 끝 사이에서 아무것도 비교하지 않습니다. 서버는 여전히 embedding-server-key를 참조하고, 저장소는 이제 다른 것을 제시합니다. dist/mismatched/helm/memory-statefulset.yaml에서:
- name: EMBEDDING_API_KEY valueFrom: secretKeyRef: name: embedding-client-key key: api-key배포하면, 서버는 그 두 Secret이 우연히 같은 키를 담고 있을 때에만 저장소의 요청을 받아들입니다.
이를 잡아내는 곳은 Release의 게시 관례 검사입니다:
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)일치하는 release에 대한 같은 검사는 아무것도 보고하지 않습니다:
aggrega lint --release release-matched.yamlconventions checked: 10 entities, 0 advisory finding(s)운영자가 연결한 release에 대해서도 아무것도 보고하지 않습니다.
이 규칙은 표준 카탈로그가 양 끝에 붙인 이름, 즉 대상의 api_key와 연결의 credential로 양 끝을 찾고, 각 끝이 쓰는 origin을 쓰인 그대로 비교합니다. 하나의 매개변수를 읽는 두 끝은 같은 것으로 비교되며, 아무것도 해석되지 않습니다. 그곳에 쓰인 것이 비밀 자체일 수 있으므로 어느 쪽도 인용하지 않습니다. managed 레이블이 붙은 대상은 판단하지 않습니다. 그런 대상의 api_key는, 선언되어 있다면, 호출자가 제시하는 키가 아니라 그 대상이 벤더에 제시하는 키이기 때문입니다. 따라서 llm으로의 연결은 세 release 어디에서도 아무것도 보고되지 않습니다. 이 결과는 조언입니다. aggrega lint는 0으로 종료하며, 양 끝이 의도적으로 다른 작업 공간은 allow_connection_credential_mismatches로 이 검사를 끌 수 있습니다. 편집기가 Release를 지정한 aggrega/lint로 데몬에 같은 질문을 하면, 코드 connection-credential-matches-target-key와 단축 코드 E0329로 같은 결과를 받습니다.
이 규칙과 규칙이 읽는 내용은
규율 규칙에 설명되어 있습니다.
결정성
세 릴리스 모두 --verify-determinism으로 빌드되며, 이 옵션은 모든
노드를 두 번 렌더링하고 출력된 바이트를 비교합니다:
aggrega build --release release-matched.yaml --verify-determinism깨끗한 트리에서 세 릴리스 중 어느 것을 다시 빌드해도 렌더링된 출력이 바이트 단위로 동일하게 재현됩니다.
응용하기
- 임베딩 서버의 두 번째 호출자를 추가합니다. 그 연결의 자격 증명도
embedding_key_secret을 읽습니다. 서버는 모든 호출자에 대해 하나의 키를 보유하므로, 두 번째 호출자도 같은 키를 제시합니다. - 임베딩 키도 저장소에서 가져옵니다.
api_key와embeddings.credential을 이름으로k8s-external-secret에 바인딩하고,embedding_key_secret을 Secret의 이름 대신 저장소 항목으로 채웁니다. 양 끝이 모두 이 파라미터를 읽으므로 함께 바뀝니다. - 키를 확인하지 않는 모델에 연결합니다. 연결에서 자격 증명을
생략합니다. 대상에
managed레이블이 붙어 있는 경우, 연결의values에unauthenticated: true를 지정해 그 사실을 밝힙니다.
여러 호출자의 연결에서 하나의 키를 공유하는 방법은 model-api-key-sharing을 참고하십시오. 호출자를 대신해 provider 키를 보유하는 라우터는 ai-agent-and-model-router를 참고하십시오. 이 모든 것의 바탕이 되는 모델은 자격 증명 모델입니다.