Skip to content

Commit

Permalink
3 masters install
Browse files Browse the repository at this point in the history
  • Loading branch information
MozeBaltyk committed May 24, 2024
1 parent 01c6115 commit e1538dc
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,19 @@ Then perform those followings steps:
export DO_PAT="xxxxxxxxxx"
export AWS_ACCESS_KEY_ID="xxxxxxxxxxxx"
export AWS_SECRET_ACCESS_KEY="xxxxxxxxxxx"
export WORKERS=2
export WORKERS=2 # Default 0
export MASTERS=3 # Default 1

# Create RKE2 cluster
make quickstart

# Delete RKE2 cluster
make quickstart-cleanup
make cleanup

# Other components
make longhorn
make rancher
make neuvector
```

NB: Quickstart is meant to deploy in DO a quick RKE2 cluster for testing purpose, and without taking into account airgap problematics.
Expand Down
1 change: 1 addition & 0 deletions roles/install_rke2_common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

- name: Get Token if one exist
ansible.builtin.import_tasks: token.yml
when: caller_role_name != "first_controller"

- name: RKE2 Install specific for RHEL-like OS
ansible.builtin.import_tasks: rhel.yml
Expand Down
25 changes: 23 additions & 2 deletions roles/install_rke2_controller/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# Start install
- name: RKE2 common tasks
vars:
caller_role_name: controller
caller_role_name: first_controller
ansible.builtin.import_role:
name: install_rke2_common
tasks_from: main
Expand Down Expand Up @@ -68,7 +68,28 @@
tags: localhost

# Install other controllers
# ...
- name: RKE2 common tasks
vars:
caller_role_name: other_controller
ansible.builtin.import_role:
name: install_rke2_common
tasks_from: token
tags: common

- name: RKE2 config controler before install
ansible.builtin.import_tasks: config.yml
when: inventory_hostname not in groups['RKE2_CONTROLLERS'][0]
tags: config

- name: RKE2 Install controler
ansible.builtin.import_tasks: install.yml
when: inventory_hostname not in groups['RKE2_CONTROLLERS'][0]
tags: install

- name: RKE2 start controller
ansible.builtin.import_tasks: start.yml
when: inventory_hostname not in groups['RKE2_CONTROLLERS'][0]
tags: start

# Utils
- name: RKE2 install nerdctl
Expand Down
4 changes: 2 additions & 2 deletions test/playbooks/install.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Install RKE2 Controlers
hosts: RKE2_CONTROLLERS
gather_facts: true
gather_facts: false
become: true
vars_files: ../../playbooks/vars/main.yml
tags: controller
Expand All @@ -10,7 +10,7 @@

- name: Install RKE2 Workers
hosts: RKE2_WORKERS
gather_facts: true
gather_facts: false
become: true
vars_files: ../../playbooks/vars/main.yml
tags: worker
Expand Down

0 comments on commit e1538dc

Please sign in to comment.