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
3c84164b
Commit
3c84164b
authored
Oct 24, 2016
by
Kubernetes Submit Queue
Committed by
GitHub
Oct 24, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #33347 from justinsb/fix_32900
Automatic merge from submit-queue bootstrap: Start hostNetwork pods even if network plugin not ready
parents
37dc74fa
6465742d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
23 additions
and
17 deletions
+23
-17
configure-vm-aws.sh
cluster/aws/templates/configure-vm-aws.sh
+0
-2
configure-vm.sh
cluster/gce/configure-vm.sh
+0
-2
configure-helper.sh
cluster/gce/gci/configure-helper.sh
+1
-5
configure-helper.sh
cluster/gce/trusty/configure-helper.sh
+1
-1
default
cluster/saltbase/salt/kubelet/default
+0
-1
kubelet.go
pkg/kubelet/kubelet.go
+7
-1
kubelet_node_status.go
pkg/kubelet/kubelet_node_status.go
+2
-1
runonce_test.go
pkg/kubelet/runonce_test.go
+1
-0
runtime.go
pkg/kubelet/runtime.go
+11
-4
No files found.
cluster/aws/templates/configure-vm-aws.sh
View file @
3c84164b
...
@@ -91,7 +91,6 @@ EOF
...
@@ -91,7 +91,6 @@ EOF
if
[[
!
-z
"
${
KUBELET_APISERVER
:-}
"
]]
&&
[[
!
-z
"
${
KUBELET_CERT
:-}
"
]]
&&
[[
!
-z
"
${
KUBELET_KEY
:-}
"
]]
;
then
if
[[
!
-z
"
${
KUBELET_APISERVER
:-}
"
]]
&&
[[
!
-z
"
${
KUBELET_CERT
:-}
"
]]
&&
[[
!
-z
"
${
KUBELET_KEY
:-}
"
]]
;
then
cat
<<
EOF
>>/etc/salt/minion.d/grains.conf
cat
<<
EOF
>>/etc/salt/minion.d/grains.conf
kubelet_api_servers: '
${
KUBELET_APISERVER
}
'
kubelet_api_servers: '
${
KUBELET_APISERVER
}
'
cbr-cidr: 10.123.45.0/29
EOF
EOF
else
else
# If the kubelet is running disconnected from a master, give it a fixed
# If the kubelet is running disconnected from a master, give it a fixed
...
@@ -110,7 +109,6 @@ salt-node-role() {
...
@@ -110,7 +109,6 @@ salt-node-role() {
grains:
grains:
roles:
roles:
- kubernetes-pool
- kubernetes-pool
cbr-cidr: 10.123.45.0/29
cloud: aws
cloud: aws
api_servers: '
${
API_SERVERS
}
'
api_servers: '
${
API_SERVERS
}
'
EOF
EOF
...
...
cluster/gce/configure-vm.sh
View file @
3c84164b
...
@@ -949,7 +949,6 @@ EOF
...
@@ -949,7 +949,6 @@ EOF
if
[[
!
-z
"
${
KUBELET_APISERVER
:-}
"
]]
&&
[[
!
-z
"
${
KUBELET_CERT
:-}
"
]]
&&
[[
!
-z
"
${
KUBELET_KEY
:-}
"
]]
;
then
if
[[
!
-z
"
${
KUBELET_APISERVER
:-}
"
]]
&&
[[
!
-z
"
${
KUBELET_CERT
:-}
"
]]
&&
[[
!
-z
"
${
KUBELET_KEY
:-}
"
]]
;
then
cat
<<
EOF
>>/etc/salt/minion.d/grains.conf
cat
<<
EOF
>>/etc/salt/minion.d/grains.conf
kubelet_api_servers: '
${
KUBELET_APISERVER
}
'
kubelet_api_servers: '
${
KUBELET_APISERVER
}
'
cbr-cidr: 10.123.45.0/29
EOF
EOF
else
else
# If the kubelet is running disconnected from a master, give it a fixed
# If the kubelet is running disconnected from a master, give it a fixed
...
@@ -968,7 +967,6 @@ function salt-node-role() {
...
@@ -968,7 +967,6 @@ function salt-node-role() {
grains:
grains:
roles:
roles:
- kubernetes-pool
- kubernetes-pool
cbr-cidr: 10.123.45.0/29
cloud: gce
cloud: gce
api_servers: '
${
KUBERNETES_MASTER_NAME
}
'
api_servers: '
${
KUBERNETES_MASTER_NAME
}
'
EOF
EOF
...
...
cluster/gce/gci/configure-helper.sh
View file @
3c84164b
...
@@ -486,12 +486,8 @@ function start-kubelet {
...
@@ -486,12 +486,8 @@ function start-kubelet {
if
[[
!
-z
"
${
KUBELET_APISERVER
:-}
"
&&
!
-z
"
${
KUBELET_CERT
:-}
"
&&
!
-z
"
${
KUBELET_KEY
:-}
"
]]
;
then
if
[[
!
-z
"
${
KUBELET_APISERVER
:-}
"
&&
!
-z
"
${
KUBELET_CERT
:-}
"
&&
!
-z
"
${
KUBELET_KEY
:-}
"
]]
;
then
flags+
=
" --api-servers=https://
${
KUBELET_APISERVER
}
"
flags+
=
" --api-servers=https://
${
KUBELET_APISERVER
}
"
flags+
=
" --register-schedulable=false"
flags+
=
" --register-schedulable=false"
# need at least a /29 pod cidr for now due to #32844
# TODO: determine if we still allow non-hostnetwork pods to run on master, clean up master pod setup
# WARNING: potential ip range collision with 10.123.45.0/29
flags+
=
" --pod-cidr=10.123.45.0/29"
reconcile_cidr
=
"false"
else
else
# Standalone mode (not widely used?)
flags+
=
" --pod-cidr=
${
MASTER_IP_RANGE
}
"
flags+
=
" --pod-cidr=
${
MASTER_IP_RANGE
}
"
fi
fi
else
# For nodes
else
# For nodes
...
...
cluster/gce/trusty/configure-helper.sh
View file @
3c84164b
...
@@ -155,7 +155,7 @@ assemble_kubelet_flags() {
...
@@ -155,7 +155,7 @@ assemble_kubelet_flags() {
if
[
!
-z
"
${
KUBELET_APISERVER
:-}
"
]
&&
\
if
[
!
-z
"
${
KUBELET_APISERVER
:-}
"
]
&&
\
[
!
-z
"
${
KUBELET_CERT
:-}
"
]
&&
\
[
!
-z
"
${
KUBELET_CERT
:-}
"
]
&&
\
[
!
-z
"
${
KUBELET_KEY
:-}
"
]
;
then
[
!
-z
"
${
KUBELET_KEY
:-}
"
]
;
then
KUBELET_CMD_FLAGS
=
"
${
KUBELET_CMD_FLAGS
}
--api-servers=https://
${
KUBELET_APISERVER
}
--register-schedulable=false
--reconcile-cidr=false --pod-cidr=10.123.45.0/29
"
KUBELET_CMD_FLAGS
=
"
${
KUBELET_CMD_FLAGS
}
--api-servers=https://
${
KUBELET_APISERVER
}
--register-schedulable=false"
else
else
KUBELET_CMD_FLAGS
=
"
${
KUBELET_CMD_FLAGS
}
--pod-cidr=
${
MASTER_IP_RANGE
}
"
KUBELET_CMD_FLAGS
=
"
${
KUBELET_CMD_FLAGS
}
--pod-cidr=
${
MASTER_IP_RANGE
}
"
fi
fi
...
...
cluster/saltbase/salt/kubelet/default
View file @
3c84164b
...
@@ -35,7 +35,6 @@
...
@@ -35,7 +35,6 @@
{% if grains.kubelet_api_servers is defined -%}
{% if grains.kubelet_api_servers is defined -%}
{% set api_servers_with_port = "--api-servers=https://" + grains.kubelet_api_servers -%}
{% set api_servers_with_port = "--api-servers=https://" + grains.kubelet_api_servers -%}
{% set master_kubelet_args = master_kubelet_args + "--register-schedulable=false" -%}
{% set master_kubelet_args = master_kubelet_args + "--register-schedulable=false" -%}
{% set reconcile_cidr_args = "--reconcile-cidr=false" -%}
{% else -%}
{% else -%}
{% set api_servers_with_port = "" -%}
{% set api_servers_with_port = "" -%}
{% endif -%}
{% endif -%}
...
...
pkg/kubelet/kubelet.go
View file @
3c84164b
...
@@ -1496,6 +1496,12 @@ func (kl *Kubelet) rejectPod(pod *api.Pod, reason, message string) {
...
@@ -1496,6 +1496,12 @@ func (kl *Kubelet) rejectPod(pod *api.Pod, reason, message string) {
// can be admitted, a brief single-word reason and a message explaining why
// can be admitted, a brief single-word reason and a message explaining why
// the pod cannot be admitted.
// the pod cannot be admitted.
func
(
kl
*
Kubelet
)
canAdmitPod
(
pods
[]
*
api
.
Pod
,
pod
*
api
.
Pod
)
(
bool
,
string
,
string
)
{
func
(
kl
*
Kubelet
)
canAdmitPod
(
pods
[]
*
api
.
Pod
,
pod
*
api
.
Pod
)
(
bool
,
string
,
string
)
{
if
rs
:=
kl
.
runtimeState
.
networkErrors
();
len
(
rs
)
!=
0
{
if
!
podUsesHostNetwork
(
pod
)
{
return
false
,
"NetworkNotReady"
,
fmt
.
Sprintf
(
"Network is not ready: %v"
,
rs
)
}
}
// the kubelet will invoke each pod admit handler in sequence
// the kubelet will invoke each pod admit handler in sequence
// if any handler rejects, the pod is rejected.
// if any handler rejects, the pod is rejected.
// TODO: move out of disk check into a pod admitter
// TODO: move out of disk check into a pod admitter
...
@@ -1532,7 +1538,7 @@ func (kl *Kubelet) syncLoop(updates <-chan kubetypes.PodUpdate, handler SyncHand
...
@@ -1532,7 +1538,7 @@ func (kl *Kubelet) syncLoop(updates <-chan kubetypes.PodUpdate, handler SyncHand
defer
housekeepingTicker
.
Stop
()
defer
housekeepingTicker
.
Stop
()
plegCh
:=
kl
.
pleg
.
Watch
()
plegCh
:=
kl
.
pleg
.
Watch
()
for
{
for
{
if
rs
:=
kl
.
runtimeState
.
e
rrors
();
len
(
rs
)
!=
0
{
if
rs
:=
kl
.
runtimeState
.
runtimeE
rrors
();
len
(
rs
)
!=
0
{
glog
.
Infof
(
"skipping pod synchronization - %v"
,
rs
)
glog
.
Infof
(
"skipping pod synchronization - %v"
,
rs
)
time
.
Sleep
(
5
*
time
.
Second
)
time
.
Sleep
(
5
*
time
.
Second
)
continue
continue
...
...
pkg/kubelet/kubelet_node_status.go
View file @
3c84164b
...
@@ -568,7 +568,8 @@ func (kl *Kubelet) setNodeReadyCondition(node *api.Node) {
...
@@ -568,7 +568,8 @@ func (kl *Kubelet) setNodeReadyCondition(node *api.Node) {
// ref: https://github.com/kubernetes/kubernetes/issues/16961
// ref: https://github.com/kubernetes/kubernetes/issues/16961
currentTime
:=
unversioned
.
NewTime
(
kl
.
clock
.
Now
())
currentTime
:=
unversioned
.
NewTime
(
kl
.
clock
.
Now
())
var
newNodeReadyCondition
api
.
NodeCondition
var
newNodeReadyCondition
api
.
NodeCondition
if
rs
:=
kl
.
runtimeState
.
errors
();
len
(
rs
)
==
0
{
rs
:=
append
(
kl
.
runtimeState
.
runtimeErrors
(),
kl
.
runtimeState
.
networkErrors
()
...
)
if
len
(
rs
)
==
0
{
newNodeReadyCondition
=
api
.
NodeCondition
{
newNodeReadyCondition
=
api
.
NodeCondition
{
Type
:
api
.
NodeReady
,
Type
:
api
.
NodeReady
,
Status
:
api
.
ConditionTrue
,
Status
:
api
.
ConditionTrue
,
...
...
pkg/kubelet/runonce_test.go
View file @
3c84164b
...
@@ -83,6 +83,7 @@ func TestRunOnce(t *testing.T) {
...
@@ -83,6 +83,7 @@ func TestRunOnce(t *testing.T) {
kubeClient
:
&
fake
.
Clientset
{},
kubeClient
:
&
fake
.
Clientset
{},
hostname
:
testKubeletHostname
,
hostname
:
testKubeletHostname
,
nodeName
:
testKubeletHostname
,
nodeName
:
testKubeletHostname
,
runtimeState
:
newRuntimeState
(
time
.
Second
),
}
}
kb
.
containerManager
=
cm
.
NewStubContainerManager
()
kb
.
containerManager
=
cm
.
NewStubContainerManager
()
...
...
pkg/kubelet/runtime.go
View file @
3c84164b
...
@@ -68,16 +68,13 @@ func (s *runtimeState) setInitError(err error) {
...
@@ -68,16 +68,13 @@ func (s *runtimeState) setInitError(err error) {
s
.
initError
=
err
s
.
initError
=
err
}
}
func
(
s
*
runtimeState
)
e
rrors
()
[]
string
{
func
(
s
*
runtimeState
)
runtimeE
rrors
()
[]
string
{
s
.
RLock
()
s
.
RLock
()
defer
s
.
RUnlock
()
defer
s
.
RUnlock
()
var
ret
[]
string
var
ret
[]
string
if
s
.
initError
!=
nil
{
if
s
.
initError
!=
nil
{
ret
=
append
(
ret
,
s
.
initError
.
Error
())
ret
=
append
(
ret
,
s
.
initError
.
Error
())
}
}
if
s
.
networkError
!=
nil
{
ret
=
append
(
ret
,
s
.
networkError
.
Error
())
}
if
!
s
.
lastBaseRuntimeSync
.
Add
(
s
.
baseRuntimeSyncThreshold
)
.
After
(
time
.
Now
())
{
if
!
s
.
lastBaseRuntimeSync
.
Add
(
s
.
baseRuntimeSyncThreshold
)
.
After
(
time
.
Now
())
{
ret
=
append
(
ret
,
"container runtime is down"
)
ret
=
append
(
ret
,
"container runtime is down"
)
}
}
...
@@ -87,6 +84,16 @@ func (s *runtimeState) errors() []string {
...
@@ -87,6 +84,16 @@ func (s *runtimeState) errors() []string {
return
ret
return
ret
}
}
func
(
s
*
runtimeState
)
networkErrors
()
[]
string
{
s
.
RLock
()
defer
s
.
RUnlock
()
var
ret
[]
string
if
s
.
networkError
!=
nil
{
ret
=
append
(
ret
,
s
.
networkError
.
Error
())
}
return
ret
}
func
newRuntimeState
(
func
newRuntimeState
(
runtimeSyncThreshold
time
.
Duration
,
runtimeSyncThreshold
time
.
Duration
,
)
*
runtimeState
{
)
*
runtimeState
{
...
...
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