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
1cac5db8
Commit
1cac5db8
authored
May 01, 2017
by
Zihong Zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix onlylocal endpoint's healthcheck nodeport logic
parent
3ec39c35
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
16 deletions
+3
-16
util.go
pkg/api/service/util.go
+0
-3
util.go
pkg/api/v1/service/util.go
+0
-3
proxier.go
pkg/proxy/iptables/proxier.go
+3
-10
No files found.
pkg/api/service/util.go
View file @
1cac5db8
...
...
@@ -105,9 +105,6 @@ func NeedsHealthCheck(service *api.Service) bool {
// GetServiceHealthCheckNodePort Return health check node port annotation for service, if one exists
func
GetServiceHealthCheckNodePort
(
service
*
api
.
Service
)
int32
{
if
!
NeedsHealthCheck
(
service
)
{
return
0
}
// First check the alpha annotation and then the beta. This is so existing
// Services continue to work till the user decides to transition to beta.
// If they transition to beta, there's no way to go back to alpha without
...
...
pkg/api/v1/service/util.go
View file @
1cac5db8
...
...
@@ -105,9 +105,6 @@ func NeedsHealthCheck(service *v1.Service) bool {
// GetServiceHealthCheckNodePort Return health check node port annotation for service, if one exists
func
GetServiceHealthCheckNodePort
(
service
*
v1
.
Service
)
int32
{
if
!
NeedsHealthCheck
(
service
)
{
return
0
}
// First check the alpha annotation and then the beta. This is so existing
// Services continue to work till the user decides to transition to beta.
// If they transition to beta, there's no way to go back to alpha without
...
...
pkg/proxy/iptables/proxier.go
View file @
1cac5db8
...
...
@@ -181,11 +181,10 @@ func newServiceInfo(serviceName proxy.ServicePortName, port *api.ServicePort, se
copy
(
info
.
loadBalancerSourceRanges
,
service
.
Spec
.
LoadBalancerSourceRanges
)
copy
(
info
.
externalIPs
,
service
.
Spec
.
ExternalIPs
)
if
info
.
onlyNodeLocalEndpoints
{
if
apiservice
.
NeedsHealthCheck
(
service
)
{
p
:=
apiservice
.
GetServiceHealthCheckNodePort
(
service
)
if
p
==
0
{
glog
.
Errorf
(
"Service does not contain necessary annotation %v"
,
apiservice
.
BetaAnnotationHealthCheckNodePort
)
glog
.
Errorf
(
"Service %q has no healthcheck nodeport"
,
serviceName
)
}
else
{
info
.
healthCheckNodePort
=
int
(
p
)
}
...
...
@@ -644,16 +643,10 @@ func updateServiceMap(
// computing this incrementally similarly to serviceMap.
hcServices
=
make
(
map
[
types
.
NamespacedName
]
uint16
)
for
svcPort
,
info
:=
range
serviceMap
{
if
info
.
onlyNodeLocalEndpoints
{
if
info
.
healthCheckNodePort
!=
0
{
hcServices
[
svcPort
.
NamespacedName
]
=
uint16
(
info
.
healthCheckNodePort
)
}
}
for
nsn
,
port
:=
range
hcServices
{
if
port
==
0
{
glog
.
Errorf
(
"Service %q has no healthcheck nodeport"
,
nsn
)
delete
(
hcServices
,
nsn
)
}
}
return
syncRequired
,
hcServices
,
staleServices
}
...
...
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