| title | AlbMeshedHttpEntrypoint |
|---|---|
| description | Bundled ALB Ingress + Istio Gateway + VirtualService + AuthorizationPolicy for one workload, with consistent SA-principal linkage automatically wired from the IstioFoundation ref. Full reference at M5. |
@hulumi/k8s-baseline.AlbMeshedHttpEntrypoint — emits four resources for one workload's ingress:
- K8s
Ingressin the gateway namespace — ALB annotations:target-type=ip,scheme,healthcheck-port=15021,healthcheck-path=/healthz/ready,group.name. Backend points at the istio-ingressgateway Service. - Istio
Gatewayin the gateway namespace — selector matches gateway pods; captures the host on port 80. - Istio
VirtualServicein the workload namespace —spec.gatewaysuses cross-namespace form (<gateway-ns>/<gateway-name>). - Istio
AuthorizationPolicyin the workload namespace —from.principalscomputed frommesh.ingressGatewayServiceAccountName(NEVER from a consumer string).
mTLS: "STRICT" (default) also emits a workload-namespace PeerAuthentication.
allowFromGateway: false requires explicit acknowledgeNoAuthZ: true AND non-empty extraPrincipals — the no-AuthZ posture is opt-in friction-y by design.
The AuthorizationPolicy's selector.matchLabels MUST be either explicitly supplied via workloadSelector: { matchLabels: {...} } (preferred) OR the consumer must opt in to the legacy inferred selector via acknowledgeInferredSelector: true. Constructing without either fails fast with a migration message.
// Preferred — explicit selector
new AlbMeshedHttpEntrypoint("api", {
// ...,
workloadSelector: { matchLabels: { "app.kubernetes.io/name": "api", tier: "frontend" } },
});
// Legacy — inferred from `serviceRef.name` (still works, requires acknowledgement)
new AlbMeshedHttpEntrypoint("api", {
// ...,
acknowledgeInferredSelector: true,
});workloadSelector.matchLabels is bounded at 32 labels. authorizationPolicy.extraPrincipals is bounded at 64 entries.
scheme: "internal" is the default. When scheme: "internet-facing", BOTH of the following are required (the constructor fails fast otherwise):
alb.certificateArn— ACM cert for HTTPS termination.alb.publicJustification— plain-language reason (≥ 8 chars) explaining why this workload is on the public internet. Recorded as thehulumi.dev/public-justificationannotation on the emitted Ingress for audit.
new AlbMeshedHttpEntrypoint("public-api", {
// ...,
scheme: "internet-facing",
workloadSelector: { matchLabels: { app: "public-api" } },
alb: {
certificateArn: "arn:aws:acm:us-east-1:111:certificate/abc",
publicJustification: "Public marketing site; HTTPS-only; no PII handled.",
},
});Full reference doc lands at M5. Source: packages/k8s-baseline/src/alb-meshed-http-entrypoint.ts.