<#7323 Inject INTERNAL_APP_ENDPOINT_PATTERN into K...
# flyte-github
a
#7323 Inject INTERNAL_APP_ENDPOINT_PATTERN into KService pods for in-cluster app discovery Pull request opened by AdilFayyaz Why are the changes needed? When multiple Flyte apps run in the same cluster (e.g. a Gradio app calling a vLLM model-serving app), apps need to call each other via the internal Kubernetes service URL (*.flyte.svc.cluster.local). Previouly the
INTERNAL_APP_ENDPOINT_PATTERN
env var — which the Flyte SDK's
AppEndpoint
uses to resolve internal URLs — was never injected into KService pods. This meant
AppEndpoint(app_name="...")
had no pattern to resolve against, and developers had to manually construct and hardcode the full internal cluster URL. What changes were proposed in this pull request? • Inject
INTERNAL_APP_ENDPOINT_PATTERN
into every KService container at deploy time in buildKService. The value is a URL template with an {app_fqdn} placeholder that the SDK substitutes at runtime with the target app's name:
http://{app_fqdn}-{project}-{domain}.flyte.svc.cluster.local
• The project and domain are baked in as a suffix to match Flyte's KService naming convention ({name}-{project}-{domain}). When the SDK resolves AppEndpoint(app_name="gemma4-26b") in project flytesnacks / domain development, it produces:
http://gemma4-26b-flytesnacks-development.flyte.svc.cluster.local
• No auth is required on this path (bypasses ingress), and traffic stays in-cluster Code Changes •
app/config/config.go
— adds
NamespacedNameSuffixTemplate
field to
InternalAppConfig
•
app/internal/k8s/app_client.go
— injects
INTERNAL_APP_ENDPOINT_PATTERN
in
buildKService
How was this patch tested? Verified using the
app_calling_app
SDK example (
examples/apps/app_calling_app/app.py
). After this change, hitting
app2-calls-app1.../greeting/world
correctly proxies through to app1 via the internal cluster URL This is important to improve the readability of release notes. Setup process Screenshots Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. Related PRs Stack If you do use
git town
to manage PR Stacks, the stack relevant to this PR will show below. Otherwise, you can ignore this section. Docs link flyteorg/flyte