Merge pull request #129886 from danwinship/endpointslice-api-notes

Try to clarify EndpointSlice semantics some more
This commit is contained in:
Kubernetes Prow Robot 2025-03-12 21:19:53 -07:00 committed by GitHub
commit 92d7e55abd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 100 additions and 86 deletions

View File

@ -12187,7 +12187,7 @@
"description": "Endpoint represents a single logical \"backend\" implementing a service.",
"properties": {
"addresses": {
"description": "addresses of this endpoint. The contents of this field are interpreted according to the corresponding EndpointSlice addressType field. Consumers must handle different types of addresses in the context of their own capabilities. This must contain at least one address but no more than 100. These are all assumed to be fungible and clients may choose to only use the first element. Refer to: https://issue.k8s.io/106267",
"description": "addresses of this endpoint. For EndpointSlices of addressType \"IPv4\" or \"IPv6\", the values are IP addresses in canonical form. The syntax and semantics of other addressType values are not defined. This must contain at least one address but no more than 100. EndpointSlices generated by the EndpointSlice controller will always have exactly 1 address. No semantics are defined for additional addresses beyond the first, and kube-proxy does not look at them.",
"items": {
"type": "string"
},
@ -12235,15 +12235,15 @@
"description": "EndpointConditions represents the current condition of an endpoint.",
"properties": {
"ready": {
"description": "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready. For compatibility reasons, ready should never be \"true\" for terminating endpoints, except when the normal readiness behavior is being explicitly overridden, for example when the associated Service has set the publishNotReadyAddresses flag.",
"description": "ready indicates that this endpoint is ready to receive traffic, according to whatever system is managing the endpoint. A nil value should be interpreted as \"true\". In general, an endpoint should be marked ready if it is serving and not terminating, though this can be overridden in some cases, such as when the associated Service has set the publishNotReadyAddresses flag.",
"type": "boolean"
},
"serving": {
"description": "serving is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition.",
"description": "serving indicates that this endpoint is able to receive traffic, according to whatever system is managing the endpoint. For endpoints backed by pods, the EndpointSlice controller will mark the endpoint as serving if the pod's Ready condition is True. A nil value should be interpreted as \"true\".",
"type": "boolean"
},
"terminating": {
"description": "terminating indicates that this endpoint is terminating. A nil value indicates an unknown state. Consumers should interpret this unknown state to mean that the endpoint is not terminating.",
"description": "terminating indicates that this endpoint is terminating. A nil value should be interpreted as \"false\".",
"type": "boolean"
}
},
@ -12275,7 +12275,7 @@
"type": "string"
},
"port": {
"description": "port represents the port number of the endpoint. If this is not specified, ports are not restricted and must be interpreted in the context of the specific consumer.",
"description": "port represents the port number of the endpoint. If the EndpointSlice is derived from a Kubernetes service, this must be set to the service's target port. EndpointSlices used for other purposes may have a nil port.",
"format": "int32",
"type": "integer"
},
@ -12288,10 +12288,10 @@
"x-kubernetes-map-type": "atomic"
},
"io.k8s.api.discovery.v1.EndpointSlice": {
"description": "EndpointSlice represents a subset of the endpoints that implement a service. For a given service there may be multiple EndpointSlice objects, selected by labels, which must be joined to produce the full set of endpoints.",
"description": "EndpointSlice represents a set of service endpoints. Most EndpointSlices are created by the EndpointSlice controller to represent the Pods selected by Service objects. For a given service there may be multiple EndpointSlice objects which must be joined to produce the full set of endpoints; you can find all of the slices for a given service by listing EndpointSlices in the service's namespace whose `kubernetes.io/service-name` label contains the service's name.",
"properties": {
"addressType": {
"description": "addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.",
"description": "addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name. (Deprecated) The EndpointSlice controller only generates, and kube-proxy only processes, slices of addressType \"IPv4\" and \"IPv6\". No semantics are defined for the \"FQDN\" type.",
"type": "string"
},
"apiVersion": {
@ -12315,7 +12315,7 @@
"description": "Standard object's metadata."
},
"ports": {
"description": "ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates \"all ports\". Each slice may include a maximum of 100 ports.",
"description": "ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. Each slice may include a maximum of 100 ports. Services always have at least 1 port, so EndpointSlices generated by the EndpointSlice controller will likewise always have at least 1 port. EndpointSlices used for other purposes may have an empty ports list.",
"items": {
"$ref": "#/definitions/io.k8s.api.discovery.v1.EndpointPort"
},

View File

@ -40,7 +40,7 @@
"description": "Endpoint represents a single logical \"backend\" implementing a service.",
"properties": {
"addresses": {
"description": "addresses of this endpoint. The contents of this field are interpreted according to the corresponding EndpointSlice addressType field. Consumers must handle different types of addresses in the context of their own capabilities. This must contain at least one address but no more than 100. These are all assumed to be fungible and clients may choose to only use the first element. Refer to: https://issue.k8s.io/106267",
"description": "addresses of this endpoint. For EndpointSlices of addressType \"IPv4\" or \"IPv6\", the values are IP addresses in canonical form. The syntax and semantics of other addressType values are not defined. This must contain at least one address but no more than 100. EndpointSlices generated by the EndpointSlice controller will always have exactly 1 address. No semantics are defined for additional addresses beyond the first, and kube-proxy does not look at them.",
"items": {
"default": "",
"type": "string"
@ -103,15 +103,15 @@
"description": "EndpointConditions represents the current condition of an endpoint.",
"properties": {
"ready": {
"description": "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready. For compatibility reasons, ready should never be \"true\" for terminating endpoints, except when the normal readiness behavior is being explicitly overridden, for example when the associated Service has set the publishNotReadyAddresses flag.",
"description": "ready indicates that this endpoint is ready to receive traffic, according to whatever system is managing the endpoint. A nil value should be interpreted as \"true\". In general, an endpoint should be marked ready if it is serving and not terminating, though this can be overridden in some cases, such as when the associated Service has set the publishNotReadyAddresses flag.",
"type": "boolean"
},
"serving": {
"description": "serving is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition.",
"description": "serving indicates that this endpoint is able to receive traffic, according to whatever system is managing the endpoint. For endpoints backed by pods, the EndpointSlice controller will mark the endpoint as serving if the pod's Ready condition is True. A nil value should be interpreted as \"true\".",
"type": "boolean"
},
"terminating": {
"description": "terminating indicates that this endpoint is terminating. A nil value indicates an unknown state. Consumers should interpret this unknown state to mean that the endpoint is not terminating.",
"description": "terminating indicates that this endpoint is terminating. A nil value should be interpreted as \"false\".",
"type": "boolean"
}
},
@ -148,7 +148,7 @@
"type": "string"
},
"port": {
"description": "port represents the port number of the endpoint. If this is not specified, ports are not restricted and must be interpreted in the context of the specific consumer.",
"description": "port represents the port number of the endpoint. If the EndpointSlice is derived from a Kubernetes service, this must be set to the service's target port. EndpointSlices used for other purposes may have a nil port.",
"format": "int32",
"type": "integer"
},
@ -161,11 +161,11 @@
"x-kubernetes-map-type": "atomic"
},
"io.k8s.api.discovery.v1.EndpointSlice": {
"description": "EndpointSlice represents a subset of the endpoints that implement a service. For a given service there may be multiple EndpointSlice objects, selected by labels, which must be joined to produce the full set of endpoints.",
"description": "EndpointSlice represents a set of service endpoints. Most EndpointSlices are created by the EndpointSlice controller to represent the Pods selected by Service objects. For a given service there may be multiple EndpointSlice objects which must be joined to produce the full set of endpoints; you can find all of the slices for a given service by listing EndpointSlices in the service's namespace whose `kubernetes.io/service-name` label contains the service's name.",
"properties": {
"addressType": {
"default": "",
"description": "addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.",
"description": "addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name. (Deprecated) The EndpointSlice controller only generates, and kube-proxy only processes, slices of addressType \"IPv4\" and \"IPv6\". No semantics are defined for the \"FQDN\" type.",
"type": "string"
},
"apiVersion": {
@ -199,7 +199,7 @@
"description": "Standard object's metadata."
},
"ports": {
"description": "ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates \"all ports\". Each slice may include a maximum of 100 ports.",
"description": "ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. Each slice may include a maximum of 100 ports. Services always have at least 1 port, so EndpointSlices generated by the EndpointSlice controller will likewise always have at least 1 port. EndpointSlices used for other purposes may have an empty ports list.",
"items": {
"allOf": [
{

View File

@ -33285,7 +33285,7 @@ func schema_k8sio_api_discovery_v1_Endpoint(ref common.ReferenceCallback) common
},
},
SchemaProps: spec.SchemaProps{
Description: "addresses of this endpoint. The contents of this field are interpreted according to the corresponding EndpointSlice addressType field. Consumers must handle different types of addresses in the context of their own capabilities. This must contain at least one address but no more than 100. These are all assumed to be fungible and clients may choose to only use the first element. Refer to: https://issue.k8s.io/106267",
Description: "addresses of this endpoint. For EndpointSlices of addressType \"IPv4\" or \"IPv6\", the values are IP addresses in canonical form. The syntax and semantics of other addressType values are not defined. This must contain at least one address but no more than 100. EndpointSlices generated by the EndpointSlice controller will always have exactly 1 address. No semantics are defined for additional addresses beyond the first, and kube-proxy does not look at them.",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
@ -33372,21 +33372,21 @@ func schema_k8sio_api_discovery_v1_EndpointConditions(ref common.ReferenceCallba
Properties: map[string]spec.Schema{
"ready": {
SchemaProps: spec.SchemaProps{
Description: "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready. For compatibility reasons, ready should never be \"true\" for terminating endpoints, except when the normal readiness behavior is being explicitly overridden, for example when the associated Service has set the publishNotReadyAddresses flag.",
Description: "ready indicates that this endpoint is ready to receive traffic, according to whatever system is managing the endpoint. A nil value should be interpreted as \"true\". In general, an endpoint should be marked ready if it is serving and not terminating, though this can be overridden in some cases, such as when the associated Service has set the publishNotReadyAddresses flag.",
Type: []string{"boolean"},
Format: "",
},
},
"serving": {
SchemaProps: spec.SchemaProps{
Description: "serving is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition.",
Description: "serving indicates that this endpoint is able to receive traffic, according to whatever system is managing the endpoint. For endpoints backed by pods, the EndpointSlice controller will mark the endpoint as serving if the pod's Ready condition is True. A nil value should be interpreted as \"true\".",
Type: []string{"boolean"},
Format: "",
},
},
"terminating": {
SchemaProps: spec.SchemaProps{
Description: "terminating indicates that this endpoint is terminating. A nil value indicates an unknown state. Consumers should interpret this unknown state to mean that the endpoint is not terminating.",
Description: "terminating indicates that this endpoint is terminating. A nil value should be interpreted as \"false\".",
Type: []string{"boolean"},
Format: "",
},
@ -33455,7 +33455,7 @@ func schema_k8sio_api_discovery_v1_EndpointPort(ref common.ReferenceCallback) co
},
"port": {
SchemaProps: spec.SchemaProps{
Description: "port represents the port number of the endpoint. If this is not specified, ports are not restricted and must be interpreted in the context of the specific consumer.",
Description: "port represents the port number of the endpoint. If the EndpointSlice is derived from a Kubernetes service, this must be set to the service's target port. EndpointSlices used for other purposes may have a nil port.",
Type: []string{"integer"},
Format: "int32",
},
@ -33482,7 +33482,7 @@ func schema_k8sio_api_discovery_v1_EndpointSlice(ref common.ReferenceCallback) c
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "EndpointSlice represents a subset of the endpoints that implement a service. For a given service there may be multiple EndpointSlice objects, selected by labels, which must be joined to produce the full set of endpoints.",
Description: "EndpointSlice represents a set of service endpoints. Most EndpointSlices are created by the EndpointSlice controller to represent the Pods selected by Service objects. For a given service there may be multiple EndpointSlice objects which must be joined to produce the full set of endpoints; you can find all of the slices for a given service by listing EndpointSlices in the service's namespace whose `kubernetes.io/service-name` label contains the service's name.",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"kind": {
@ -33508,7 +33508,7 @@ func schema_k8sio_api_discovery_v1_EndpointSlice(ref common.ReferenceCallback) c
},
"addressType": {
SchemaProps: spec.SchemaProps{
Description: "addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.\n\nPossible enum values:\n - `\"FQDN\"` represents a FQDN.\n - `\"IPv4\"` represents an IPv4 Address.\n - `\"IPv6\"` represents an IPv6 Address.",
Description: "addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name. (Deprecated) The EndpointSlice controller only generates, and kube-proxy only processes, slices of addressType \"IPv4\" and \"IPv6\". No semantics are defined for the \"FQDN\" type.\n\nPossible enum values:\n - `\"FQDN\"` represents a FQDN.\n - `\"IPv4\"` represents an IPv4 Address.\n - `\"IPv6\"` represents an IPv6 Address.",
Default: "",
Type: []string{"string"},
Format: "",
@ -33541,7 +33541,7 @@ func schema_k8sio_api_discovery_v1_EndpointSlice(ref common.ReferenceCallback) c
},
},
SchemaProps: spec.SchemaProps{
Description: "ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates \"all ports\". Each slice may include a maximum of 100 ports.",
Description: "ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. Each slice may include a maximum of 100 ports. Services always have at least 1 port, so EndpointSlices generated by the EndpointSlice controller will likewise always have at least 1 port. EndpointSlices used for other purposes may have an empty ports list.",
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{

View File

@ -31,12 +31,12 @@ option go_package = "k8s.io/api/discovery/v1";
// Endpoint represents a single logical "backend" implementing a service.
message Endpoint {
// addresses of this endpoint. The contents of this field are interpreted
// according to the corresponding EndpointSlice addressType field. Consumers
// must handle different types of addresses in the context of their own
// capabilities. This must contain at least one address but no more than
// 100. These are all assumed to be fungible and clients may choose to only
// use the first element. Refer to: https://issue.k8s.io/106267
// addresses of this endpoint. For EndpointSlices of addressType "IPv4" or "IPv6",
// the values are IP addresses in canonical form. The syntax and semantics of
// other addressType values are not defined. This must contain at least one
// address but no more than 100. EndpointSlices generated by the EndpointSlice
// controller will always have exactly 1 address. No semantics are defined for
// additional addresses beyond the first, and kube-proxy does not look at them.
// +listType=set
repeated string addresses = 1;
@ -82,26 +82,25 @@ message Endpoint {
// EndpointConditions represents the current condition of an endpoint.
message EndpointConditions {
// ready indicates that this endpoint is prepared to receive traffic,
// ready indicates that this endpoint is ready to receive traffic,
// according to whatever system is managing the endpoint. A nil value
// indicates an unknown state. In most cases consumers should interpret this
// unknown state as ready. For compatibility reasons, ready should never be
// "true" for terminating endpoints, except when the normal readiness
// behavior is being explicitly overridden, for example when the associated
// Service has set the publishNotReadyAddresses flag.
// should be interpreted as "true". In general, an endpoint should be
// marked ready if it is serving and not terminating, though this can
// be overridden in some cases, such as when the associated Service has
// set the publishNotReadyAddresses flag.
// +optional
optional bool ready = 1;
// serving is identical to ready except that it is set regardless of the
// terminating state of endpoints. This condition should be set to true for
// a ready endpoint that is terminating. If nil, consumers should defer to
// the ready condition.
// serving indicates that this endpoint is able to receive traffic,
// according to whatever system is managing the endpoint. For endpoints
// backed by pods, the EndpointSlice controller will mark the endpoint
// as serving if the pod's Ready condition is True. A nil value should be
// interpreted as "true".
// +optional
optional bool serving = 2;
// terminating indicates that this endpoint is terminating. A nil value
// indicates an unknown state. Consumers should interpret this unknown state
// to mean that the endpoint is not terminating.
// should be interpreted as "false".
// +optional
optional bool terminating = 3;
}
@ -132,8 +131,9 @@ message EndpointPort {
optional string protocol = 2;
// port represents the port number of the endpoint.
// If this is not specified, ports are not restricted and must be
// interpreted in the context of the specific consumer.
// If the EndpointSlice is derived from a Kubernetes service, this must be set
// to the service's target port. EndpointSlices used for other purposes may have
// a nil port.
optional int32 port = 3;
// The application protocol for this port.
@ -155,9 +155,12 @@ message EndpointPort {
optional string appProtocol = 4;
}
// EndpointSlice represents a subset of the endpoints that implement a service.
// For a given service there may be multiple EndpointSlice objects, selected by
// labels, which must be joined to produce the full set of endpoints.
// EndpointSlice represents a set of service endpoints. Most EndpointSlices are created by
// the EndpointSlice controller to represent the Pods selected by Service objects. For a
// given service there may be multiple EndpointSlice objects which must be joined to
// produce the full set of endpoints; you can find all of the slices for a given service
// by listing EndpointSlices in the service's namespace whose `kubernetes.io/service-name`
// label contains the service's name.
message EndpointSlice {
// Standard object's metadata.
// +optional
@ -169,7 +172,10 @@ message EndpointSlice {
// supported:
// * IPv4: Represents an IPv4 Address.
// * IPv6: Represents an IPv6 Address.
// * FQDN: Represents a Fully Qualified Domain Name.
// * FQDN: Represents a Fully Qualified Domain Name. (Deprecated)
// The EndpointSlice controller only generates, and kube-proxy only processes,
// slices of addressType "IPv4" and "IPv6". No semantics are defined for
// the "FQDN" type.
optional string addressType = 4;
// endpoints is a list of unique endpoints in this slice. Each slice may
@ -178,10 +184,11 @@ message EndpointSlice {
repeated Endpoint endpoints = 2;
// ports specifies the list of network ports exposed by each endpoint in
// this slice. Each port must have a unique name. When ports is empty, it
// indicates that there are no defined ports. When a port is defined with a
// nil port value, it indicates "all ports". Each slice may include a
// this slice. Each port must have a unique name. Each slice may include a
// maximum of 100 ports.
// Services always have at least 1 port, so EndpointSlices generated by the
// EndpointSlice controller will likewise always have at least 1 port.
// EndpointSlices used for other purposes may have an empty ports list.
// +optional
// +listType=atomic
repeated EndpointPort ports = 3;

View File

@ -25,9 +25,12 @@ import (
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:prerelease-lifecycle-gen:introduced=1.21
// EndpointSlice represents a subset of the endpoints that implement a service.
// For a given service there may be multiple EndpointSlice objects, selected by
// labels, which must be joined to produce the full set of endpoints.
// EndpointSlice represents a set of service endpoints. Most EndpointSlices are created by
// the EndpointSlice controller to represent the Pods selected by Service objects. For a
// given service there may be multiple EndpointSlice objects which must be joined to
// produce the full set of endpoints; you can find all of the slices for a given service
// by listing EndpointSlices in the service's namespace whose `kubernetes.io/service-name`
// label contains the service's name.
type EndpointSlice struct {
metav1.TypeMeta `json:",inline"`
@ -41,7 +44,10 @@ type EndpointSlice struct {
// supported:
// * IPv4: Represents an IPv4 Address.
// * IPv6: Represents an IPv6 Address.
// * FQDN: Represents a Fully Qualified Domain Name.
// * FQDN: Represents a Fully Qualified Domain Name. (Deprecated)
// The EndpointSlice controller only generates, and kube-proxy only processes,
// slices of addressType "IPv4" and "IPv6". No semantics are defined for
// the "FQDN" type.
AddressType AddressType `json:"addressType" protobuf:"bytes,4,rep,name=addressType"`
// endpoints is a list of unique endpoints in this slice. Each slice may
@ -50,10 +56,11 @@ type EndpointSlice struct {
Endpoints []Endpoint `json:"endpoints" protobuf:"bytes,2,rep,name=endpoints"`
// ports specifies the list of network ports exposed by each endpoint in
// this slice. Each port must have a unique name. When ports is empty, it
// indicates that there are no defined ports. When a port is defined with a
// nil port value, it indicates "all ports". Each slice may include a
// this slice. Each port must have a unique name. Each slice may include a
// maximum of 100 ports.
// Services always have at least 1 port, so EndpointSlices generated by the
// EndpointSlice controller will likewise always have at least 1 port.
// EndpointSlices used for other purposes may have an empty ports list.
// +optional
// +listType=atomic
Ports []EndpointPort `json:"ports" protobuf:"bytes,3,rep,name=ports"`
@ -76,12 +83,12 @@ const (
// Endpoint represents a single logical "backend" implementing a service.
type Endpoint struct {
// addresses of this endpoint. The contents of this field are interpreted
// according to the corresponding EndpointSlice addressType field. Consumers
// must handle different types of addresses in the context of their own
// capabilities. This must contain at least one address but no more than
// 100. These are all assumed to be fungible and clients may choose to only
// use the first element. Refer to: https://issue.k8s.io/106267
// addresses of this endpoint. For EndpointSlices of addressType "IPv4" or "IPv6",
// the values are IP addresses in canonical form. The syntax and semantics of
// other addressType values are not defined. This must contain at least one
// address but no more than 100. EndpointSlices generated by the EndpointSlice
// controller will always have exactly 1 address. No semantics are defined for
// additional addresses beyond the first, and kube-proxy does not look at them.
// +listType=set
Addresses []string `json:"addresses" protobuf:"bytes,1,rep,name=addresses"`
@ -127,26 +134,25 @@ type Endpoint struct {
// EndpointConditions represents the current condition of an endpoint.
type EndpointConditions struct {
// ready indicates that this endpoint is prepared to receive traffic,
// ready indicates that this endpoint is ready to receive traffic,
// according to whatever system is managing the endpoint. A nil value
// indicates an unknown state. In most cases consumers should interpret this
// unknown state as ready. For compatibility reasons, ready should never be
// "true" for terminating endpoints, except when the normal readiness
// behavior is being explicitly overridden, for example when the associated
// Service has set the publishNotReadyAddresses flag.
// should be interpreted as "true". In general, an endpoint should be
// marked ready if it is serving and not terminating, though this can
// be overridden in some cases, such as when the associated Service has
// set the publishNotReadyAddresses flag.
// +optional
Ready *bool `json:"ready,omitempty" protobuf:"bytes,1,name=ready"`
// serving is identical to ready except that it is set regardless of the
// terminating state of endpoints. This condition should be set to true for
// a ready endpoint that is terminating. If nil, consumers should defer to
// the ready condition.
// serving indicates that this endpoint is able to receive traffic,
// according to whatever system is managing the endpoint. For endpoints
// backed by pods, the EndpointSlice controller will mark the endpoint
// as serving if the pod's Ready condition is True. A nil value should be
// interpreted as "true".
// +optional
Serving *bool `json:"serving,omitempty" protobuf:"bytes,2,name=serving"`
// terminating indicates that this endpoint is terminating. A nil value
// indicates an unknown state. Consumers should interpret this unknown state
// to mean that the endpoint is not terminating.
// should be interpreted as "false".
// +optional
Terminating *bool `json:"terminating,omitempty" protobuf:"bytes,3,name=terminating"`
}
@ -183,8 +189,9 @@ type EndpointPort struct {
Protocol *v1.Protocol `json:"protocol,omitempty" protobuf:"bytes,2,name=protocol"`
// port represents the port number of the endpoint.
// If this is not specified, ports are not restricted and must be
// interpreted in the context of the specific consumer.
// If the EndpointSlice is derived from a Kubernetes service, this must be set
// to the service's target port. EndpointSlices used for other purposes may have
// a nil port.
Port *int32 `json:"port,omitempty" protobuf:"bytes,3,opt,name=port"`
// The application protocol for this port.

View File

@ -29,7 +29,7 @@ package v1
// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT.
var map_Endpoint = map[string]string{
"": "Endpoint represents a single logical \"backend\" implementing a service.",
"addresses": "addresses of this endpoint. The contents of this field are interpreted according to the corresponding EndpointSlice addressType field. Consumers must handle different types of addresses in the context of their own capabilities. This must contain at least one address but no more than 100. These are all assumed to be fungible and clients may choose to only use the first element. Refer to: https://issue.k8s.io/106267",
"addresses": "addresses of this endpoint. For EndpointSlices of addressType \"IPv4\" or \"IPv6\", the values are IP addresses in canonical form. The syntax and semantics of other addressType values are not defined. This must contain at least one address but no more than 100. EndpointSlices generated by the EndpointSlice controller will always have exactly 1 address. No semantics are defined for additional addresses beyond the first, and kube-proxy does not look at them.",
"conditions": "conditions contains information about the current status of the endpoint.",
"hostname": "hostname of this endpoint. This field may be used by consumers of endpoints to distinguish endpoints from each other (e.g. in DNS names). Multiple endpoints which use the same hostname should be considered fungible (e.g. multiple A values in DNS). Must be lowercase and pass DNS Label (RFC 1123) validation.",
"targetRef": "targetRef is a reference to a Kubernetes object that represents this endpoint.",
@ -45,9 +45,9 @@ func (Endpoint) SwaggerDoc() map[string]string {
var map_EndpointConditions = map[string]string{
"": "EndpointConditions represents the current condition of an endpoint.",
"ready": "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready. For compatibility reasons, ready should never be \"true\" for terminating endpoints, except when the normal readiness behavior is being explicitly overridden, for example when the associated Service has set the publishNotReadyAddresses flag.",
"serving": "serving is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition.",
"terminating": "terminating indicates that this endpoint is terminating. A nil value indicates an unknown state. Consumers should interpret this unknown state to mean that the endpoint is not terminating.",
"ready": "ready indicates that this endpoint is ready to receive traffic, according to whatever system is managing the endpoint. A nil value should be interpreted as \"true\". In general, an endpoint should be marked ready if it is serving and not terminating, though this can be overridden in some cases, such as when the associated Service has set the publishNotReadyAddresses flag.",
"serving": "serving indicates that this endpoint is able to receive traffic, according to whatever system is managing the endpoint. For endpoints backed by pods, the EndpointSlice controller will mark the endpoint as serving if the pod's Ready condition is True. A nil value should be interpreted as \"true\".",
"terminating": "terminating indicates that this endpoint is terminating. A nil value should be interpreted as \"false\".",
}
func (EndpointConditions) SwaggerDoc() map[string]string {
@ -67,7 +67,7 @@ var map_EndpointPort = map[string]string{
"": "EndpointPort represents a Port used by an EndpointSlice",
"name": "name represents the name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string.",
"protocol": "protocol represents the IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.",
"port": "port represents the port number of the endpoint. If this is not specified, ports are not restricted and must be interpreted in the context of the specific consumer.",
"port": "port represents the port number of the endpoint. If the EndpointSlice is derived from a Kubernetes service, this must be set to the service's target port. EndpointSlices used for other purposes may have a nil port.",
"appProtocol": "The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either:\n\n* Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names).\n\n* Kubernetes-defined prefixed names:\n * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior-\n * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455\n * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455\n\n* Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol.",
}
@ -76,11 +76,11 @@ func (EndpointPort) SwaggerDoc() map[string]string {
}
var map_EndpointSlice = map[string]string{
"": "EndpointSlice represents a subset of the endpoints that implement a service. For a given service there may be multiple EndpointSlice objects, selected by labels, which must be joined to produce the full set of endpoints.",
"": "EndpointSlice represents a set of service endpoints. Most EndpointSlices are created by the EndpointSlice controller to represent the Pods selected by Service objects. For a given service there may be multiple EndpointSlice objects which must be joined to produce the full set of endpoints; you can find all of the slices for a given service by listing EndpointSlices in the service's namespace whose `kubernetes.io/service-name` label contains the service's name.",
"metadata": "Standard object's metadata.",
"addressType": "addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.",
"addressType": "addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name. (Deprecated) The EndpointSlice controller only generates, and kube-proxy only processes, slices of addressType \"IPv4\" and \"IPv6\". No semantics are defined for the \"FQDN\" type.",
"endpoints": "endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.",
"ports": "ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates \"all ports\". Each slice may include a maximum of 100 ports.",
"ports": "ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. Each slice may include a maximum of 100 ports. Services always have at least 1 port, so EndpointSlices generated by the EndpointSlice controller will likewise always have at least 1 port. EndpointSlices used for other purposes may have an empty ports list.",
}
func (EndpointSlice) SwaggerDoc() map[string]string {