การกำหนดเส้นทางข้ามแนวเขต
หน้า
aggrega draft --example cross-boundary-networkingจาก
cd cross-boundary-networkingaggrega pull --release release-compose.yaml --catalog catalog-composeaggrega build --release release-compose.yaml --catalog catalog-composeaggrega pull --release release-helm.yaml --catalog catalog-helmaggrega build --release release-helm.yaml --catalog catalog-helmเมื่อhost ที่injectMapping ใน entities/featurerecipe.md คำprovides / inject / uses ใน vocabulary/topology-triad.md
ผู้ดำเนินการแนบ Feature เข้ากับผู้เรียก
ในADMINER_DEFAULT_SERVER ผู้core/k8s-dns-resolver ของrelease-helm.yaml โดย
spec: boundaries: frontend: directory: frontend annotations: aggrega.ai/namespace: "frontend" components: adminer: features: dns-resolver: type: core/k8s-dns-resolver:1.0.0 infra: target_var: ADMINER_DEFAULT_SERVER backend: directory: backend annotations: aggrega.ai/namespace: "backend"FeatureRecipe เขียนตัวแปรใหม่ก่อนที่ผู้เรียกจะเรนเดอร์
Manifest ผูก Feature เข้าhelm/k8s-dns-resolver injectMapping ของ FeatureRecipe นั้นdefault เมื่อ
spec: capability: helm implements: core/k8s-dns-resolver:1.0.0 injectMapping: | {{- $base_host := optional .context.inject.env .infra.target_var "" }} {{- $target_edge := dict }} {{- range $alias, $edge := .context.uses }} {{- if hasKey $edge.inject.env $.infra.target_var }} {{- $target_edge = $edge }} {{- end }} {{- end }} {{- $ns := "default" }} {{- if $target_edge.annotations }} {{- $raw := optional (optional (default dict $target_edge.annotations) "release" dict) "aggrega.ai/namespace" (optional (optional (default dict $target_edge.annotations) "aggregate" dict) "aggrega.ai/namespace" "") }} {{- if $raw }}{{- $ns = $raw }}{{- end }} {{- end }} {{- if and $target_edge $base_host }} env: "{{ .infra.target_var }}": "{{ $base_host | replace "\\" "\\\\" | replace "\"" "\\\"" }}.{{ $ns }}" {{- end }}ดังdb-default.backend เขียนhost ที่target_var ที่core/compose-bridge ของ
ขั้นตอนไปป์ไลน์ จากฝั่งของปลั๊กอิน
injectMapping คือpipeline: ของwith: ซึ่ง