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
8485136f
Commit
8485136f
authored
5 years ago
by
Mateus Caruccio
Committed by
Kubernetes Prow Robot
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
var node_labels as string (#4764)
parent
ff1bc739
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
docs/vars.md
+3
-1
3 additions, 1 deletion
docs/vars.md
roles/kubernetes/node/templates/kubelet.env.j2
+10
-5
10 additions, 5 deletions
roles/kubernetes/node/templates/kubelet.env.j2
with
13 additions
and
6 deletions
docs/vars.md
+
3
−
1
View file @
8485136f
...
...
@@ -117,11 +117,13 @@ Stack](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/dns-stack.m
from the kube-apiserver when the certificate expiration approaches.
*
*node_labels*
- Labels applied to nodes via kubelet --node-labels parameter.
For example, labels can be set in the inventory as variables or more widely in group_vars.
*node_labels*
must
be defined as a dict:
*node_labels*
can
be defined
either
as a dict
or a comma-separaded labels string
:
```
node_labels:
label1_name: label1_value
label2_name: label2_value
node_labels: "label1_name=label1_value,label2_name=label2_value"
```
*
*node_taints*
- Taints applied to nodes via kubelet --register-with-taints parameter.
For example, taints can be set in the inventory as variables or more widely in group_vars.
...
...
This diff is collapsed.
Click to expand it.
roles/kubernetes/node/templates/kubelet.env.j2
+
10
−
5
View file @
8485136f
...
...
@@ -91,11 +91,16 @@ KUBELET_HOSTNAME="--hostname-override={{ kube_override_hostname }}"
{% endif %}
{% set inventory_node_labels = [] %}
{% if node_labels is defined and node_labels is mapping %}
{% for labelname, labelvalue in node_labels.items() %}
{% set dummy = inventory_node_labels.append('%s=%s'|format(labelname, labelvalue)) %}
{% endfor %}
{% endif %}
{% if node_labels is defined %}
{% if node_labels is mapping %}
{% for labelname, labelvalue in node_labels.items() %}
{% set dummy = inventory_node_labels.append('%s=%s'|format(labelname, labelvalue)) %}
{% endfor %}
{% else %}
{% for label in node_labels.split(",") %}
{% set dummy = inventory_node_labels.append(label) %}
{% endfor %}
{% endif %}
{% set all_node_labels = role_node_labels + inventory_node_labels %}
{# Kubelet node taints for gpu #}
...
...
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