Add maintenance toleration for cpu_pooler_config
[ta/caas-cpupooler.git] / ansible / roles / cpupooler / templates / cpu_pooler_config.yaml.j2
index c138125..ce3a804 100644 (file)
@@ -21,12 +21,17 @@ limitations under the License.
   pools:
     {% set cpu_allocation = hostdata.get('ansible_local', {}).get('cpu_allocation', {}) %}
     {% for allocation_name, allocation in cpu_allocation.iteritems() %}
-      {% if allocation_name in cpu_allocation_mapping %}
-    {{ cpu_allocation_mapping[allocation_name]['pool_name'] }}:
+      {% if allocation_name in caas.cpu_allocation_mapping %}
+    {{ caas.cpu_allocation_mapping[allocation_name]['pool_name'] }}:
       cpus: "{{ allocation.get('list', '') }}"
       {% endif %}
     {% endfor %}
   nodeSelector:
     nodename: "{{ hostdata['nodename'] | default('') }}"
+  tolerations:
+  - key: "node-maintenancemode"
+    value: "enabled"
+    operator: "Equal"
+    effect: "NoExecute"
   {% endif %}
 {% endfor %}