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
759f12a7
Commit
759f12a7
authored
Nov 26, 2018
by
Yang Li
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into release-1.13
parents
80b400f6
1e50c571
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
6 deletions
+32
-6
constant.go
cmd/kubeadm/app/cmd/options/constant.go
+1
-1
generic.go
cmd/kubeadm/app/cmd/options/generic.go
+1
-1
markcontrolplane.go
cmd/kubeadm/app/cmd/phases/markcontrolplane.go
+1
-0
get.go
pkg/kubectl/cmd/get/get.go
+7
-4
get_test.go
pkg/kubectl/cmd/get/get_test.go
+9
-0
cluster_size_autoscaling.go
test/e2e/autoscaling/cluster_size_autoscaling.go
+13
-0
No files found.
cmd/kubeadm/app/cmd/options/constant.go
View file @
759f12a7
...
@@ -31,7 +31,7 @@ const APIServerExtraArgs = "apiserver-extra-args"
...
@@ -31,7 +31,7 @@ const APIServerExtraArgs = "apiserver-extra-args"
// CertificatesDir flag sets the path where to save and read the certificates.
// CertificatesDir flag sets the path where to save and read the certificates.
const
CertificatesDir
=
"cert-dir"
const
CertificatesDir
=
"cert-dir"
// CfgPath flag sets the path to kubeadm config file.
WARNING: Usage of a configuration file is experimental.
// CfgPath flag sets the path to kubeadm config file.
const
CfgPath
=
"config"
const
CfgPath
=
"config"
// ControllerManagerExtraArgs flag sets extra flags to pass to the Controller Manager or override default ones in form of <flagname>=<value>.
// ControllerManagerExtraArgs flag sets extra flags to pass to the Controller Manager or override default ones in form of <flagname>=<value>.
...
...
cmd/kubeadm/app/cmd/options/generic.go
View file @
759f12a7
...
@@ -33,7 +33,7 @@ func AddKubeConfigDirFlag(fs *pflag.FlagSet, kubeConfigDir *string) {
...
@@ -33,7 +33,7 @@ func AddKubeConfigDirFlag(fs *pflag.FlagSet, kubeConfigDir *string) {
// AddConfigFlag adds the --config flag to the given flagset
// AddConfigFlag adds the --config flag to the given flagset
func
AddConfigFlag
(
fs
*
pflag
.
FlagSet
,
cfgPath
*
string
)
{
func
AddConfigFlag
(
fs
*
pflag
.
FlagSet
,
cfgPath
*
string
)
{
fs
.
StringVar
(
cfgPath
,
CfgPath
,
*
cfgPath
,
"Path to
kubeadm config file (WARNING: Usage of a configuration file is experimental)
."
)
fs
.
StringVar
(
cfgPath
,
CfgPath
,
*
cfgPath
,
"Path to
a kubeadm configuration file
."
)
}
}
// AddIgnorePreflightErrorsFlag adds the --ignore-preflight-errors flag to the given flagset
// AddIgnorePreflightErrorsFlag adds the --ignore-preflight-errors flag to the given flagset
...
...
cmd/kubeadm/app/cmd/phases/markcontrolplane.go
View file @
759f12a7
...
@@ -50,6 +50,7 @@ func NewMarkControlPlanePhase() workflow.Phase {
...
@@ -50,6 +50,7 @@ func NewMarkControlPlanePhase() workflow.Phase {
Example
:
markControlPlaneExample
,
Example
:
markControlPlaneExample
,
InheritFlags
:
[]
string
{
InheritFlags
:
[]
string
{
options
.
NodeName
,
options
.
NodeName
,
options
.
CfgPath
,
},
},
Run
:
runMarkControlPlane
,
Run
:
runMarkControlPlane
,
}
}
...
...
pkg/kubectl/cmd/get/get.go
View file @
759f12a7
...
@@ -314,11 +314,14 @@ type RuntimeSorter struct {
...
@@ -314,11 +314,14 @@ type RuntimeSorter struct {
}
}
func
(
r
*
RuntimeSorter
)
Sort
()
error
{
func
(
r
*
RuntimeSorter
)
Sort
()
error
{
if
len
(
r
.
objects
)
<=
1
{
// a list is only considered "sorted" if there are 0 or 1 items in it
// a list is only considered "sorted" if there are 0 or 1 items in it
// AND (if 1 item) the item is not a Table object
// AND (if 1 item) the item is not a Table object
if
len
(
r
.
objects
)
==
0
{
return
nil
}
if
len
(
r
.
objects
)
==
1
{
_
,
isTable
:=
r
.
objects
[
0
]
.
(
*
metav1beta1
.
Table
)
_
,
isTable
:=
r
.
objects
[
0
]
.
(
*
metav1beta1
.
Table
)
if
len
(
r
.
objects
)
==
0
||
!
isTable
{
if
!
isTable
{
return
nil
return
nil
}
}
}
}
...
...
pkg/kubectl/cmd/get/get_test.go
View file @
759f12a7
...
@@ -561,6 +561,15 @@ func TestRuntimeSorter(t *testing.T) {
...
@@ -561,6 +561,15 @@ func TestRuntimeSorter(t *testing.T) {
expectError
string
expectError
string
}{
}{
{
{
name
:
"ensure sorter works with an empty object list"
,
field
:
"metadata.name"
,
objs
:
[]
runtime
.
Object
{},
op
:
func
(
sorter
*
RuntimeSorter
,
objs
[]
runtime
.
Object
,
out
io
.
Writer
)
error
{
return
nil
},
expect
:
""
,
},
{
name
:
"ensure sorter returns original position"
,
name
:
"ensure sorter returns original position"
,
field
:
"metadata.name"
,
field
:
"metadata.name"
,
objs
:
sortTestData
(),
objs
:
sortTestData
(),
...
...
test/e2e/autoscaling/cluster_size_autoscaling.go
View file @
759f12a7
...
@@ -881,6 +881,19 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
...
@@ -881,6 +881,19 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
clusterSize
=
manuallyIncreaseClusterSize
(
f
,
originalSizes
)
clusterSize
=
manuallyIncreaseClusterSize
(
f
,
originalSizes
)
}
}
// If new nodes are disconnected too soon, they'll be considered not started
// instead of unready, and cluster won't be considered unhealthy.
//
// More precisely, Cluster Autoscaler compares last transition time of
// several readiness conditions to node create time. If it's within
// 2 minutes, it'll assume node is just starting and not unhealthy.
//
// Nodes become ready in less than 1 minute after being created,
// so waiting extra 2 minutes before breaking them (which triggers
// readiness condition transition) should be sufficient, while
// making no assumptions about minimal node startup time.
time
.
Sleep
(
2
*
time
.
Minute
)
By
(
"Block network connectivity to some nodes to simulate unhealthy cluster"
)
By
(
"Block network connectivity to some nodes to simulate unhealthy cluster"
)
nodesToBreakCount
:=
int
(
math
.
Ceil
(
math
.
Max
(
float64
(
unhealthyClusterThreshold
),
0.5
*
float64
(
clusterSize
))))
nodesToBreakCount
:=
int
(
math
.
Ceil
(
math
.
Max
(
float64
(
unhealthyClusterThreshold
),
0.5
*
float64
(
clusterSize
))))
nodes
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Nodes
()
.
List
(
metav1
.
ListOptions
{
FieldSelector
:
fields
.
Set
{
nodes
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Nodes
()
.
List
(
metav1
.
ListOptions
{
FieldSelector
:
fields
.
Set
{
...
...
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