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
6bb97014
Commit
6bb97014
authored
Mar 27, 2015
by
Deyuan Deng
Committed by
Deyuan Deng
Apr 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Reachable Condition
parent
b9babb56
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
26 additions
and
105 deletions
+26
-105
v1beta1.json
api/swagger-spec/v1beta1.json
+0
-0
v1beta2.json
api/swagger-spec/v1beta2.json
+0
-0
v1beta3.json
api/swagger-spec/v1beta3.json
+0
-0
node.md
docs/node.md
+9
-15
types.go
pkg/api/types.go
+1
-3
conversion.go
pkg/api/v1beta1/conversion.go
+0
-6
types.go
pkg/api/v1beta1/types.go
+3
-3
conversion.go
pkg/api/v1beta2/conversion.go
+0
-6
types.go
pkg/api/v1beta2/types.go
+3
-3
types.go
pkg/api/v1beta3/types.go
+2
-4
resource_printer.go
pkg/kubectl/resource_printer.go
+1
-1
resource_printer_test.go
pkg/kubectl/resource_printer_test.go
+4
-15
factory.go
plugin/pkg/scheduler/factory/factory.go
+2
-6
factory_test.go
plugin/pkg/scheduler/factory/factory_test.go
+1
-43
No files found.
api/swagger-spec/v1beta1.json
View file @
6bb97014
This diff is collapsed.
Click to expand it.
api/swagger-spec/v1beta2.json
View file @
6bb97014
This diff is collapsed.
Click to expand it.
api/swagger-spec/v1beta3.json
View file @
6bb97014
This diff is collapsed.
Click to expand it.
docs/node.md
View file @
6bb97014
...
...
@@ -38,26 +38,20 @@ must have appropriate conditions, see below.
### Node Condition
Node Condition describes the conditions of
`Running`
nodes. Current valid
conditions are
`NodeReachable`
,
`NodeReady`
and
`NodeSchedulable`
. In the
future, we plan to add more.
`NodeReachable`
means the node can be reached
within the cluster.
`NodeReady`
means the kubelet returns StatusOK for HTTP
health check.
`NodeSchedulable`
means node is allowed to schedule any new
pods and is controlled by 'unschedulable' field in node spec.
Different condition provides different level of understanding for node
health. Kubernetes will make a comprehensive scheduling decision based on the
information. Node condition is represented as a json object. For example, the
following conditions mean the node is reachable from its cluster, node is in
sane state but not allowed to accept new pods:
conditions are
`NodeReady`
and
`NodeSchedulable`
. In the future, we plan to
add more.
`NodeReady`
means kubelet is healthy and ready to accept pods
`NodeSchedulable`
means node is allowed to schedule any new pods and is
controlled by 'unschedulable' field in node spec. Different condition provides
different level of understanding for node health. Kubernetes will make a
comprehensive scheduling decision based on the information. Node condition
is represented as a json object. For example, the following conditions mean
the node is in sane state but not allowed to accept new pods:
```
json
"conditions"
:
[
{
"kind"
:
"Reachable"
,
"status"
:
"True"
,
},
{
"kind"
:
"Ready"
,
"status"
:
"True"
,
},
},
{
"kind"
:
"Schedulable"
,
"status"
:
"False"
,
...
...
pkg/api/types.go
View file @
6bb97014
...
...
@@ -1069,9 +1069,7 @@ type NodeConditionType string
// node condition. In the future, we will add more. The proposed set of conditions are:
// NodeReachable, NodeLive, NodeReady, NodeSchedulable, NodeRunnable.
const
(
// NodeReachable means the node can be reached (in the sense of HTTP connection) from node controller.
NodeReachable
NodeConditionType
=
"Reachable"
// NodeReady means the node returns StatusOK for HTTP health check.
// NodeReady means kubelet is healthy and ready to accept pods.
NodeReady
NodeConditionType
=
"Ready"
// NodeSchedulable means the node is ready to accept new pods.
NodeSchedulable
NodeConditionType
=
"Schedulable"
...
...
pkg/api/v1beta1/conversion.go
View file @
6bb97014
...
...
@@ -1390,9 +1390,6 @@ func init() {
func
(
in
*
newer
.
NodeConditionType
,
out
*
NodeConditionKind
,
s
conversion
.
Scope
)
error
{
switch
*
in
{
case
newer
.
NodeReachable
:
*
out
=
NodeReachable
break
case
newer
.
NodeReady
:
*
out
=
NodeReady
break
...
...
@@ -1406,9 +1403,6 @@ func init() {
},
func
(
in
*
NodeConditionKind
,
out
*
newer
.
NodeConditionType
,
s
conversion
.
Scope
)
error
{
switch
*
in
{
case
NodeReachable
:
*
out
=
newer
.
NodeReachable
break
case
NodeReady
:
*
out
=
newer
.
NodeReady
break
...
...
pkg/api/v1beta1/types.go
View file @
6bb97014
...
...
@@ -917,16 +917,16 @@ type NodeConditionKind string
// node condition. In the future, we will add more. The proposed set of conditions are:
// NodeReachable, NodeLive, NodeReady, NodeSchedulable, NodeRunnable.
const
(
// NodeReachable means the node can be reached (in the sense of HTTP connection)
from node controll
er.
// NodeReachable means the node can be reached (in the sense of HTTP connection)
within clust
er.
NodeReachable
NodeConditionKind
=
"Reachable"
// NodeReady means
the node returns StatusOK for HTTP health check
.
// NodeReady means
kubelet is healthy and ready to accept pods
.
NodeReady
NodeConditionKind
=
"Ready"
// NodeSchedulable means the node is ready to accept new pods.
NodeSchedulable
NodeConditionKind
=
"Schedulable"
)
type
NodeCondition
struct
{
Kind
NodeConditionKind
`json:"kind" description:"kind of the condition, one of Reachable, Ready"`
Kind
NodeConditionKind
`json:"kind" description:"kind of the condition, one of Reachable, Ready
, Schedulable
"`
Status
ConditionStatus
`json:"status" description:"status of the condition, one of Full, None, Unknown"`
LastProbeTime
util
.
Time
`json:"lastProbeTime,omitempty" description:"last time the condition was probed"`
LastTransitionTime
util
.
Time
`json:"lastTransitionTime,omitempty" description:"last time the condition transit from one status to another"`
...
...
pkg/api/v1beta2/conversion.go
View file @
6bb97014
...
...
@@ -1317,9 +1317,6 @@ func init() {
func
(
in
*
newer
.
NodeConditionType
,
out
*
NodeConditionKind
,
s
conversion
.
Scope
)
error
{
switch
*
in
{
case
newer
.
NodeReachable
:
*
out
=
NodeReachable
break
case
newer
.
NodeReady
:
*
out
=
NodeReady
break
...
...
@@ -1333,9 +1330,6 @@ func init() {
},
func
(
in
*
NodeConditionKind
,
out
*
newer
.
NodeConditionType
,
s
conversion
.
Scope
)
error
{
switch
*
in
{
case
NodeReachable
:
*
out
=
newer
.
NodeReachable
break
case
NodeReady
:
*
out
=
newer
.
NodeReady
break
...
...
pkg/api/v1beta2/types.go
View file @
6bb97014
...
...
@@ -926,9 +926,9 @@ type NodeConditionKind string
// node condition. In the future, we will add more. The proposed set of conditions are:
// NodeReachable, NodeLive, NodeReady, NodeSchedulable, NodeRunnable.
const
(
// NodeReachable means the node can be reached (in the sense of HTTP connection)
from node controll
er.
// NodeReachable means the node can be reached (in the sense of HTTP connection)
within clust
er.
NodeReachable
NodeConditionKind
=
"Reachable"
// NodeReady means
the node returns StatusOK for HTTP health check
.
// NodeReady means
kubelet is healthy and ready to accept pods
.
NodeReady
NodeConditionKind
=
"Ready"
// NodeSchedulable means the node is ready to accept new pods.
NodeSchedulable
NodeConditionKind
=
"Schedulable"
...
...
@@ -938,7 +938,7 @@ const (
//
// https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/node.md#node-condition
type
NodeCondition
struct
{
Kind
NodeConditionKind
`json:"kind" description:"kind of the condition, one of Reachable, Ready"`
Kind
NodeConditionKind
`json:"kind" description:"kind of the condition, one of Reachable, Ready
, Schedulable
"`
Status
ConditionStatus
`json:"status" description:"status of the condition, one of Full, None, Unknown"`
LastProbeTime
util
.
Time
`json:"lastProbeTime,omitempty" description:"last time the condition was probed"`
LastTransitionTime
util
.
Time
`json:"lastTransitionTime,omitempty" description:"last time the condition transit from one status to another"`
...
...
pkg/api/v1beta3/types.go
View file @
6bb97014
...
...
@@ -1066,16 +1066,14 @@ type NodeConditionType string
// node condition. In the future, we will add more. The proposed set of conditions are:
// NodeReachable, NodeLive, NodeReady, NodeSchedulable, NodeRunnable.
const
(
// NodeReachable means the node can be reached (in the sense of HTTP connection) from node controller.
NodeReachable
NodeConditionType
=
"Reachable"
// NodeReady means the node returns StatusOK for HTTP health check.
// NodeReady means kubelet is healthy and ready to accept pods.
NodeReady
NodeConditionType
=
"Ready"
// NodeSchedulable means the node is ready to accept new pods.
NodeSchedulable
NodeConditionType
=
"Schedulable"
)
type
NodeCondition
struct
{
Type
NodeConditionType
`json:"type" description:"type of node condition, one of Rea
chable, Ready
"`
Type
NodeConditionType
`json:"type" description:"type of node condition, one of Rea
dy, Schedulable
"`
Status
ConditionStatus
`json:"status" description:"status of the condition, one of Full, None, Unknown"`
LastProbeTime
util
.
Time
`json:"lastProbeTime,omitempty" description:"last time the condition was probed"`
LastTransitionTime
util
.
Time
`json:"lastTransitionTime,omitempty" description:"last time the condition transit from one status to another"`
...
...
pkg/kubectl/resource_printer.go
View file @
6bb97014
...
...
@@ -458,7 +458,7 @@ func printSecretList(list *api.SecretList, w io.Writer) error {
func
printNode
(
node
*
api
.
Node
,
w
io
.
Writer
)
error
{
conditionMap
:=
make
(
map
[
api
.
NodeConditionType
]
*
api
.
NodeCondition
)
NodeAllConditions
:=
[]
api
.
NodeConditionType
{
api
.
NodeSchedulable
,
api
.
NodeReady
,
api
.
NodeReachable
}
NodeAllConditions
:=
[]
api
.
NodeConditionType
{
api
.
NodeSchedulable
,
api
.
NodeReady
}
for
i
:=
range
node
.
Status
.
Conditions
{
cond
:=
node
.
Status
.
Conditions
[
i
]
conditionMap
[
cond
.
Type
]
=
&
cond
...
...
pkg/kubectl/resource_printer_test.go
View file @
6bb97014
...
...
@@ -551,15 +551,6 @@ func TestPrintMinionStatus(t *testing.T) {
},
{
minion
:
api
.
Node
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"foo2"
},
Status
:
api
.
NodeStatus
{
Conditions
:
[]
api
.
NodeCondition
{
{
Type
:
api
.
NodeReady
,
Status
:
api
.
ConditionTrue
},
{
Type
:
api
.
NodeReachable
,
Status
:
api
.
ConditionTrue
}}},
},
status
:
"Ready,Reachable"
,
},
{
minion
:
api
.
Node
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"foo3"
},
Status
:
api
.
NodeStatus
{
Conditions
:
[]
api
.
NodeCondition
{
{
Type
:
api
.
NodeReady
,
Status
:
api
.
ConditionTrue
},
...
...
@@ -593,20 +584,18 @@ func TestPrintMinionStatus(t *testing.T) {
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"foo7"
},
Status
:
api
.
NodeStatus
{
Conditions
:
[]
api
.
NodeCondition
{
{
Type
:
api
.
NodeSchedulable
,
Status
:
api
.
ConditionTrue
},
{
Type
:
api
.
NodeReady
,
Status
:
api
.
ConditionTrue
},
{
Type
:
api
.
NodeReachable
,
Status
:
api
.
ConditionTrue
}}},
{
Type
:
api
.
NodeReady
,
Status
:
api
.
ConditionTrue
}}},
},
status
:
"Schedulable,Ready
,Reachable
"
,
status
:
"Schedulable,Ready"
,
},
{
minion
:
api
.
Node
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"foo8"
},
Status
:
api
.
NodeStatus
{
Conditions
:
[]
api
.
NodeCondition
{
{
Type
:
api
.
NodeSchedulable
,
Status
:
api
.
ConditionFalse
},
{
Type
:
api
.
NodeReady
,
Status
:
api
.
ConditionFalse
},
{
Type
:
api
.
NodeReachable
,
Status
:
api
.
ConditionTrue
}}},
{
Type
:
api
.
NodeReady
,
Status
:
api
.
ConditionFalse
}}},
},
status
:
"NotSchedulable,NotReady
,Reachable
"
,
status
:
"NotSchedulable,NotReady"
,
},
}
...
...
plugin/pkg/scheduler/factory/factory.go
View file @
6bb97014
...
...
@@ -256,14 +256,10 @@ func (factory *ConfigFactory) pollMinions() (cache.Enumerator, error) {
if
condition
.
Status
==
api
.
ConditionTrue
{
nodes
.
Items
=
append
(
nodes
.
Items
,
node
)
}
}
else
if
condition
,
ok
:=
conditionMap
[
api
.
NodeReachable
];
ok
{
if
condition
.
Status
==
api
.
ConditionTrue
{
nodes
.
Items
=
append
(
nodes
.
Items
,
node
)
}
}
else
{
// If no condition is set, we get unknown node condition. In such cases,
// do not add the node
glog
.
V
(
2
)
.
Infof
(
"Minion %s is not available.
Skipping"
,
node
.
Name
)
// do not add the node
.
glog
.
V
(
2
)
.
Infof
(
"Minion %s is not available. Skipping"
,
node
.
Name
)
}
}
return
&
nodeEnumerator
{
nodes
},
nil
...
...
plugin/pkg/scheduler/factory/factory_test.go
View file @
6bb97014
...
...
@@ -147,14 +147,6 @@ func TestPollMinions(t *testing.T) {
},
},
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"bar"
},
Status
:
api
.
NodeStatus
{
Conditions
:
[]
api
.
NodeCondition
{
{
Type
:
api
.
NodeReachable
,
Status
:
api
.
ConditionTrue
},
},
},
},
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"fiz"
},
Status
:
api
.
NodeStatus
{
Conditions
:
[]
api
.
NodeCondition
{
...
...
@@ -163,15 +155,6 @@ func TestPollMinions(t *testing.T) {
},
},
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"biz"
},
Status
:
api
.
NodeStatus
{
Conditions
:
[]
api
.
NodeCondition
{
{
Type
:
api
.
NodeReady
,
Status
:
api
.
ConditionTrue
},
{
Type
:
api
.
NodeReachable
,
Status
:
api
.
ConditionTrue
},
},
},
},
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"baz"
},
Status
:
api
.
NodeStatus
{
Conditions
:
[]
api
.
NodeCondition
{
...
...
@@ -186,7 +169,6 @@ func TestPollMinions(t *testing.T) {
Conditions
:
[]
api
.
NodeCondition
{
{
Type
:
api
.
NodeSchedulable
,
Status
:
api
.
ConditionTrue
},
{
Type
:
api
.
NodeReady
,
Status
:
api
.
ConditionTrue
},
{
Type
:
api
.
NodeReachable
,
Status
:
api
.
ConditionTrue
},
},
},
},
...
...
@@ -196,7 +178,6 @@ func TestPollMinions(t *testing.T) {
Conditions
:
[]
api
.
NodeCondition
{
{
Type
:
api
.
NodeSchedulable
,
Status
:
api
.
ConditionFalse
},
{
Type
:
api
.
NodeReady
,
Status
:
api
.
ConditionTrue
},
{
Type
:
api
.
NodeReachable
,
Status
:
api
.
ConditionTrue
},
},
},
},
...
...
@@ -206,21 +187,11 @@ func TestPollMinions(t *testing.T) {
Conditions
:
[]
api
.
NodeCondition
{
{
Type
:
api
.
NodeSchedulable
,
Status
:
api
.
ConditionTrue
},
{
Type
:
api
.
NodeReady
,
Status
:
api
.
ConditionFalse
},
{
Type
:
api
.
NodeReachable
,
Status
:
api
.
ConditionTrue
},
},
},
},
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"fizbiz"
},
Status
:
api
.
NodeStatus
{
Conditions
:
[]
api
.
NodeCondition
{
{
Type
:
api
.
NodeSchedulable
,
Status
:
api
.
ConditionTrue
},
{
Type
:
api
.
NodeReachable
,
Status
:
api
.
ConditionFalse
},
},
},
},
},
expectedCount
:
5
,
expectedCount
:
3
,
},
{
minions
:
[]
api
.
Node
{
...
...
@@ -271,19 +242,6 @@ func TestPollMinions(t *testing.T) {
Status
:
api
.
NodeStatus
{
Conditions
:
[]
api
.
NodeCondition
{
{
Type
:
api
.
NodeReady
,
Status
:
api
.
ConditionTrue
},
{
Type
:
api
.
NodeReachable
,
Status
:
api
.
ConditionFalse
}},
},
},
},
expectedCount
:
1
,
},
{
minions
:
[]
api
.
Node
{
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"foo"
},
Status
:
api
.
NodeStatus
{
Conditions
:
[]
api
.
NodeCondition
{
{
Type
:
api
.
NodeReachable
,
Status
:
api
.
ConditionTrue
},
{
Type
:
"invalidValue"
,
Status
:
api
.
ConditionFalse
}},
},
},
...
...
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