Browse Source

Master components should not have configurable labels

These are now locked to masters by default, no choice.
Clayton Coleman 7 years ago
parent
commit
1832c8e303

+ 1 - 1
.papr.inventory

@@ -19,7 +19,7 @@ osm_host_subnet_length=9
 openshift_node_groups=[{"name":"node-config-master","labels":["node-role.kubernetes.io/master=true","node-role.kubernetes.io/infra=true"]},{"name":"node-config-node","labels":["node-role.kubernetes.io/compute=true"]}]
 openshift_master_bootstrap_enabled=true
 openshift_master_bootstrap_auto_approve=true
-openshift_master_bootstrap_auto_approver_node_selector={"region":"infra"}
+openshift_master_bootstrap_auto_approver_node_selector={"node-role.kubernetes.io/master":"true"}
 osm_controller_args={"experimental-cluster-signing-duration": ["20m"]}
 openshift_node_bootstrap=true
 openshift_hosted_infra_selector="node-role.kubernetes.io/infra=true"

+ 0 - 11
playbooks/common/openshift-cluster/upgrades/upgrade_components.yml

@@ -19,14 +19,3 @@
       tasks_from: upgrade.yml
     when:
     - openshift_enable_service_catalog | default(true) | bool
-
-# Label rest of master nodes - will be a no-op if only one master exists
-- name: Ensure all masters are labeled with node selector for Service Catalog
-  hosts: oo_masters_to_config
-  tasks:
-  - name: Label {{ openshift.node.nodename }} for APIServer and controller deployment
-    oc_label:
-      name: "{{ openshift.node.nodename }}"
-      kind: node
-      state: add
-      labels: "{{ openshift_service_catalog_nodeselector | default ({'openshift-infra': 'apiserver'}) | lib_utils_oo_dict_to_list_of_dict }}"

+ 0 - 11
playbooks/openshift-service-catalog/private/config.yml

@@ -20,17 +20,6 @@
   vars:
     first_master: "{{ groups.oo_first_master[0] }}"
 
-# Label rest of master nodes - will be a no-op if only one master exists
-- name: Ensure all masters are labeled with node selector for Service Catalog
-  hosts: oo_masters_to_config
-  tasks:
-  - name: Label {{ openshift.node.nodename }} for APIServer and controller deployment
-    oc_label:
-      name: "{{ openshift.node.nodename }}"
-      kind: node
-      state: add
-      labels: "{{ openshift_service_catalog_nodeselector | default ({'openshift-infra': 'apiserver'}) | lib_utils_oo_dict_to_list_of_dict }}"
-
 - name: Service Catalog Install Checkpoint End
   hosts: all
   gather_facts: false

+ 1 - 9
roles/openshift_docker_gc/tasks/main.yml

@@ -1,18 +1,10 @@
 ---
-- name: Ensure that docker-gc will have nodes to run on
-  import_role:
-    name: openshift_master
-    tasks_from: ensure_nodes_matching_selector.yml
-  vars:
-    openshift_master_ensure_nodes_selector: "{{ r_docker_gc_node_selectors | map_to_pairs }}"
-    openshift_master_ensure_nodes_service: docker-gc daemonset
-
 - name: Create docker-gc tempdir
   command: mktemp -d
   register: templates_tmpdir
 
 # NOTE: oc_adm_policy_user does not support -z (yet)
-- name: Add dockergc as priviledged
+- name: Add dockergc as privileged
   shell: "{{ openshift_client_binary }}  adm policy add-scc-to-user -z dockergc privileged"
 #  oc_adm_policy_user:
 #    user: dockergc

+ 0 - 1
roles/openshift_service_catalog/defaults/main.yml

@@ -1,6 +1,5 @@
 ---
 openshift_service_catalog_remove: false
-openshift_service_catalog_nodeselector: {"openshift-infra": "apiserver"}
 openshift_service_catalog_async_bindings_enabled: false
 
 openshift_use_openshift_sdn: True

+ 2 - 2
roles/openshift_service_catalog/tasks/install.yml

@@ -120,7 +120,7 @@
     cors_allowed_origin: localhost
     etcd_servers: "{{ openshift.master.etcd_urls | join(',') }}"
     etcd_cafile: "{{ '/etc/origin/master/master.etcd-ca.crt' if etcd_ca_crt.stat.exists else '/etc/origin/master/ca-bundle.crt' }}"
-    node_selector: "{{ openshift_service_catalog_nodeselector | default ({'openshift-infra': 'apiserver'}) }}"
+    node_selector: {'node-role.kubernetes.io/master': 'true'}
     # apiserver_ca is defined in generate_certs.yml
     ca_hash: "{{ apiserver_ca.content|hash('sha1') }}"
 
@@ -170,7 +170,7 @@
     image: ""
     cpu_limit: none
     memory_limit: none
-    node_selector: "{{ openshift_service_catalog_nodeselector | default ({'openshift-infra': 'apiserver'}) }}"
+    node_selector: {'node-role.kubernetes.io/master': 'true'}
 
 - name: Set Controller Manager deployment
   oc_obj:

+ 0 - 8
roles/openshift_service_catalog/tasks/start_api_server.yml

@@ -1,12 +1,4 @@
 ---
-# Label nodes and wait for apiserver and controller to be running (at least one)
-- name: Label {{ openshift.node.nodename }} for APIServer and controller deployment
-  oc_label:
-    name: "{{ openshift.node.nodename }}"
-    kind: node
-    state: add
-    labels: "{{ openshift_service_catalog_nodeselector | default ({'openshift-infra': 'apiserver'}) | lib_utils_oo_dict_to_list_of_dict }}"
-
 # wait to see that the apiserver is available
 - name: wait for api server to be ready
   uri:

+ 0 - 1
roles/template_service_broker/defaults/main.yml

@@ -2,7 +2,6 @@
 template_service_broker_remove: False
 template_service_broker_install: True
 openshift_template_service_broker_namespaces: ['openshift']
-template_service_broker_selector: "{{ openshift_hosted_infra_selector | default('region=infra') | map_from_pairs }}"
 
 __tsb_template_file: "apiserver-template.yaml"
 __tsb_config_file: "apiserver-config.yaml"

+ 1 - 1
roles/template_service_broker/tasks/deploy.yml

@@ -39,7 +39,7 @@
     -f "{{ mktemp.stdout }}/{{ __tsb_template_file }}"
     --param API_SERVER_CONFIG="{{ config['content'] | b64decode }}"
     --param IMAGE="{{ template_service_broker_prefix }}{{ template_service_broker_image_name }}:{{ template_service_broker_version }}"
-    --param NODE_SELECTOR={{ template_service_broker_selector | to_json | quote }}
+    --param NODE_SELECTOR={{ {'node-role.kubernetes.io/master':'true'} | to_json | quote }}
     | {{ openshift_client_binary }} apply --config={{ mktemp.stdout }}/admin.kubeconfig -f -
 
 # reconcile with rbac

+ 0 - 8
roles/template_service_broker/tasks/install.yml

@@ -1,10 +1,2 @@
 ---
-- name: Ensure that Template Service Broker has nodes to run on
-  import_role:
-    name: openshift_master
-    tasks_from: ensure_nodes_matching_selector.yml
-  vars:
-    openshift_master_ensure_nodes_selector: "{{ template_service_broker_selector | map_to_pairs }}"
-    openshift_master_ensure_nodes_service: Template Service Broker
-
 - include_tasks: deploy.yml