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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
03bb729f
Commit
03bb729f
authored
7 years ago
by
Brad Beam
Browse files
Options
Downloads
Patches
Plain Diff
Making status and detection mo betta
parent
60460c02
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide 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 @
03bb729f
...
@@ -2,4 +2,5 @@
...
@@ -2,4 +2,5 @@
-
name
:
Uncordon node
-
name
:
Uncordon node
command
:
"
{{
bin_dir
}}/kubectl
uncordon
{{
inventory_hostname
}}"
command
:
"
{{
bin_dir
}}/kubectl
uncordon
{{
inventory_hostname
}}"
delegate_to
:
"
{{
groups['kube-master'][0]
}}"
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 @
03bb729f
---
---
# Node Ready: type = ready, status = True
# Node NotReady: type = ready, status = Unknown
-
name
:
See if node is in ready state
-
name
:
See if node is in ready state
shell
:
"
{{
bin_dir
}}/kubectl
get
nodes
|
grep
{{
inventory_hostname
}}"
shell
:
>-
register
:
kubectl_nodes
{{ 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]
}}"
delegate_to
:
"
{{
groups['kube-master'][0]
}}"
failed_when
:
false
failed_when
:
false
-
set_fact
:
-
set_fact
:
needs_cordoning
:
>-
needs_cordoning
:
>-
{% if
" Ready" in
kubectl_node
s
.stdout -%}
{% if
kubectl_node_ready.stdout == "True" and
kubectl_node
_schedulable
.stdout
== ""
-%}
true
true
{%- else -%}
{%- else -%}
false
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
register
or
sign in
to comment