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
a4574bbb
Commit
a4574bbb
authored
Oct 04, 2017
by
Davanum Srinivas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure pkg/controller/service does not depend on cmd/kubeadm/app
parent
e51e714a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
10 deletions
+13
-10
BUILD
cmd/kubeadm/app/constants/BUILD
+1
-0
constants.go
cmd/kubeadm/app/constants/constants.go
+2
-6
BUILD
pkg/controller/service/BUILD
+0
-1
service_controller.go
pkg/controller/service/service_controller.go
+10
-3
No files found.
cmd/kubeadm/app/constants/BUILD
View file @
a4574bbb
...
...
@@ -10,6 +10,7 @@ go_library(
name = "go_default_library",
srcs = ["constants.go"],
deps = [
"//pkg/controller/service:go_default_library",
"//pkg/util/version:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
],
...
...
cmd/kubeadm/app/constants/constants.go
View file @
a4574bbb
...
...
@@ -24,6 +24,7 @@ import (
"time"
"k8s.io/api/core/v1"
"k8s.io/kubernetes/pkg/controller/service"
"k8s.io/kubernetes/pkg/util/version"
)
...
...
@@ -131,12 +132,7 @@ const (
DefaultTokenDuration
=
24
*
time
.
Hour
// LabelNodeRoleMaster specifies that a node is a master
// It's copied over to kubeadm until it's merged in core: https://github.com/kubernetes/kubernetes/pull/39112
LabelNodeRoleMaster
=
"node-role.kubernetes.io/master"
// LabelNodeRoleExcludeBalancer specifies that the node should be
// exclude from load balancers created by a cloud provider.
LabelNodeRoleExcludeBalancer
=
"alpha.node-role.kubernetes.io/exclude-balancer"
LabelNodeRoleMaster
=
service
.
LabelNodeRoleMaster
// MasterConfigurationConfigMap specifies in what ConfigMap in the kube-system namespace the `kubeadm init` configuration should be stored
MasterConfigurationConfigMap
=
"kubeadm-config"
...
...
pkg/controller/service/BUILD
View file @
a4574bbb
...
...
@@ -13,7 +13,6 @@ go_library(
"service_controller.go",
],
deps = [
"//cmd/kubeadm/app/constants:go_default_library",
"//pkg/api/v1/helper:go_default_library",
"//pkg/cloudprovider:go_default_library",
"//pkg/controller:go_default_library",
...
...
pkg/controller/service/service_controller.go
View file @
a4574bbb
...
...
@@ -37,7 +37,6 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/record"
"k8s.io/client-go/util/workqueue"
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
v1helper
"k8s.io/kubernetes/pkg/api/v1/helper"
"k8s.io/kubernetes/pkg/cloudprovider"
"k8s.io/kubernetes/pkg/controller"
...
...
@@ -63,6 +62,14 @@ const (
notRetryable
=
false
doNotRetry
=
time
.
Duration
(
0
)
// LabelNodeRoleMaster specifies that a node is a master
// It's copied over to kubeadm until it's merged in core: https://github.com/kubernetes/kubernetes/pull/39112
LabelNodeRoleMaster
=
"node-role.kubernetes.io/master"
// LabelNodeRoleExcludeBalancer specifies that the node should be
// exclude from load balancers created by a cloud provider.
LabelNodeRoleExcludeBalancer
=
"node.role.kubernetes.io/exclude-balancer"
)
type
cachedService
struct
{
...
...
@@ -595,11 +602,11 @@ func getNodeConditionPredicate() corelisters.NodeConditionPredicate {
// As of 1.6, we will taint the master, but not necessarily mark it unschedulable.
// Recognize nodes labeled as master, and filter them also, as we were doing previously.
if
_
,
hasMasterRoleLabel
:=
node
.
Labels
[
constants
.
LabelNodeRoleMaster
];
hasMasterRoleLabel
{
if
_
,
hasMasterRoleLabel
:=
node
.
Labels
[
LabelNodeRoleMaster
];
hasMasterRoleLabel
{
return
false
}
if
_
,
hasExcludeBalancerLabel
:=
node
.
Labels
[
constants
.
LabelNodeRoleExcludeBalancer
];
hasExcludeBalancerLabel
{
if
_
,
hasExcludeBalancerLabel
:=
node
.
Labels
[
LabelNodeRoleExcludeBalancer
];
hasExcludeBalancerLabel
{
return
false
}
...
...
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