Browse Source

manage_node: don't add extra labels to infra/compute/master nodes

node groups are now required, so sync DS may cause race conditions with 
ansible. Node configmaps should define all necessary labels.
Vadim Rutkovsky 6 years ago
parent
commit
9af28fb24d

+ 1 - 13
playbooks/common/openshift-cluster/upgrades/v3_10/label_nodes.yml

@@ -1,6 +1,6 @@
 ---
 
-- name: Update all labels
+- name: Set node schedulability
   hosts: oo_masters_to_config
   roles:
     - openshift_facts
@@ -11,15 +11,3 @@
         tasks_from: config.yml
       vars:
         openshift_master_host: '{{ groups.oo_first_master.0 }}'
-
-- name: Update node labels to differentiate from (now-schedulable) masters
-  hosts: oo_first_master
-  roles:
-    - openshift_facts
-    - lib_openshift
-  tasks:
-    - import_role:
-        name: openshift_manage_node
-        tasks_from: set_default_node_role.yml
-      vars:
-        openshift_master_host: '{{ groups.oo_first_master.0 }}'

+ 1 - 13
playbooks/common/openshift-cluster/upgrades/v3_11/label_nodes.yml

@@ -1,6 +1,6 @@
 ---
 
-- name: Update all labels
+- name: Set node schedulability
   hosts: oo_masters_to_config
   roles:
     - openshift_facts
@@ -11,15 +11,3 @@
         tasks_from: config.yml
       vars:
         openshift_master_host: '{{ groups.oo_first_master.0 }}'
-
-- name: Update node labels to differentiate from (now-schedulable) masters
-  hosts: oo_first_master
-  roles:
-    - openshift_facts
-    - lib_openshift
-  tasks:
-    - import_role:
-        name: openshift_manage_node
-        tasks_from: set_default_node_role.yml
-      vars:
-        openshift_master_host: '{{ groups.oo_first_master.0 }}'

+ 0 - 1
roles/openshift_manage_node/tasks/main.yml

@@ -35,4 +35,3 @@
   delegate_to: "{{ openshift_master_host }}"
 
 - include_tasks: config.yml
-- include_tasks: set_default_node_role.yml

+ 0 - 48
roles/openshift_manage_node/tasks/set_default_node_role.yml

@@ -1,48 +0,0 @@
----
-
-- delegate_to: '{{ openshift_master_host }}'
-  run_once: true
-  block:
-    - name: Retrieve nodes that are marked with the infra selector or the legacy infra selector
-      oc_obj:
-        state: list
-        kind: Node
-        selector: '{{ openshift_hosted_infra_selector | default("region=infra") }}'
-      register: infra_nodes_by_selector
-
-    - name: Label infra or legacy infra nodes with the new role label
-      oc_label:
-        name: '{{ item }}'
-        kind: node
-        state: add
-        labels:
-          - key: node-role.kubernetes.io/infra
-            value: 'true'
-      with_items: "{{ infra_nodes_by_selector.results.results.0['items'] | map(attribute='metadata') | map(attribute='name') | list }}"
-
-    - name: Retrieve non-infra, non-master nodes that are not yet labeled compute
-      oc_obj:
-        state: list
-        kind: Node
-        selector: '{{ (openshift_hosted_infra_selector | default("node-role.kubernetes.io/infra=true")) | regex_replace("=", "!=") }},node-role.kubernetes.io/infra!=true,node-role.kubernetes.io/master!=true,node-role.kubernetes.io/compute!=true'
-      register: non_master_non_infra_nodes_result
-
-    - name: label non-master non-infra nodes compute
-      oc_label:
-        name: '{{ item }}'
-        kind: node
-        state: add
-        labels:
-          - key: node-role.kubernetes.io/compute
-            value: 'true'
-      with_items: "{{ non_master_non_infra_nodes_result.results.results.0['items'] | map(attribute='metadata') | map(attribute='name') | list }}"
-
-    - name: Label all-in-one master as a compute node
-      oc_label:
-        name: '{{ openshift.node.nodename }}'
-        kind: node
-        state: add
-        labels:
-          - key: node-role.kubernetes.io/compute
-            value: 'true'
-      when: groups['oo_nodes_to_config'] | default([]) | union(groups['oo_nodes_to_bootstrap'] | default([])) | union(groups['oo_masters_to_config']) | length == 1