เซิร์ฟเวอร์โมเดลที่มีเพียงเกตเวย์ของตนเท่านั้นที่เรียกได้
เซิร์ฟเวอร์
Aggregate ระบุupstream ของcore/caller-allowlist ซึ่งedge เซิร์ฟเวอร์models และ
พื้นที่
ใครเขียนอะไร
| ไฟล์ | ผู้ | สิ่ง |
|---|---|---|
aggregate.yaml | นัก | เกตเวย์ เซิร์ฟเวอร์upstream ของ |
release.yaml | ผู้ | เนมสเปซallowlist พร้อม infra ของ |
manifest.yaml | ผู้ | Recipe ใด |
Aggregate ไม่มีcomponents.model.features อินพุตinfra ซึ่งuses ไป
สิ่งที่ตัวอย่างนี้บิลด์
| อินสแตนซ์ | Component ของ | เนมสเปซ | สิ่ง |
|---|---|---|---|
gateway | core/gateway/nginx | edge | เกตเวย์ |
model | core/ai-model/ollama | models | เซิร์ฟเวอร์llama3.1 |
เส้นuses หนึ่งupstream ของallowlist, core/caller-allowlist บน
ร่างตัวอย่าง
คุณ
เขียน
aggrega draft --example model-server-caller-allowlistจาก
cd model-server-caller-allowlistบิลด์
aggrega build --release release.yaml --auto-pullRelease ต้อง
aggrega pull --release release.yaml # resolve once, then build with no flagaggrega build --release release.yaml --auto-pull # or resolve during the buildพื้นที่.aggrega-config.yaml ระบุ
บิลด์<workspace> แทน
warning: node "model" (provider "helm"): target "helm" does not support annotation aggrega.ai/namespace on artifacts-only input and ignored it[… omitted: the resolution's summary and a total build time, which differ per run]Build completed: 6 files written to <workspace>/distคำnamespace: "models" ด้าน
กับผู้ช่วย AI
ผู้
ใช้เครื่องมือของ Aggrega เท่านั้น และอย่าสร้างโฟลเดอร์เอง หากโฟลเดอร์ Workspace ยังไม่มีโฟลเดอร์ `model-server-caller-allowlist` เรียกเครื่องมือ `draft` หนึ่งครั้งโดยตั้ง `example` เป็น `model-server-caller-allowlist` และไม่ระบุ `dir`: เครื่องมือจะเขียนตัวอย่างลงในโฟลเดอร์ `model-server-caller-allowlist` ใหม่ จากนั้นเรียกเครื่องมือ `build` โดยตั้ง `workspace_root` เป็น `model-server-caller-allowlist` ตั้ง `release` เป็น `release.yaml` ตั้ง `auto_pull` เป็น true และตั้ง `write` เป็น true บอกฉันว่าบิลด์เขียนไฟล์ใดบ้าง ไฟล์เหล่านั้นอยู่ใต้ `model-server-caller-allowlist/dist/`ทรีที่เรนเดอร์
dist/├── edge/helm/│ ├── gateway-default-service.yaml│ └── gateway-deployment.yaml└── models/helm/ ├── model--allowlist--networkpolicy.yaml ├── model-default-service.yaml ├── model-headless-service.yaml └── model-statefulset.yamlการ
สิ่งที่เข้าถึงเซิร์ฟเวอร์โมเดลได้
dist/models/helm/model--allowlist--networkpolicy.yaml ตั้งแต่ spec เป็นต้น
spec: podSelector: matchLabels: "app": "model" policyTypes: - Ingress ingress: - from: - namespaceSelector: matchLabels: "kubernetes.io/metadata.name": "models" podSelector: matchLabels: "app": "model" - namespaceSelector: matchLabels: "kubernetes.io/metadata.name": "edge" podSelector: matchLabels: "app": "gateway" - namespaceSelector: matchLabels: "kubernetes.io/metadata.name": "monitoring" podSelector: matchLabels: "app.kubernetes.io/name": "prometheus" ports: - port: 11434 protocol: "TCP"นโยบายmodels ซึ่ง
- pod ของ
เซิร์ฟเวอร์ โมเดล เอง ใน modelsเพื่อให้ เรพลิกา ของ เซิร์ฟเวอร์ เดียวกัน เข้า ถึงกัน ได้ - pod ของ
เกตเวย์ ใน เนมสเปซ edgeตัวคัด เลือก เนมสเปซ และ ตัว คัด เลือก pod อยู่ ใน รายการ เดียวกัน pod จึง ต้อง ตรง กับ ทั้ง สอง อย่าง เวิร์กโหลด ใน เนมสเปซ อื่น ที่ มี ป้าย กำกับ เดียวกัน — เช่น Aggregate เดียวกัน ที่ ปรับ ใช้ ซ้ำ ที่ อื่น — ไม่ใช่ เกตเวย์ และ จะ ไม่ ได้ รับ อนุญาต - เอเจนต์
เฝ้า คือ pod ที่ติดตาม ที่ Release ระบุ ติด ป้าย กำกับ app.kubernetes.io/name: prometheusในเนมสเปซ monitoring
pod ของapp: model สำหรับ StatefulSet ของapp: gateway สำหรับ Deployment ของ
สิ่งที่เข้าถึงไม่ได้
- เวิร์กโหลด
อื่น ในใด ก็ตาม modelsในedgeหรือใน เนมสเปซ อื่น ใด — รวม ถึง เอเจนต์ อื่น ใน monitoring - คอนโทรลเลอร์ Ingress หรือ
ไคลเอนต์ ไม่มีใดๆ นอก คลัสเตอร์ สิ่ง ใด นอก Aggregate ได้ รับ อนุญาต เว้น แต่ Release ระบุ ชื่อ และ Release นี้ ระบุ เพียง เอเจนต์ เฝ้า ติดตาม ไคลเอนต์ เข้า ถึง เซิร์ฟเวอร์ โมเดล ผ่าน เกตเวย์ ซึ่ง เป็นการ เชื่อม ต่อ ที่ Aggregate ประกาศ - พอร์ต
อื่น ใด นอกจาก 11434
นโยบาย
สิ่งที่บิลด์ไม่อาจรู้
กฎcontrol_plane_present: true บน
ขีด
- นโยบาย
รวม ที่กัน ใด มี นโยบาย อื่น ใน คลัสเตอร์ เลือก pod ชุด เดียวกัน การ เชื่อม ต่อ ที่ นโยบาย ใด นโยบาย หนึ่ง อนุญาต ก็ได้ รับ อนุญาต - การ
แนบ การนี้ ไม่ ได้ จำกัด เกตเวย์ แนบ นี้ ปกป้อง เซิร์ฟเวอร์ โมเดล แนบ Feature กับ รายการ ของ เกตเวย์ ใน Release ด้วย เพื่อ จำกัด ว่า ใคร เข้า ถึง เกตเวย์ ได้ และ ระบุ ไคลเอนต์ ที่ เกตเวย์ ให้ บริการ ไว้ ที่ นั่น - ทราฟฟิก
ขา เซิร์ฟเวอร์ออก ไม่ ถูก แตะ ต้อง โมเดล ยัง เข้า ถึง รีจิสทรี ที่ pull น้ำ หนัก โมเดล มา ได้ และ หา ค่า ชื่อ เหมือน เดิม
อะไรที่ทำให้บิลด์หยุด
แต่ละ
-
ไม่
ได้ ลบยืนยัน ข้อ กำหนด เบื้อง ต้น control_plane_present: trueออกจาก Release: [… omitted: what resolving the lockfile prints, the same halt among it, and the halt's heading, the template position and the assertion's own source]error calling fail: assertion failed: core/caller-allowlist attachment "allowlist" on "model" writes a network policy, which restricts connections only where the cluster's network plugin enforces network policy; once the target cluster's plugin does, affirm it by setting infra.control_plane_present to true on this attachment in the Release -
ผู้
เรียก ลบที่ เวิร์กโหลด ถูก ส่ง ออก ไป โดย ไม่ อยู่ ใน เนมสเปซ ใด เลย คำ อธิบาย ประกอบ aggrega.ai/namespaceออกจาก แนว เขต edgeแล้ว Deployment ของเกตเวย์ จะ ถูก ส่ง ออก โดย ไม่มี เนมสเปซ: [… omitted: what resolving the lockfile prints, the same halt among it, and the halt's heading, the artifact being rendered, the template position and the template's own source]error calling fail: core/caller-allowlist attachment "allowlist" on "model": "gateway" connects to "model" through its "upstream" socket, but the Deployment "gateway" it renders is emitted into no namespace, so the policy cannot name where its pods run; set aggrega.ai/namespace on the boundary holding "gateway", or on its own entry, in the Release, or have the manifest that carries it write one -
เวิร์กโหลด
ของ ด้วยเซิร์ฟเวอร์ โมเดล ถูก ส่ง ออก ไป โดย ไม่ อยู่ ใน เนมสเปซ ใด เลย เหตุผล เดียวกัน นโยบาย เลือก pod ใน เนมสเปซ ของ ตนเอง เท่านั้น -
เวิร์กโหลด
ของ — เช่น Job ของ chart ที่ฝ่าย ใด ฝ่าย หนึ่ง ที่ ไม่ เขียน ตัว คัด เลือก ของ คอนโทรลเลอร์ และ ไม่มี ป้าย กำกับ ตัว ตน ใด ที่ บิลด์ ประทับ บน pod พึ่ง ตัว คัด เลือก ที่ คลัสเตอร์ สร้าง ขึ้น การ เลือก ด้วย ทุก ป้าย กำกับ ที่ มี จะ หยุด ตรง กับ pod ของ เวิร์กโหลด นั้น ทันที ที่ ป้าย กำกับ เวอร์ชัน เปลี่ยน ครั้ง แรก บิลด์ จึง หยุด แทน -
ผู้
เรียก หรือ — รายการเซิร์ฟเวอร์ โมเดล ที่ การ เรนเดอร์ ไม่ ส่ง ออก pod ที่ ทำให้ เป็น รูป ธรรม ด้วย custom resource ซึ่ง คอนโทรลเลอร์ สร้าง pod ภาย หลัง หรือ เข้า ถึงที่ ที่ อยู่ นอก คลัสเตอร์ ส่วน ประกอบ เช่น นี้ ระบุ ชื่อ ใน นโยบาย ไม่ ได้ บิลด์ จึง หยุด แทนที่ จะ เขียน นโยบาย ที่ จะ ปฏิเสธ ส่วน ประกอบ นั้น หรือ ไม่ เลือก อะไร เลย -
ต้นทาง
ใน admitted_sourcesที่ระบุ ทั้ง ช่วง ที่ อยู่ และ pod หรือ ไม่ ระบุ เลย ทั้ง สอง อย่าง
ตำแหน่งที่คอมไพเลอร์ไม่ตีความ
คอมไพเลอร์
การปรับแต่งตัวอย่างนี้
- อนุญาต
คอนโทรลเลอร์ Ingress เพิ่มรายการ ใน admitted_sourcesพร้อมเนมสเปซ และ ป้าย กำกับ ของ pod — ทั้ง สอง อยู่ ใน รายการ เดียว เพื่อ ให้ เฉพาะ pod เหล่า นั้น ใน เนมสเปซ นั้น ได้ รับ อนุญาต - อนุญาต
ช่วง เพิ่มที่ อยู่ รายการ ที่ มี cidrเช่น10.20.0.0/16 - ผู้
เรียก เพิ่มราย ที่ สอง เส้น เชื่อม usesจากผู้ เรียก นั้น ไป ยัง เซิร์ฟเวอร์ โมเดล ใน Aggregate และ วาง ไว้ ใน เนมสเปซ ที่ Release ประกาศ บิลด์ ครั้ง ถัด ไป จะ อนุญาต ผู้ เรียก นั้น โดย ไม่ ต้อง แก้ การ แนบ - Compose Feature ไม่
ได้ ทำให้ เป็น รูป ธรรม ที่ นั่น สแตก Compose วาง ทุก บริการ ของ กลุ่ม บน เครือข่าย เดียว และ การ กำหนด ค่า ของ บริการ หนึ่ง ไม่ อาจ ย้าย อีก บริการ ออก จาก เครือข่าย นั้น Release ที่ ผูก Feature นี้ บน Compose จึง หยุด เพราะ ไม่มี การ ทำให้ เป็น รูป ธรรม