ใบรับรอง webhook ของคุณเอง: การละ Secret ที่ chart สร้างขึ้นออก
นี่omits: ของ Recipe ซึ่ง Recipes ส่วน
พื้นที่helm/envoy-ai-gateway-operator ในomits: ของ Recipe ละ Secret นั้น
สิ่งที่ตัวอย่างนี้บิลด์
ส่วนai-controller ของ core/gateway/envoy-ai-gateway-operator ที่envoy-ai-gateway-system และ
| Release | Manifest ของ Release นั้น | โหมด | ผล |
|---|---|---|---|
release-cert-manager.yaml | helm/envoy-ai-gateway-operator จาก | cert-manager | บิลด์ |
release-own-certificate.yaml | helm/envoy-ai-gateway-operator จาก | Secret ai-gateway-webhook-tls | บิลด์ |
release-negative-without-omits.yaml | helm/envoy-ai-gateway-operator-without-omits จาก | Secret ai-gateway-webhook-tls | หยุดE0058 เมื่อ--verify-determinism |
release-negative-stale-omits.yaml | helm/envoy-ai-gateway-operator-stale-omits จาก | Secret ai-gateway-webhook-tls | หยุดE0334 |
Recipes สองcatalog/ ของomits: และ
สองวิธีให้ใบรับรองแก่ webhook
คอนโทรลเลอร์infra เพียงwebhook_tls_secret:
- ไม่
ตั้ง chart เรนเดอร์ค่า ซึ่ง เป็น ค่า เริ่ม ต้น Certificateของ cert-manager สำหรับชื่อ Service ของ คอนโทรลเลอร์ และ Issuerแบบลง ลาย เซ็น ด้วย ตนเอง ที่ ลง ลาย เซ็น ให้ ใบรับ รอง นั้น ดัง นั้น cert-manager ต้อง รัน อยู่ ใน คลัสเตอร์ แล้ว - ตั้ง
ค่า webhook ให้บริการ ใบรับ รอง ใน Secret ที่ คีย์ นั้น ระบุ ชื่อ ซึ่ง ผู้ ที่ ปรับ ใช้ สร้าง ไว้ ล่วง หน้า ใน เนมสเปซ ของ คอนโทรลเลอร์ โดย มี tls.crt,tls.keyและca.crtไม่มีการ เรนเดอร์ CertificateและIssuerและไม่ ต้อง ใช้ cert-manager: เมื่อ คอนโทรลเลอร์ เริ่ม ทำงาน จะ เขียน ca.crtของ Secret ลงใน การ กำหนด ค่า webhook เป็น CA bundle ที่ API server ใช้ ตรวจ webhook
release-own-certificate.yaml ตั้ง
components: ai-controller: annotations: aggrega.ai/namespace: envoy-ai-gateway-system infra: webhook_tls_secret: ai-gateway-webhook-tlsสิ่งที่ chart เรนเดอร์ในโหมดใบรับรองของตนเอง
เมื่อ/certs และ
chart มา
# helm/envoy-ai-gateway-operator:1.0.0, its omits: field omits: - kind: Secret name: "{{ .infra.webhook_tls_secret }}" when: '{{ ne (optional .infra "webhook_tls_secret" "") "" }}'kindและnameระบุเอกสาร :ตาม ที่ chart เรนเดอร์ Secretที่metadata.nameคือชื่อ ที่ Release ตั้ง เทมเพลต nameอ่านคีย์ infraเดียวกับ ที่ chart ได้ รับ ดัง นั้น รายการ จึง ระบุ Secret ที่ สร้าง ขึ้น ไม่ ว่า Release จะ เรียก ว่า อะไร whenทำให้รายการ ในมี ผล เฉพาะ ใน โหมด นี้ โหมด cert-manager chart ไม่ เรนเดอร์ Secret ดัง กล่าว เงื่อนไข เป็น เท็จ ที่ นั่น และ รายการ ที่ when:เป็นเท็จ ถูก ทิ้ง ก่อน ตรวจ สอบ สิ่ง ใด Recipe เดียว ใช้ได้ กับ ทั้ง สอง โหมด
ส่วน
ร่างตัวอย่าง
คุณ
เขียน
aggrega draft --example ai-gateway-own-webhook-certificateจาก
cd ai-gateway-own-webhook-certificateบิลด์
aggrega build --release release-cert-manager.yaml --auto-pullaggrega build --release release-own-certificate.yaml --auto-pullaggrega build --release release-negative-without-omits.yaml --auto-pull --verify-determinism # halts; exits 1aggrega build --release release-negative-stale-omits.yaml --auto-pull # halts; exits 1.aggrega-config.yaml ระบุ catalog/ ของhub.aggrega.ai ซึ่งaggrega-catalog ของ checkout นั้น--catalog แล้ว
--auto-pull เติม
กับผู้ช่วย AI
ผู้
ใช้เฉพาะเครื่องมือของ Aggrega และอย่าสร้างโฟลเดอร์เอง หากโฟลเดอร์ Workspace ยังไม่มีโฟลเดอร์ `ai-gateway-own-webhook-certificate` เรียกเครื่องมือ `draft` หนึ่งครั้งโดยตั้ง `example` เป็น `ai-gateway-own-webhook-certificate` และไม่ใส่ `dir`: เครื่องมือจะเขียนตัวอย่างลงในโฟลเดอร์ `ai-gateway-own-webhook-certificate` ใหม่ จากนั้นเรียกเครื่องมือ `build` หนึ่งครั้งต่อ Release แต่ละรายการตามลำดับนี้ คือ `release-cert-manager.yaml` แล้ว `release-own-certificate.yaml` โดยทุกครั้งตั้ง `workspace_root` เป็น `ai-gateway-own-webhook-certificate` ตั้ง `release` เป็นไฟล์นั้น ตั้ง `auto_pull` เป็น true และตั้ง `write` เป็น true จากนั้นเรียกเครื่องมือ `cli-build` ซึ่งรัน `aggrega build` และรับแฟล็ก `--verify-determinism` โดยตั้ง `workspace_root` เป็น `ai-gateway-own-webhook-certificate` ตั้ง `release` เป็น `release-negative-without-omits.yaml` ตั้ง `auto_pull` เป็น true และตั้ง `verify_determinism` เป็น true: บิลด์นี้ตั้งใจให้ถูกปฏิเสธ จึงอ่านการปฏิเสธนั้นให้ฉัน จากนั้นเรียกเครื่องมือ `build` แบบเดียวกับสองบิลด์แรกโดยตั้ง `release` เป็น `release-negative-stale-omits.yaml`: บิลด์นี้ตั้งใจให้ถูกปฏิเสธเช่นกัน จึงอ่านการปฏิเสธนั้นให้ฉันด้วย แจ้งฉันว่าแต่ละบิลด์เขียนไฟล์ใดบ้าง ไฟล์เหล่านั้นอยู่ใต้ `ai-gateway-own-webhook-certificate/dist/`โหมดใบรับรองทั้งสองตามที่เรนเดอร์
release-cert-manager.yaml ที่--auto-pull พิมพ์<workspace> แทน
Pull complete: release-cert-manager.lock (entities=5, source_artifacts=1, external_inputs=0)[… omitted: the total build time, which differs per run]Build completed: 16 files written to <workspace>/distและ ls dist/helm แสดง
ai-controllerai-controller-certificate-envoy-ai-gateway-system-self-signed-cert-for-mutating-webhook.yamlai-controller-clusterrole-ai-controller-envoy-ai-gateway-system.yamlai-controller-clusterrole-envoy-ai-gateway-inference-pool-reader-envoy-ai-gateway-system.yamlai-controller-clusterrolebinding-ai-controller-envoy-ai-gateway-system.yamlai-controller-clusterrolebinding-envoy-ai-gateway-inference-pool-reader-binding-envoy-ai-gateway-system.yamlai-controller-deployment-envoy-ai-gateway-system-ai-controller.yamlai-controller-issuer-envoy-ai-gateway-system-self-signed-issuer-for-mutating-webhook.yamlai-controller-mutatingwebhookconfiguration-envoy-ai-gateway-gateway-pod-mutator-envoy-ai-gateway-system.yamlai-controller-service-envoy-ai-gateway-system-ai-controller.yamlai-controller-serviceaccount-envoy-ai-gateway-system-ai-controller.yamlไดเรกทอรี ai-controller เก็บrelease-own-certificate.yaml ที่
Pull complete: release-own-certificate.lock (entities=5, source_artifacts=1, external_inputs=0)[… omitted: the total build time, which differs per run]Build completed: 14 files written to <workspace>/distและ ls dist/helm แสดง
ai-controllerai-controller-clusterrole-ai-controller-envoy-ai-gateway-system.yamlai-controller-clusterrole-envoy-ai-gateway-inference-pool-reader-envoy-ai-gateway-system.yamlai-controller-clusterrolebinding-ai-controller-envoy-ai-gateway-system.yamlai-controller-clusterrolebinding-envoy-ai-gateway-inference-pool-reader-binding-envoy-ai-gateway-system.yamlai-controller-deployment-envoy-ai-gateway-system-ai-controller.yamlai-controller-mutatingwebhookconfiguration-envoy-ai-gateway-gateway-pod-mutator-envoy-ai-gateway-system.yamlai-controller-service-envoy-ai-gateway-system-ai-controller.yamlai-controller-serviceaccount-envoy-ai-gateway-system-ai-controller.yamlทรีCertificate และ Issuer และSecret ส่วนCertificate และIssuer เพราะ chart ไม่Secret เพราะ
[… omitted: the chart's licence header, four comment lines]apiVersion: apps/v1kind: Deploymentmetadata: name: ai-controller namespace: envoy-ai-gateway-system [… omitted: the labels and annotations every rendered document carries]spec: [… omitted: the replica count, the selector, and the pod template's labels, service account, host-network setting and security settings] containers: - name: ai-gateway-helm [… omitted: the container's security settings, its image and pull policy, and its ports] args: [… omitted: the controller's logging, external-processor, gateway-namespace and endpoint arguments] - --tlsCertDir=/certs - --tlsCertName=tls.crt - --tlsKeyName=tls.key [… omitted: the controller's webhook-port, leader-election, prefix, cache, namespace, quota and session-encryption arguments] [… omitted: the probes, the environment and the resources] volumeMounts: - mountPath: /certs name: certs readOnly: true volumes: - name: certs secret: secretName: ai-gateway-webhook-tlsคอนโทรลเลอร์/certs ซึ่งcerts ที่ai-gateway-webhook-tls ชื่อ
ไบต์เดียวกันจากบิลด์หนึ่งไปอีกบิลด์
เมื่อ--verify-determinism แล้ว release-own-certificate.yaml จะ
[… omitted: the total build time, which differs per run]Build completed: 14 files written to <workspace>/dist--verify-determinism เรนเดอร์
ไม่มีรายการ: บิลด์ที่ตรวจความกำหนดแน่นอนจะหยุด
release-negative-without-omits.yaml คือ Release แบบmanifest-without-omits.yaml ซึ่งomits: เมื่อ--verify-determinism จะ
[… omitted: the pull's lines][TRANSLATION_ERROR E0058] instance ai-controller rendering node "ai-controller" caused by: wasmengine: node "ai-controller" (provider "helm"): two renders of identical input produced different output: provider render is not deterministicบิลด์1 การ
เมื่อ
apiVersion: v1kind: Secretmetadata: name: ai-gateway-webhook-tls namespace: envoy-ai-gateway-system [… omitted: the labels and annotations every rendered document carries]data: [… omitted: the three base64-encoded entries ca.crt, tls.crt and tls.key]บิลด์
การomits: เมื่อ
รายการที่ไม่ตรงกับสิ่งใด
release-negative-stale-omits.yaml คือ Release แบบmanifest-stale-omits.yaml ซึ่ง
# catalog/recipe/helm/envoy-ai-gateway-operator-stale-omits/1.0.0/recipe.yaml, its omits: field omits: - kind: Secret name: "{{ .context.rendered_name }}-webhook-tls" when: '{{ ne (optional .infra "webhook_tls_secret" "") "" }}'บิลด์
[… omitted: the pull's lines][TRANSLATION_ERROR E0334] instance ai-controller rendering node "ai-controller" caused by: [CATALOG_ERROR] instance ai-controller an omits entry left out nothing the source rendered (node "ai-controller", provider "provider/helm:0.8.8-75-g9e6ef4e0", "envoy-ai-gateway-operator-stale-omits" omits[0], kind "Secret", name "ai-controller-webhook-tls"). correct the entry so it names something the source renders, or remove it; a source upgrade that renamed or removed it is the usual causeผู้
บิลด์1 และomits: โดย0 แล้วwhen: เป็นai-controller-webhook-tls ขณะai-gateway-webhook-tls และ
รายการrelease-negative-without-omits.yaml ทำ
E0334 อยู่omit-matched-nothing และomits:
การตรวจสอบทุกบิลด์
การaggrega draft --example เขียน
./check.shcheck.sh บิลด์ Releases ทั้ง./build-release.sh และ--verify-determinism: ทั้งCertificate และ Issuer และSecret ในcerts ของ Deployment ของai-gateway-webhook-tls Release แบบ
RELEASE EXIT EXPECTED VERDICT------------------------------------------------------------------------------------------------release-cert-manager.yaml 0/0 pass OK: byte-identical twice; Certificate=1 Issuer=1 Secret=0release-own-certificate.yaml 0/0 pass OK: byte-identical twice; Certificate=0 Issuer=0 Secret=0; certs volume: ai-gateway-webhook-tlsrelease-negative-without-omits.yaml 1 halt OK: E0058, the expected sentencerelease-negative-stale-omits.yaml 1 halt OK: E0334, the expected sentence, naming "envoy-ai-gateway-operator-stale-omits" omits[0]
check: every build ended as expected.ต้อง./build-release.sh หาAGGREGA_BIN เลือก-- ส่งdist/ อยู่
ตำแหน่งที่คอมไพเลอร์ไม่ตีความ
คอมไพเลอร์ai-gateway-webhook-tls ใน
ไฟล์
aggregate.yaml— คอนโทรลเลอร์เกตเวย์ AI ซึ่ง เป็น ส่วน ประกอบ เพียง รายการ เดียว เหมือน กัน สำหรับ ทุก Release manifest.yaml— ผูกคอนโทรลเลอร์ กับ Recipe ของ ไลบรารี มาตรฐาน ใช้ ร่วม กัน โดย Releases ที่ สำเร็จ ทั้ง สอง รายการ manifest-without-omits.yaml,manifest-stale-omits.yaml— ผูกคอนโทรลเลอร์ กับ Recipes สำหรับ การ สอน รายการ ใด รายการ หนึ่ง จาก สอง รายการ release-cert-manager.yaml,release-own-certificate.yaml— สองโหมด ใบรับ รอง release-negative-without-omits.yaml,release-negative-stale-omits.yaml— โหมดใบรับ รอง ของ ตนเอง ผ่าน Recipe สำหรับ การ สอน แต่ละ รายการ ทั้ง สอง รายการ หยุด catalog/recipe/helm/envoy-ai-gateway-operator-without-omits/1.0.0/— Recipe สำหรับการ สอน ที่ ไม่มี รายการ omits:และentity.lockที่ปัก หมุด chart ของ Recipe นั้น catalog/recipe/helm/envoy-ai-gateway-operator-stale-omits/1.0.0/— Recipe สำหรับการ สอน ที่ รายการ ไม่ ตรง กับ สิ่ง ใด และ entity.lockของ Recipe นั้น.aggrega-config.yaml— สแตกการ ค้นหา แค็ตตาล็อก และ รีจิสทรี build-release.sh— บิลด์ Release หนึ่งรายการ พร้อม พิมพ์ คำ สั่ง aggrega buildที่เทียบ เท่า ออก มา check.sh— บิลด์ทั้ง สี่ รายการ และ ตรวจ ผล ของ แต่ละ รายการ