Add TrafficDistribution
field to describe service output
#1736
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
Motivation:
Kubernetes 1.31 introduced the
TrafficDistribution
field within the Service specification (spec.trafficDistribution
). This field allows users to specify preferences for how traffic should be distributed among endpoints, such as thePreferClose
option.The official documentation describing this feature is here:
https://kubernetes.io/docs/reference/networking/virtual-ips/#traffic-distribution
Currently,
kubectl describe service <service-name>
does not display this field, even if it is set on the Service object.Problem:
Users who configure
spec.trafficDistribution
on their Services lack a straightforward way to view or verify the applied setting using the standardkubectl describe
command. They must resort to fetching the full YAML/JSON (kubectl get svc <service-name> -o yaml
) and manually inspecting thespec
.Proposed Solution:
Modify the output of
kubectl describe service
to include theTrafficDistribution
field when it is present and non-empty in the Servicespec
.The output could look similar to how other optional spec fields like
ExternalTrafficPolicy
orInternalTrafficPolicy
are displayed, for example:...
Session Affinity: None
External Traffic Policy: Cluster
Internal Traffic Policy: Cluster
Traffic Distribution: PreferClose # <-- Add this line when field is set
HealthCheck NodePort:
Events:
...
Benefits:
describe
output.kubectl describe
with the API capabilities introduced in recent Kubernetes versions.The text was updated successfully, but these errors were encountered: