'Global' -> 'Cluster' for traffic policy
This commit is contained in:
parent
ce8309780f
commit
fc34a9d6ba
@ -49749,7 +49749,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"externalTrafficPolicy": {
|
||||
"description": "externalTrafficPolicy denotes if this Service desires to route external traffic to local endpoints only. This preserves Source IP and avoids a second hop for LoadBalancer and Nodeport type services.",
|
||||
"description": "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.",
|
||||
"type": "string"
|
||||
},
|
||||
"healthCheckNodePort": {
|
||||
|
@ -21715,7 +21715,7 @@
|
||||
},
|
||||
"externalTrafficPolicy": {
|
||||
"type": "string",
|
||||
"description": "externalTrafficPolicy denotes if this Service desires to route external traffic to local endpoints only. This preserves Source IP and avoids a second hop for LoadBalancer and Nodeport type services."
|
||||
"description": "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading."
|
||||
},
|
||||
"healthCheckNodePort": {
|
||||
"type": "integer",
|
||||
|
@ -9861,7 +9861,7 @@ Examples:<br>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">externalTrafficPolicy</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">externalTrafficPolicy denotes if this Service desires to route external traffic to local endpoints only. This preserves Source IP and avoids a second hop for LoadBalancer and Nodeport type services.</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. "Local" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. "Cluster" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
@ -10105,7 +10105,7 @@ Examples:<br>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<div id="footer-text">
|
||||
Last updated 2017-05-31 19:35:23 UTC
|
||||
Last updated 2017-06-01 23:03:33 UTC
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -12589,7 +12589,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"externalTrafficPolicy": {
|
||||
"description": "externalTrafficPolicy denotes if this Service desires to route external traffic to local endpoints only. This preserves Source IP and avoids a second hop for LoadBalancer and Nodeport type services.",
|
||||
"description": "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.",
|
||||
"type": "string"
|
||||
},
|
||||
"healthCheckNodePort": {
|
||||
|
@ -5118,7 +5118,7 @@
|
||||
},
|
||||
"externalTrafficPolicy": {
|
||||
"type": "string",
|
||||
"description": "externalTrafficPolicy denotes if this Service desires to route external traffic to local endpoints only. This preserves Source IP and avoids a second hop for LoadBalancer and Nodeport type services."
|
||||
"description": "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading."
|
||||
},
|
||||
"healthCheckNodePort": {
|
||||
"type": "integer",
|
||||
|
@ -2207,7 +2207,7 @@ When an object is created, the system will populate this list with the current s
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">externalTrafficPolicy</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">externalTrafficPolicy denotes if this Service desires to route external traffic to local endpoints only. This preserves Source IP and avoids a second hop for LoadBalancer and Nodeport type services.</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. "Local" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. "Cluster" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
@ -2331,7 +2331,7 @@ Examples:<br>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<div id="footer-text">
|
||||
Last updated 2017-05-17 22:26:25 UTC
|
||||
Last updated 2017-06-01 05:34:38 UTC
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -157,7 +157,7 @@ func TestRequestsOnlyLocalTraffic(t *testing.T) {
|
||||
checkRequestsOnlyLocalTraffic(false, &api.Service{
|
||||
Spec: api.ServiceSpec{
|
||||
Type: api.ServiceTypeNodePort,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
})
|
||||
checkRequestsOnlyLocalTraffic(true, &api.Service{
|
||||
@ -169,7 +169,7 @@ func TestRequestsOnlyLocalTraffic(t *testing.T) {
|
||||
checkRequestsOnlyLocalTraffic(false, &api.Service{
|
||||
Spec: api.ServiceSpec{
|
||||
Type: api.ServiceTypeLoadBalancer,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
})
|
||||
checkRequestsOnlyLocalTraffic(true, &api.Service{
|
||||
@ -197,7 +197,7 @@ func TestNeedsHealthCheck(t *testing.T) {
|
||||
checkNeedsHealthCheck(false, &api.Service{
|
||||
Spec: api.ServiceSpec{
|
||||
Type: api.ServiceTypeNodePort,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
})
|
||||
checkNeedsHealthCheck(false, &api.Service{
|
||||
@ -209,7 +209,7 @@ func TestNeedsHealthCheck(t *testing.T) {
|
||||
checkNeedsHealthCheck(false, &api.Service{
|
||||
Spec: api.ServiceSpec{
|
||||
Type: api.ServiceTypeLoadBalancer,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
})
|
||||
checkNeedsHealthCheck(true, &api.Service{
|
||||
@ -268,13 +268,13 @@ func TestGetServiceHealthCheckNodePort(t *testing.T) {
|
||||
checkGetServiceHealthCheckNodePort(0, &api.Service{
|
||||
Spec: api.ServiceSpec{
|
||||
Type: api.ServiceTypeNodePort,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
})
|
||||
checkGetServiceHealthCheckNodePort(0, &api.Service{
|
||||
Spec: api.ServiceSpec{
|
||||
Type: api.ServiceTypeLoadBalancer,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
})
|
||||
checkGetServiceHealthCheckNodePort(34567, &api.Service{
|
||||
@ -306,7 +306,7 @@ func TestClearExternalTrafficPolicy(t *testing.T) {
|
||||
&api.Service{
|
||||
Spec: api.ServiceSpec{
|
||||
Type: api.ServiceTypeClusterIP,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -346,7 +346,7 @@ func TestSetServiceHealthCheckNodePort(t *testing.T) {
|
||||
&api.Service{
|
||||
Spec: api.ServiceSpec{
|
||||
Type: api.ServiceTypeClusterIP,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
},
|
||||
30012,
|
||||
@ -356,7 +356,7 @@ func TestSetServiceHealthCheckNodePort(t *testing.T) {
|
||||
&api.Service{
|
||||
Spec: api.ServiceSpec{
|
||||
Type: api.ServiceTypeClusterIP,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
},
|
||||
0,
|
||||
|
@ -322,7 +322,7 @@ func coreFuncs(t apitesting.TestingCommon) []interface{} {
|
||||
*p = types[c.Rand.Intn(len(types))]
|
||||
},
|
||||
func(p *api.ServiceExternalTrafficPolicyType, c fuzz.Continue) {
|
||||
types := []api.ServiceExternalTrafficPolicyType{api.ServiceExternalTrafficPolicyTypeGlobal, api.ServiceExternalTrafficPolicyTypeLocal}
|
||||
types := []api.ServiceExternalTrafficPolicyType{api.ServiceExternalTrafficPolicyTypeCluster, api.ServiceExternalTrafficPolicyTypeLocal}
|
||||
*p = types[c.Rand.Intn(len(types))]
|
||||
},
|
||||
func(ct *api.Container, c fuzz.Continue) {
|
||||
|
@ -2504,10 +2504,10 @@ const (
|
||||
type ServiceExternalTrafficPolicyType string
|
||||
|
||||
const (
|
||||
// ServiceExternalTrafficPolicyTypeLocal specifies local endpoints behavior.
|
||||
// ServiceExternalTrafficPolicyTypeLocal specifies node-local endpoints behavior.
|
||||
ServiceExternalTrafficPolicyTypeLocal ServiceExternalTrafficPolicyType = "Local"
|
||||
// ServiceExternalTrafficPolicyTypeGlobal specifies global (legacy) behavior.
|
||||
ServiceExternalTrafficPolicyTypeGlobal ServiceExternalTrafficPolicyType = "Global"
|
||||
// ServiceExternalTrafficPolicyTypeCluster specifies cluster-wide (legacy) behavior.
|
||||
ServiceExternalTrafficPolicyTypeCluster ServiceExternalTrafficPolicyType = "Cluster"
|
||||
)
|
||||
|
||||
// ServiceStatus represents the current status of a service
|
||||
@ -2610,9 +2610,12 @@ type ServiceSpec struct {
|
||||
// +optional
|
||||
LoadBalancerSourceRanges []string
|
||||
|
||||
// externalTrafficPolicy denotes if this Service desires to route external traffic to
|
||||
// local endpoints only. This preserves Source IP and avoids a second hop for
|
||||
// LoadBalancer and Nodeport type services.
|
||||
// externalTrafficPolicy denotes if this Service desires to route external
|
||||
// traffic to node-local or cluster-wide endpoints. "Local" preserves the
|
||||
// client source IP and avoids a second hop for LoadBalancer and Nodeport
|
||||
// type services, but risks potentially imbalanced traffic spreading.
|
||||
// "Cluster" obscures the client source IP and may cause a second hop to
|
||||
// another node, but should have good overall load-spreading.
|
||||
// +optional
|
||||
ExternalTrafficPolicy ServiceExternalTrafficPolicyType
|
||||
|
||||
|
@ -120,7 +120,7 @@ func SetDefaults_Service(obj *Service) {
|
||||
} else if (obj.Spec.Type == ServiceTypeNodePort ||
|
||||
obj.Spec.Type == ServiceTypeLoadBalancer) &&
|
||||
obj.Spec.ExternalTrafficPolicy == "" {
|
||||
obj.Spec.ExternalTrafficPolicy = ServiceExternalTrafficPolicyTypeGlobal
|
||||
obj.Spec.ExternalTrafficPolicy = ServiceExternalTrafficPolicyTypeCluster
|
||||
}
|
||||
}
|
||||
func SetDefaults_Pod(obj *Pod) {
|
||||
|
@ -885,15 +885,15 @@ func TestSetDefaulServiceExternalTraffic(t *testing.T) {
|
||||
in = &v1.Service{Spec: v1.ServiceSpec{Type: v1.ServiceTypeNodePort}}
|
||||
obj = roundTrip(t, runtime.Object(in))
|
||||
out = obj.(*v1.Service)
|
||||
if out.Spec.ExternalTrafficPolicy != v1.ServiceExternalTrafficPolicyTypeGlobal {
|
||||
t.Errorf("Expected ExternalTrafficPolicy to be %v, got %v", v1.ServiceExternalTrafficPolicyTypeGlobal, out.Spec.ExternalTrafficPolicy)
|
||||
if out.Spec.ExternalTrafficPolicy != v1.ServiceExternalTrafficPolicyTypeCluster {
|
||||
t.Errorf("Expected ExternalTrafficPolicy to be %v, got %v", v1.ServiceExternalTrafficPolicyTypeCluster, out.Spec.ExternalTrafficPolicy)
|
||||
}
|
||||
|
||||
in = &v1.Service{Spec: v1.ServiceSpec{Type: v1.ServiceTypeLoadBalancer}}
|
||||
obj = roundTrip(t, runtime.Object(in))
|
||||
out = obj.(*v1.Service)
|
||||
if out.Spec.ExternalTrafficPolicy != v1.ServiceExternalTrafficPolicyTypeGlobal {
|
||||
t.Errorf("Expected ExternalTrafficPolicy to be %v, got %v", v1.ServiceExternalTrafficPolicyTypeGlobal, out.Spec.ExternalTrafficPolicy)
|
||||
if out.Spec.ExternalTrafficPolicy != v1.ServiceExternalTrafficPolicyTypeCluster {
|
||||
t.Errorf("Expected ExternalTrafficPolicy to be %v, got %v", v1.ServiceExternalTrafficPolicyTypeCluster, out.Spec.ExternalTrafficPolicy)
|
||||
}
|
||||
|
||||
in = &v1.Service{
|
||||
|
@ -3734,9 +3734,12 @@ message ServiceSpec {
|
||||
// +optional
|
||||
optional string externalName = 10;
|
||||
|
||||
// externalTrafficPolicy denotes if this Service desires to route external traffic to
|
||||
// local endpoints only. This preserves Source IP and avoids a second hop for
|
||||
// LoadBalancer and Nodeport type services.
|
||||
// externalTrafficPolicy denotes if this Service desires to route external
|
||||
// traffic to node-local or cluster-wide endpoints. "Local" preserves the
|
||||
// client source IP and avoids a second hop for LoadBalancer and Nodeport
|
||||
// type services, but risks potentially imbalanced traffic spreading.
|
||||
// "Cluster" obscures the client source IP and may cause a second hop to
|
||||
// another node, but should have good overall load-spreading.
|
||||
// +optional
|
||||
optional string externalTrafficPolicy = 11;
|
||||
|
||||
|
@ -157,7 +157,7 @@ func TestRequestsOnlyLocalTraffic(t *testing.T) {
|
||||
checkRequestsOnlyLocalTraffic(false, &v1.Service{
|
||||
Spec: v1.ServiceSpec{
|
||||
Type: v1.ServiceTypeNodePort,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
})
|
||||
checkRequestsOnlyLocalTraffic(true, &v1.Service{
|
||||
@ -169,7 +169,7 @@ func TestRequestsOnlyLocalTraffic(t *testing.T) {
|
||||
checkRequestsOnlyLocalTraffic(false, &v1.Service{
|
||||
Spec: v1.ServiceSpec{
|
||||
Type: v1.ServiceTypeLoadBalancer,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
})
|
||||
checkRequestsOnlyLocalTraffic(true, &v1.Service{
|
||||
@ -197,7 +197,7 @@ func TestNeedsHealthCheck(t *testing.T) {
|
||||
checkNeedsHealthCheck(false, &v1.Service{
|
||||
Spec: v1.ServiceSpec{
|
||||
Type: v1.ServiceTypeNodePort,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
})
|
||||
checkNeedsHealthCheck(false, &v1.Service{
|
||||
@ -209,7 +209,7 @@ func TestNeedsHealthCheck(t *testing.T) {
|
||||
checkNeedsHealthCheck(false, &v1.Service{
|
||||
Spec: v1.ServiceSpec{
|
||||
Type: v1.ServiceTypeLoadBalancer,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
})
|
||||
checkNeedsHealthCheck(true, &v1.Service{
|
||||
@ -268,13 +268,13 @@ func TestGetServiceHealthCheckNodePort(t *testing.T) {
|
||||
checkGetServiceHealthCheckNodePort(0, &v1.Service{
|
||||
Spec: v1.ServiceSpec{
|
||||
Type: v1.ServiceTypeNodePort,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
})
|
||||
checkGetServiceHealthCheckNodePort(0, &v1.Service{
|
||||
Spec: v1.ServiceSpec{
|
||||
Type: v1.ServiceTypeLoadBalancer,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
})
|
||||
checkGetServiceHealthCheckNodePort(34567, &v1.Service{
|
||||
@ -306,7 +306,7 @@ func TestClearExternalTrafficPolicy(t *testing.T) {
|
||||
&v1.Service{
|
||||
Spec: v1.ServiceSpec{
|
||||
Type: v1.ServiceTypeClusterIP,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -346,7 +346,7 @@ func TestSetServiceHealthCheckNodePort(t *testing.T) {
|
||||
&v1.Service{
|
||||
Spec: v1.ServiceSpec{
|
||||
Type: v1.ServiceTypeClusterIP,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
},
|
||||
30012,
|
||||
@ -356,7 +356,7 @@ func TestSetServiceHealthCheckNodePort(t *testing.T) {
|
||||
&v1.Service{
|
||||
Spec: v1.ServiceSpec{
|
||||
Type: v1.ServiceTypeClusterIP,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: v1.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
},
|
||||
0,
|
||||
|
@ -2842,10 +2842,10 @@ const (
|
||||
type ServiceExternalTrafficPolicyType string
|
||||
|
||||
const (
|
||||
// ServiceExternalTrafficPolicyTypeLocal specifies local endpoints behavior.
|
||||
// ServiceExternalTrafficPolicyTypeLocal specifies node-local endpoints behavior.
|
||||
ServiceExternalTrafficPolicyTypeLocal ServiceExternalTrafficPolicyType = "Local"
|
||||
// ServiceExternalTrafficPolicyTypeGlobal specifies global (legacy) behavior.
|
||||
ServiceExternalTrafficPolicyTypeGlobal ServiceExternalTrafficPolicyType = "Global"
|
||||
// ServiceExternalTrafficPolicyTypeCluster specifies node-global (legacy) behavior.
|
||||
ServiceExternalTrafficPolicyTypeCluster ServiceExternalTrafficPolicyType = "Cluster"
|
||||
)
|
||||
|
||||
// ServiceStatus represents the current status of a service.
|
||||
@ -2961,9 +2961,12 @@ type ServiceSpec struct {
|
||||
// +optional
|
||||
ExternalName string `json:"externalName,omitempty" protobuf:"bytes,10,opt,name=externalName"`
|
||||
|
||||
// externalTrafficPolicy denotes if this Service desires to route external traffic to
|
||||
// local endpoints only. This preserves Source IP and avoids a second hop for
|
||||
// LoadBalancer and Nodeport type services.
|
||||
// externalTrafficPolicy denotes if this Service desires to route external
|
||||
// traffic to node-local or cluster-wide endpoints. "Local" preserves the
|
||||
// client source IP and avoids a second hop for LoadBalancer and Nodeport
|
||||
// type services, but risks potentially imbalanced traffic spreading.
|
||||
// "Cluster" obscures the client source IP and may cause a second hop to
|
||||
// another node, but should have good overall load-spreading.
|
||||
// +optional
|
||||
ExternalTrafficPolicy ServiceExternalTrafficPolicyType `json:"externalTrafficPolicy,omitempty" protobuf:"bytes,11,opt,name=externalTrafficPolicy"`
|
||||
|
||||
|
@ -1858,7 +1858,7 @@ var map_ServiceSpec = map[string]string{
|
||||
"loadBalancerIP": "Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature.",
|
||||
"loadBalancerSourceRanges": "If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature.\" More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/",
|
||||
"externalName": "externalName is the external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid DNS name and requires Type to be ExternalName.",
|
||||
"externalTrafficPolicy": "externalTrafficPolicy denotes if this Service desires to route external traffic to local endpoints only. This preserves Source IP and avoids a second hop for LoadBalancer and Nodeport type services.",
|
||||
"externalTrafficPolicy": "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.",
|
||||
"healthCheckNodePort": "healthCheckNodePort specifies the healthcheck nodePort for the service. If not specified, HealthCheckNodePort is created by the service api backend with the allocated nodePort. Will use user-specified nodePort value if specified by the client. Only effects when Type is set to LoadBalancer and ExternalTrafficPolicy is set to Local.",
|
||||
}
|
||||
|
||||
|
@ -2903,10 +2903,10 @@ func validateServiceExternalTrafficFieldsValue(service *api.Service) field.Error
|
||||
|
||||
// Check first class fields.
|
||||
if service.Spec.ExternalTrafficPolicy != "" &&
|
||||
service.Spec.ExternalTrafficPolicy != api.ServiceExternalTrafficPolicyTypeGlobal &&
|
||||
service.Spec.ExternalTrafficPolicy != api.ServiceExternalTrafficPolicyTypeCluster &&
|
||||
service.Spec.ExternalTrafficPolicy != api.ServiceExternalTrafficPolicyTypeLocal {
|
||||
allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("externalTrafficPolicy"), service.Spec.ExternalTrafficPolicy,
|
||||
fmt.Sprintf("ExternalTrafficPolicy must be empty, %v or %v", api.ServiceExternalTrafficPolicyTypeGlobal, api.ServiceExternalTrafficPolicyTypeLocal)))
|
||||
fmt.Sprintf("ExternalTrafficPolicy must be empty, %v or %v", api.ServiceExternalTrafficPolicyTypeCluster, api.ServiceExternalTrafficPolicyTypeLocal)))
|
||||
}
|
||||
if service.Spec.HealthCheckNodePort < 0 {
|
||||
allErrs = append(allErrs, field.Invalid(field.NewPath("spec").Child("healthCheckNodePort"), service.Spec.HealthCheckNodePort,
|
||||
|
@ -6380,7 +6380,7 @@ func TestValidateServiceExternalTrafficFieldsCombination(t *testing.T) {
|
||||
name: "cannot set healthCheckNodePort field on loadBalancer service with externalTrafficPolicy!=Local",
|
||||
tweakSvc: func(s *api.Service) {
|
||||
s.Spec.Type = api.ServiceTypeLoadBalancer
|
||||
s.Spec.ExternalTrafficPolicy = api.ServiceExternalTrafficPolicyTypeGlobal
|
||||
s.Spec.ExternalTrafficPolicy = api.ServiceExternalTrafficPolicyTypeCluster
|
||||
s.Spec.HealthCheckNodePort = 34567
|
||||
},
|
||||
numErrs: 1,
|
||||
|
@ -1189,7 +1189,7 @@ func TestServiceRegistryExternalTrafficGlobal(t *testing.T) {
|
||||
Protocol: api.ProtocolTCP,
|
||||
TargetPort: intstr.FromInt(6502),
|
||||
}},
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeGlobal,
|
||||
ExternalTrafficPolicy: api.ServiceExternalTrafficPolicyTypeCluster,
|
||||
},
|
||||
}
|
||||
created_svc, err := storage.Create(ctx, svc)
|
||||
|
@ -2504,10 +2504,10 @@ const (
|
||||
type ServiceExternalTrafficPolicyType string
|
||||
|
||||
const (
|
||||
// ServiceExternalTrafficPolicyTypeLocal specifies local endpoints behavior.
|
||||
// ServiceExternalTrafficPolicyTypeLocal specifies node-local endpoints behavior.
|
||||
ServiceExternalTrafficPolicyTypeLocal ServiceExternalTrafficPolicyType = "Local"
|
||||
// ServiceExternalTrafficPolicyTypeGlobal specifies global (legacy) behavior.
|
||||
ServiceExternalTrafficPolicyTypeGlobal ServiceExternalTrafficPolicyType = "Global"
|
||||
// ServiceExternalTrafficPolicyTypeCluster specifies cluster-wide (legacy) behavior.
|
||||
ServiceExternalTrafficPolicyTypeCluster ServiceExternalTrafficPolicyType = "Cluster"
|
||||
)
|
||||
|
||||
// ServiceStatus represents the current status of a service
|
||||
@ -2610,9 +2610,12 @@ type ServiceSpec struct {
|
||||
// +optional
|
||||
LoadBalancerSourceRanges []string
|
||||
|
||||
// externalTrafficPolicy denotes if this Service desires to route external traffic to
|
||||
// local endpoints only. This preserves Source IP and avoids a second hop for
|
||||
// LoadBalancer and Nodeport type services.
|
||||
// externalTrafficPolicy denotes if this Service desires to route external
|
||||
// traffic to node-local or cluster-wide endpoints. "Local" preserves the
|
||||
// client source IP and avoids a second hop for LoadBalancer and Nodeport
|
||||
// type services, but risks potentially imbalanced traffic spreading.
|
||||
// "Cluster" obscures the client source IP and may cause a second hop to
|
||||
// another node, but should have good overall load-spreading.
|
||||
// +optional
|
||||
ExternalTrafficPolicy ServiceExternalTrafficPolicyType
|
||||
|
||||
|
@ -120,7 +120,7 @@ func SetDefaults_Service(obj *Service) {
|
||||
} else if (obj.Spec.Type == ServiceTypeNodePort ||
|
||||
obj.Spec.Type == ServiceTypeLoadBalancer) &&
|
||||
obj.Spec.ExternalTrafficPolicy == "" {
|
||||
obj.Spec.ExternalTrafficPolicy = ServiceExternalTrafficPolicyTypeGlobal
|
||||
obj.Spec.ExternalTrafficPolicy = ServiceExternalTrafficPolicyTypeCluster
|
||||
}
|
||||
}
|
||||
func SetDefaults_Pod(obj *Pod) {
|
||||
|
@ -3734,9 +3734,12 @@ message ServiceSpec {
|
||||
// +optional
|
||||
optional string externalName = 10;
|
||||
|
||||
// externalTrafficPolicy denotes if this Service desires to route external traffic to
|
||||
// local endpoints only. This preserves Source IP and avoids a second hop for
|
||||
// LoadBalancer and Nodeport type services.
|
||||
// externalTrafficPolicy denotes if this Service desires to route external
|
||||
// traffic to node-local or cluster-wide endpoints. "Local" preserves the
|
||||
// client source IP and avoids a second hop for LoadBalancer and Nodeport
|
||||
// type services, but risks potentially imbalanced traffic spreading.
|
||||
// "Cluster" obscures the client source IP and may cause a second hop to
|
||||
// another node, but should have good overall load-spreading.
|
||||
// +optional
|
||||
optional string externalTrafficPolicy = 11;
|
||||
|
||||
|
@ -2842,10 +2842,10 @@ const (
|
||||
type ServiceExternalTrafficPolicyType string
|
||||
|
||||
const (
|
||||
// ServiceExternalTrafficPolicyTypeLocal specifies local endpoints behavior.
|
||||
// ServiceExternalTrafficPolicyTypeLocal specifies node-local endpoints behavior.
|
||||
ServiceExternalTrafficPolicyTypeLocal ServiceExternalTrafficPolicyType = "Local"
|
||||
// ServiceExternalTrafficPolicyTypeGlobal specifies global (legacy) behavior.
|
||||
ServiceExternalTrafficPolicyTypeGlobal ServiceExternalTrafficPolicyType = "Global"
|
||||
// ServiceExternalTrafficPolicyTypeCluster specifies node-global (legacy) behavior.
|
||||
ServiceExternalTrafficPolicyTypeCluster ServiceExternalTrafficPolicyType = "Cluster"
|
||||
)
|
||||
|
||||
// ServiceStatus represents the current status of a service.
|
||||
@ -2961,9 +2961,12 @@ type ServiceSpec struct {
|
||||
// +optional
|
||||
ExternalName string `json:"externalName,omitempty" protobuf:"bytes,10,opt,name=externalName"`
|
||||
|
||||
// externalTrafficPolicy denotes if this Service desires to route external traffic to
|
||||
// local endpoints only. This preserves Source IP and avoids a second hop for
|
||||
// LoadBalancer and Nodeport type services.
|
||||
// externalTrafficPolicy denotes if this Service desires to route external
|
||||
// traffic to node-local or cluster-wide endpoints. "Local" preserves the
|
||||
// client source IP and avoids a second hop for LoadBalancer and Nodeport
|
||||
// type services, but risks potentially imbalanced traffic spreading.
|
||||
// "Cluster" obscures the client source IP and may cause a second hop to
|
||||
// another node, but should have good overall load-spreading.
|
||||
// +optional
|
||||
ExternalTrafficPolicy ServiceExternalTrafficPolicyType `json:"externalTrafficPolicy,omitempty" protobuf:"bytes,11,opt,name=externalTrafficPolicy"`
|
||||
|
||||
|
@ -1858,7 +1858,7 @@ var map_ServiceSpec = map[string]string{
|
||||
"loadBalancerIP": "Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature.",
|
||||
"loadBalancerSourceRanges": "If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature.\" More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/",
|
||||
"externalName": "externalName is the external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid DNS name and requires Type to be ExternalName.",
|
||||
"externalTrafficPolicy": "externalTrafficPolicy denotes if this Service desires to route external traffic to local endpoints only. This preserves Source IP and avoids a second hop for LoadBalancer and Nodeport type services.",
|
||||
"externalTrafficPolicy": "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.",
|
||||
"healthCheckNodePort": "healthCheckNodePort specifies the healthcheck nodePort for the service. If not specified, HealthCheckNodePort is created by the service api backend with the allocated nodePort. Will use user-specified nodePort value if specified by the client. Only effects when Type is set to LoadBalancer and ExternalTrafficPolicy is set to Local.",
|
||||
}
|
||||
|
||||
|
@ -1456,7 +1456,7 @@ var _ = framework.KubeDescribe("ESIPP [Slow]", func() {
|
||||
|
||||
By("turning ESIPP off")
|
||||
svc = jig.UpdateServiceOrFail(svc.Namespace, svc.Name, func(svc *v1.Service) {
|
||||
svc.Spec.ExternalTrafficPolicy = v1.ServiceExternalTrafficPolicyTypeGlobal
|
||||
svc.Spec.ExternalTrafficPolicy = v1.ServiceExternalTrafficPolicyTypeCluster
|
||||
})
|
||||
if service.GetServiceHealthCheckNodePort(svc) > 0 {
|
||||
framework.Failf("Service HealthCheck NodePort still present")
|
||||
|
Loading…
Reference in New Issue
Block a user