Skip to content

Reorder manifests in Port definitions example to show Service before Pod in Service page #53920

@kfess

Description

@kfess

The example in the Port definitions section shows the Pod manifest before the Service manifest.
While both orders work, the Discovering services section later mentions that creating the Service before Pods helps with environment variable setup.

Note:
When you have a Pod that needs to access a Service, and you are using the environment variable method to publish the port and cluster IP to the client Pods, you must create the Service before the client Pods come into existence. Otherwise, those client Pods won't have their environment variables populated.
If you only use DNS to discover the cluster IP for a Service, you don't need to worry about this ordering issue.

It would be more consistent to show the Service first in this example, matching the recommendation given later in the page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    language/enIssues or PRs related to English languageneeds-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.priority/backlogHigher priority than priority/awaiting-more-evidence.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions