Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 31 additions & 10 deletions playbooks/openshift-master/scaleup.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,43 @@
---
- import_playbook: ../init/evaluate_groups.yml

- name: Ensure there are new_masters or new_nodes
- name: Ensure there are new_masters and new_nodes
hosts: localhost
connection: local
gather_facts: no
tasks:
- fail:
# new_masters must be part of new_nodes as well; otherwise if new_nodes
# is not present, oo_nodes_to_config will contain all existing nodes.
msg: >
Detected no new_masters or no new_nodes in inventory. Please
add hosts to the new_masters and new_nodes host groups to add
masters.
when:
- g_new_master_hosts | default([]) | length == 0
- g_new_node_hosts | default([]) | length == 0
Detected no new_masters and/or no new_nodes in inventory. New
masters must be part of both new_masters and new_nodes groups.
If you are adding just new_nodes, use the
playbooks/openshift-node/scaleup.yml play.
when: >
g_new_master_hosts | default([]) | length == 0
or g_new_node_hosts | default([]) | length == 0

# Need a better way to do the above check for node without
# running evaluate_groups and init/main.yml
- import_playbook: ../init/main.yml
- name: Ensure there are new_masters and new_nodes
hosts: oo_masters_to_config
connection: local
gather_facts: no
tasks:
- fail:
# new_masters must be part of new_nodes as well;
msg: >
Each host in new_masters must also appear in new_nodes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why wouldn't scaleup disallow scaling up dedicated masters

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our masters must be nodes for various reasons, mainly they need to be on the SDN but in 3.9 masters will actually be expected to run the console pods.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually run the node scaleup playbook to complete the node specific tasks or do we need to document the need to run node scaleup too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sdodson this openshift-master/private/scaleup.yml and openshift-node/private/scaleup.yml both call openshift-node/private/config.yml. There is no need to run openshift-node/scaleup in addition to this play if you're adding both masters and nodes. The nodes were already being configured at the same time as masters, according to our plays.

If one is adding nodes and 0 masters, then they can run openshift-node/scaleup.yml.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me, thanks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in 3.9 masters will actually be expected to run the console pods.

Oh, I see, makes sense.

Do we actually run the node scaleup playbook to complete the node specific tasks

Yes, the node is being setup there

when: inventory_hostname not in groups['oo_nodes_to_config']

- import_playbook: ../prerequisites.yml
vars:
l_scale_up_hosts: "oo_nodes_to_config:oo_masters_to_config"
l_init_fact_hosts: "oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config:oo_nodes_to_config"
l_sanity_check_hosts: "{{ groups['oo_nodes_to_config'] | union(groups['oo_masters_to_config']) }}"

- import_playbook: ../init/version.yml
vars:
l_openshift_version_set_hosts: "oo_masters_to_config:oo_nodes_to_config:!oo_first_master"
l_openshift_version_check_hosts: "oo_masters_to_config:oo_nodes_to_config"

- import_playbook: private/scaleup.yml
8 changes: 8 additions & 0 deletions playbooks/openshift-node/scaleup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
new_nodes host group to add nodes.
when:
- g_new_node_hosts | default([]) | length == 0
- fail:
msg: >
Please run playbooks/openshift-master/scaleup.yml if you need to
scale up both masters and nodes. This playbook is only needed if
you are only adding new nodes and not new masters.
when:
- g_new_node_hosts | default([]) | length > 0
- g_new_master_hosts | default([]) | length > 0

# if g_new_node_hosts is not empty, oo_nodes_to_config will be set to
# g_new_node_hosts via evaluate_groups.yml
Expand Down