Waldur on RKE2
RKE2 installation and setup
To install Waldur on top of RKE2 you need to:
-
Install Ansible with version >= 2.10 and ensure python3 is installed.
-
Download this repository
-
At least 3 nodes with minimal requirements for Kubernetes nodes
1 2 3
8GB RAM 4 vCPU 30GB for system volume and a dedicated 60GB for storage (Longhorn)
-
Install
kubernetes.core
collection from ansible galaxy.1 2 3 4 5 6 7 8
ansible-galaxy collection install kubernetes.core ansible-galaxy collection install ansible.posix # or curl -L -o ansible-galaxy/kubernetes-core-2.3.2.tar.gz --create-dirs https://galaxy.ansible.com/download/kubernetes-core-2.3.2.tar.gz ansible-galaxy collection install ansible-galaxy/kubernetes-core-2.3.2.tar.gz curl -L -o ansible-galaxy/ansible-posix-1.4.0.tar.gz https://galaxy.ansible.com/download/ansible-posix-1.4.0.tar.gz ansible-galaxy collection install ansible-galaxy/ansible-posix-1.4.0.tar.gz
-
Adjust variables in
ansible-config/rke2_vars
file -
(Optional) Run the playbook to setup infrastructure (Kubernetes and Longhorn):
1 2
cd ansible-config ansible-playbook -D -i rke2_inventory install-infrastructure.yaml
-
Run the playbook to install Waldur and dependencies:
1 2
cd ansible-config ansible-playbook -D -i rke2_inventory install-applications.yaml
You can check Waldur release installation with the following steps:
-
ssh to a node from inventory with
initial_server=true
and check all the pods from the default namespace:1 2
export KUBECONFIG=/etc/rancher/rke2/rke2.yaml kubectl get pods -n default
If you run Waldur in a different namespace, please adjust the value of the -n
option in the last command above.
Add admin ssh keys
- Setup
admin_keys
andrevoked_admin_keys
vars in theansible-config/rke2_vars
file -
Run the corresponding playbook
1 2
cd ansible-config ansible-playbook -D -i rke2_inventory add-ssh-keys.yml
Add haproxy load balancer
- Setup
haproxy_stats_password
var in theansible-config/rke2_vars
file -
Run the corresponding playbook
1 2
cd ansible-config ansible-playbook -D -i rke2_inventory add-haproxy-host.yml
Waldur Helm configuration
A user can override default settings for Waldur Helm. The ansible-config/waldur/values.yaml
is the main settings file. Additional configuration features files (e.g. for SAML2, whitelabeling, bootstrapping, etc.) can be included by placing into corresponding subdirectories of ansible-config/waldur/
folder. The paths to the subdirectories should be specified in ansible-config/waldur/values.yaml
, e.g. waldur.saml2.dir
value.
Waldur Helm configuration is described in the public docs; example values.yaml
file: link, example additional files: link.
Update of Waldur
To update Waldur user needs to execute the corresponding playbook:
1 2 |
|
Update of Waldur dependencies
To update Waldur dependencies, a user should:
- Setup the desired components for update in
ansible-config/rke2_vars
file, e.g. setsetup_postgresql
toyes
in case of PostgreSQL Helm chart update. NB: please, don't change chart versions manually, it can cause failure of Waldur application -
Run the corresponding playbook:
1 2
cd ansible-config ansible-playbook -D -i rke2_inventory install-applications.yaml
Example of changes in ansible-config/rke2_vars
file:
1 2 3 4 5 6 7 8 9 |
|
With this setup, the playbook will update PostgreSQL release only. If the user wants to update RabbitMQ too, they should set setup_rabbitmq: yes
Waldur log fetching
To get logs from Waldur containers, a users needs to connect to one of the RKE2 nodes:
1 |
|
A node IP should be chosen from the inventory file (e.g. rke2_inventory
).
In the node's shell, the user should run the following to setup Kubernetes client:
1 |
|
After this, the user can get Waldur API logs:
1 |
|
Same works for Celery worker:
1 |
|
Note: if you use a non-default namespace for Waldur release, please change the value for -n
option in the aforementioned command
Setup SSL certificates
NB: do not forget to set apiScheme
ans homeportScheme
to https
in ansible-config/waldur/values.yaml
Custom certificates
To setup the SSL certificates, please do the following steps:
- Copy the certificate and key to the
ansible-config/waldur/tls
directory. NB: key must be namedtls.key
and cert itself -tls.crt
- In
ansible-config/waldur/values.yaml
, setingress.tls.source
tosecret
- Update Waldur release
Let's Encrypt
To setup SSL certificates using Let's Encrypt, please do the following steps:
- In
ansible-config/rke2_vars
, setsetup_lets_encrypt
toyes
- In
ansible-config/waldur/values.yaml
, setingress.tls.source
toletsEncrypt
- Install Let's Encrypt via
install-applications.yaml
playbook
1 |
|
Enable K8s dashboard
Make sure that K8s dashboard is deployed. Login to one of the K8s nodes.
1 2 3 4 5 |
|
K8s dashboard should now be accessible on port 8001 in that node -- or load balancer node on port 8001 if configured.
Recover data from DB backup
In order to apply an existing backup to database, a corresponding playbook exists.
NB:
- This operation drops an existing database, creates an empty one and applies the pre-created backup
- During restoration process, the site will be unavailable
During execution, you will be asked about backup name. You should input it in a correct way. Example of running playbook:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
After this, you should input one of the following lines:
- backup-2022-12-01-05-00.sql.gz
- backup-2022-11-30-05-00.sql.gz
- backup-2022-11-29-05-00.sql.gz
- backup-2022-11-28-16-30.sql.gz
- backup-2022-11-28-16-28.sql.gz
Otherwise, the entire process will fail, but the site and database with old data will be still available.
To start the process, please, execute the following line in the machine connected to RKE2 nodes:
1 |
|