Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
c6c74616
Unverified
Commit
c6c74616
authored
Feb 9, 2018
by
Brad Beam
Committed by
GitHub
Feb 9, 2018
Browse files
Options
Downloads
Plain Diff
Merge pull request #2293 from bradbeam/upgrade
Making node status and scheduling detection mo betta for upgrades
parents
60460c02
03bb729f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
roles/upgrade/post-upgrade/tasks/main.yml
+2
-1
2 additions, 1 deletion
roles/upgrade/post-upgrade/tasks/main.yml
roles/upgrade/pre-upgrade/tasks/main.yml
+17
-3
17 additions, 3 deletions
roles/upgrade/pre-upgrade/tasks/main.yml
with
19 additions
and
4 deletions
roles/upgrade/post-upgrade/tasks/main.yml
+
2
−
1
View file @
c6c74616
...
...
@@ -2,4 +2,5 @@
-
name
:
Uncordon node
command
:
"
{{
bin_dir
}}/kubectl
uncordon
{{
inventory_hostname
}}"
delegate_to
:
"
{{
groups['kube-master'][0]
}}"
when
:
needs_cordoning|default(false)
when
:
-
needs_cordoning|default(false)
This diff is collapsed.
Click to expand it.
roles/upgrade/pre-upgrade/tasks/main.yml
+
17
−
3
View file @
c6c74616
---
# Node Ready: type = ready, status = True
# Node NotReady: type = ready, status = Unknown
-
name
:
See if node is in ready state
shell
:
"
{{
bin_dir
}}/kubectl
get
nodes
|
grep
{{
inventory_hostname
}}"
register
:
kubectl_nodes
shell
:
>-
{{ bin_dir }}/kubectl get node {{ inventory_hostname }}
-o jsonpath='{ range .status.conditions[?(@.type == "Ready")].status }{ @ }{ end }'
register
:
kubectl_node_ready
delegate_to
:
"
{{
groups['kube-master'][0]
}}"
failed_when
:
false
# SchedulingDisabled: unschedulable = true
# else unschedulable key doesn't exist
-
name
:
See if node is schedulable
shell
:
>-
{{ bin_dir }}/kubectl get node {{ inventory_hostname }}
-o jsonpath='{ .spec.unschedulable }'
register
:
kubectl_node_schedulable
delegate_to
:
"
{{
groups['kube-master'][0]
}}"
failed_when
:
false
-
set_fact
:
needs_cordoning
:
>-
{% if
" Ready" in
kubectl_node
s
.stdout -%}
{% if
kubectl_node_ready.stdout == "True" and
kubectl_node
_schedulable
.stdout
== ""
-%}
true
{%- else -%}
false
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment