Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
73fa1ddc
Commit
73fa1ddc
authored
May 02, 2017
by
Zihong Zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define ESIPP GA fields and deprecate alpha annotations
parent
640373da
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
29 deletions
+65
-29
annotations.go
pkg/api/service/annotations.go
+8
-14
types.go
pkg/api/types.go
+24
-0
annotations.go
pkg/api/v1/service/annotations.go
+8
-14
types.go
pkg/api/v1/types.go
+24
-0
kube_features.go
pkg/features/kube_features.go
+1
-1
No files found.
pkg/api/service/annotations.go
View file @
73fa1ddc
...
...
@@ -26,25 +26,19 @@ const (
// Not all cloud providers support this annotation, though AWS & GCE do.
AnnotationLoadBalancerSourceRangesKey
=
"service.beta.kubernetes.io/load-balancer-source-ranges"
// AnnotationValueExternalTrafficLocal Value of annotation to specify local endpoints behavio
ur
// AnnotationValueExternalTrafficLocal Value of annotation to specify local endpoints behavio
r.
AnnotationValueExternalTrafficLocal
=
"OnlyLocal"
// AnnotationValueExternalTrafficGlobal Value of annotation to specify global (legacy) behavio
ur
// AnnotationValueExternalTrafficGlobal Value of annotation to specify global (legacy) behavio
r.
AnnotationValueExternalTrafficGlobal
=
"Global"
// TODO: The
alpha annotations have been deprecated, remove them when we move this feature to GA
.
// TODO: The
beta annotations have been deprecated, remove them when we release k8s 1.8
.
// AlphaAnnotationHealthCheckNodePort Annotation specifying the healthcheck nodePort for the service
// If not specified, annotation is created by the service api backend with the allocated nodePort
// Will use user-specified nodePort value if specified by the client
AlphaAnnotationHealthCheckNodePort
=
"service.alpha.kubernetes.io/healthcheck-nodeport"
// AlphaAnnotationExternalTraffic An annotation that denotes if this Service desires to route external traffic to local
// endpoints only. This preserves Source IP and avoids a second hop.
AlphaAnnotationExternalTraffic
=
"service.alpha.kubernetes.io/external-traffic"
// BetaAnnotationHealthCheckNodePort is the beta version of AlphaAnnotationHealthCheckNodePort.
// BetaAnnotationHealthCheckNodePort Annotation specifying the healthcheck nodePort for the service.
// If not specified, annotation is created by the service api backend with the allocated nodePort.
// Will use user-specified nodePort value if specified by the client.
BetaAnnotationHealthCheckNodePort
=
"service.beta.kubernetes.io/healthcheck-nodeport"
// BetaAnnotationExternalTraffic is the beta version of AlphaAnnotationExternalTraffic.
// BetaAnnotationExternalTraffic An annotation that denotes if this Service desires to route
// external traffic to local endpoints only. This preserves Source IP and avoids a second hop.
BetaAnnotationExternalTraffic
=
"service.beta.kubernetes.io/external-traffic"
)
pkg/api/types.go
View file @
73fa1ddc
...
...
@@ -2453,6 +2453,16 @@ const (
ServiceTypeExternalName
ServiceType
=
"ExternalName"
)
// Service External Traffic Policy Type string
type
ServiceExternalTrafficPolicyType
string
const
(
// ServiceExternalTrafficPolicyTypeLocal specifies local endpoints behavior.
ServiceExternalTrafficPolicyTypeLocal
ServiceExternalTrafficPolicyType
=
"Local"
// ServiceExternalTrafficPolicyTypeGlobal specifies global (legacy) behavior.
ServiceExternalTrafficPolicyTypeGlobal
ServiceExternalTrafficPolicyType
=
"Global"
)
// ServiceStatus represents the current status of a service
type
ServiceStatus
struct
{
// LoadBalancer contains the current status of the load-balancer,
...
...
@@ -2552,6 +2562,20 @@ type ServiceSpec struct {
// cloud-provider does not support the feature."
// +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.
// +optional
ExternalTrafficPolicy
ServiceExternalTrafficPolicyType
// 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.
// +optional
HealthCheckNodePort
int32
}
type
ServicePort
struct
{
...
...
pkg/api/v1/service/annotations.go
View file @
73fa1ddc
...
...
@@ -26,25 +26,19 @@ const (
// Not all cloud providers support this annotation, though AWS & GCE do.
AnnotationLoadBalancerSourceRangesKey
=
"service.beta.kubernetes.io/load-balancer-source-ranges"
// AnnotationValueExternalTrafficLocal Value of annotation to specify local endpoints behavio
ur
// AnnotationValueExternalTrafficLocal Value of annotation to specify local endpoints behavio
r.
AnnotationValueExternalTrafficLocal
=
"OnlyLocal"
// AnnotationValueExternalTrafficGlobal Value of annotation to specify global (legacy) behavio
ur
// AnnotationValueExternalTrafficGlobal Value of annotation to specify global (legacy) behavio
r.
AnnotationValueExternalTrafficGlobal
=
"Global"
// TODO: The
alpha annotations have been deprecated, remove them when we move this feature to GA
.
// TODO: The
beta annotations have been deprecated, remove them when we release k8s 1.8
.
// AlphaAnnotationHealthCheckNodePort Annotation specifying the healthcheck nodePort for the service
// If not specified, annotation is created by the service api backend with the allocated nodePort
// Will use user-specified nodePort value if specified by the client
AlphaAnnotationHealthCheckNodePort
=
"service.alpha.kubernetes.io/healthcheck-nodeport"
// AlphaAnnotationExternalTraffic An annotation that denotes if this Service desires to route external traffic to local
// endpoints only. This preserves Source IP and avoids a second hop.
AlphaAnnotationExternalTraffic
=
"service.alpha.kubernetes.io/external-traffic"
// BetaAnnotationHealthCheckNodePort is the beta version of AlphaAnnotationHealthCheckNodePort.
// BetaAnnotationHealthCheckNodePort Annotation specifying the healthcheck nodePort for the service.
// If not specified, annotation is created by the service api backend with the allocated nodePort.
// Will use user-specified nodePort value if specified by the client.
BetaAnnotationHealthCheckNodePort
=
"service.beta.kubernetes.io/healthcheck-nodeport"
// BetaAnnotationExternalTraffic is the beta version of AlphaAnnotationExternalTraffic.
// BetaAnnotationExternalTraffic An annotation that denotes if this Service desires to route
// external traffic to local endpoints only. This preserves Source IP and avoids a second hop.
BetaAnnotationExternalTraffic
=
"service.beta.kubernetes.io/external-traffic"
)
pkg/api/v1/types.go
View file @
73fa1ddc
...
...
@@ -2792,6 +2792,16 @@ const (
ServiceTypeExternalName
ServiceType
=
"ExternalName"
)
// Service External Traffic Policy Type string
type
ServiceExternalTrafficPolicyType
string
const
(
// ServiceExternalTrafficPolicyTypeLocal specifies local endpoints behavior.
ServiceExternalTrafficPolicyTypeLocal
ServiceExternalTrafficPolicyType
=
"Local"
// ServiceExternalTrafficPolicyTypeGlobal specifies global (legacy) behavior.
ServiceExternalTrafficPolicyTypeGlobal
ServiceExternalTrafficPolicyType
=
"Global"
)
// ServiceStatus represents the current status of a service.
type
ServiceStatus
struct
{
// LoadBalancer contains the current status of the load-balancer,
...
...
@@ -2904,6 +2914,20 @@ type ServiceSpec struct {
// Must be a valid DNS name and requires Type to be ExternalName.
// +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.
// +optional
ExternalTrafficPolicy
ServiceExternalTrafficPolicyType
`json:"externalTrafficPolicy,omitempty" protobuf:"bytes,11,opt,name=externalTrafficPolicy"`
// 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.
// +optional
HealthCheckNodePort
int32
`json:"healthCheckNodePort,omitempty" protobuf:"bytes,12,opt,name=healthCheckNodePort"`
}
// ServicePort contains information on service's port.
...
...
pkg/features/kube_features.go
View file @
73fa1ddc
...
...
@@ -98,7 +98,7 @@ func init() {
// To add a new feature, define a key for it above and add it here. The features will be
// available throughout Kubernetes binaries.
var
defaultKubernetesFeatureGates
=
map
[
utilfeature
.
Feature
]
utilfeature
.
FeatureSpec
{
ExternalTrafficLocalOnly
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
ExternalTrafficLocalOnly
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
},
AppArmor
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
DynamicKubeletConfig
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
DynamicVolumeProvisioning
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Alpha
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment