From fe4622305efa55e6bec8221efe8fc4bdd5462136 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Tue, 27 Feb 2018 17:55:55 +0100 Subject: Scaling and upgrade playbooks (not properly tested yet) --- opts.sh | 7 +++++-- playbooks/ands-prepare.yml | 4 ++-- playbooks/openshift-add-masters.yml | 7 +++++++ playbooks/openshift-add-nodes.yml | 2 +- playbooks/openshift-upgrade.yml | 7 +++++++ setup.sh | 20 ++++++++++++++++---- 6 files changed, 38 insertions(+), 9 deletions(-) create mode 100644 playbooks/openshift-add-masters.yml create mode 100644 playbooks/openshift-upgrade.yml diff --git a/opts.sh b/opts.sh index 57c26f9..6c34d04 100644 --- a/opts.sh +++ b/opts.sh @@ -24,10 +24,13 @@ Actions: projects - installs configuration files and OpenShift resources for KaaS and other configured projects Scaling the cluster - nodes - complete action: prepares the nodes, scales up the cluster, and reconfigures storage + nodes - complete action: prepares the nodes, scales up the cluster, and reconfigures storage (if necessary) + masters - complete action: prepares the masters, scales up the cluster, and reconfigures storage prepare - prepares the new nodes - openshift-nodes - scales OpenShift cluster (master scallability is not checked) + openshift-nodes - scales OpenShift cluster with additional nodes + openshift-masters - scales OpenShift cluster (master scallability is not checked) configure - Configures new nodes (Storage, Users, OpenVPN tunnels) + upgrade - Upgrade to a new version (Dangerous) Configuration of new resources, etc. users - configure user roles & passwords diff --git a/playbooks/ands-prepare.yml b/playbooks/ands-prepare.yml index b3a025b..e8c785b 100644 --- a/playbooks/ands-prepare.yml +++ b/playbooks/ands-prepare.yml @@ -6,7 +6,7 @@ - role: firewall - name: Keepalived service - hosts: masters + hosts: masters, new_masters roles: - role: keepalived vars: @@ -30,7 +30,7 @@ - role: ands_storage - name: Docker setup - hosts: nodes + hosts: nodes, new_nodes roles: - role: docker vars: diff --git a/playbooks/openshift-add-masters.yml b/playbooks/openshift-add-masters.yml new file mode 100644 index 0000000..bcc1a41 --- /dev/null +++ b/playbooks/openshift-add-masters.yml @@ -0,0 +1,7 @@ +- name: Configure cluster hosts names + hosts: nodes + roles: + - { role: ands_facts } + - { role: ands_openshift, subrole: hostnames } + +- import_playbook: ../anslib/openshift-ansible/playbooks/openshift-master/scaleup.yml diff --git a/playbooks/openshift-add-nodes.yml b/playbooks/openshift-add-nodes.yml index 5044e91..04a56a8 100644 --- a/playbooks/openshift-add-nodes.yml +++ b/playbooks/openshift-add-nodes.yml @@ -4,4 +4,4 @@ - { role: ands_facts } - { role: ands_openshift, subrole: hostnames } -- include: ../anslib/openshift-ansible/playbooks/byo/openshift-node/scaleup.yml +- import_playbook: ../anslib/openshift-ansible/playbooks/openshift-node/scaleup.yml diff --git a/playbooks/openshift-upgrade.yml b/playbooks/openshift-upgrade.yml new file mode 100644 index 0000000..f2680ab --- /dev/null +++ b/playbooks/openshift-upgrade.yml @@ -0,0 +1,7 @@ +- name: Configure cluster hosts names + hosts: nodes + roles: + - { role: ands_facts } +# - { role: ands_openshift, subrole: hostnames } + +- import_playbook: ../anslib/openshift-ansible/playbooks/byo/openshift-cluster/upgrades/v3_7/upgrade.yml diff --git a/setup.sh b/setup.sh index 20174f1..b7d12b3 100755 --- a/setup.sh +++ b/setup.sh @@ -39,10 +39,19 @@ case "${1}" in apply playbooks/openshift-add-nodes.yml || exit 1 ;; nodes) - ./setup.sh prepare || exit 1 - ./setup.sh openshift-nodes || exit 1 - ./setup.sh gluster || exit 1 - ./setup.sh configure || exit 1 + ./setup.sh -i $inventory prepare || exit 1 + ./setup.sh -i $inventory openshift-nodes || exit 1 + ./setup.sh -i $inventory gluster || exit 1 + ./setup.sh -i $inventory configure || exit 1 + ;; + openshift-masters) + apply playbooks/openshift-add-masters.yml || exit 1 + ;; + masters) + ./setup.sh -i $inventory prepare || exit 1 + ./setup.sh -i $inventory openshift-masters || exit 1 + ./setup.sh -i $inventory gluster || exit 1 + ./setup.sh -i $inventory configure || exit 1 ;; users) apply playbooks/openshift-setup-users.yml || exit 1 @@ -59,6 +68,9 @@ case "${1}" in certs) apply playbooks/openshift-redeploy-certificates.yml --extra-vars "openshift_certificates_redeploy_ca=true" || exit 1 ;; + upgrade) + apply playbooks/openshift-upgrade.yml || exit 1 + ;; check) apply playbooks/maintain.yml || exit ;; -- cgit v1.2.3