Skip to content

services: add trafficDistribution field in service.spec #2581

Open
@BBBmau

Description

@BBBmau

Description

v1.31 graduated trafficDistributions field from alpha to beta with the feature gate being set to enabled by default.

k8s PR: kubernetes/enhancements#4444
Service Documentation: https://kubernetes.io/docs/concepts/services-networking/service/#traffic-distribution

The API docs mentions that this is in alpha, this is wrong and an issue has been raised on the k8s website repo: kubernetes/website#47776

changes would needed to be applied with structure_service_spec.go:

func flattenServiceSpec(in v1.ServiceSpec) []interface{} {
att := make(map[string]interface{})
if len(in.Ports) > 0 {
att["port"] = flattenServicePort(in.Ports)
}
if len(in.Selector) > 0 {
att["selector"] = in.Selector
}
if in.ClusterIP != "" {
att["cluster_ip"] = in.ClusterIP
}
if len(in.ClusterIPs) > 0 {
att["cluster_ips"] = in.ClusterIPs
}

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions