This is the step-by-step guide to reproduce our test setup.
This guide has been tested with Red Hat Enterprise Linux 8 (x86_64) and Fedora 35 (x86_64) with a graphical environment and a browser to work with Wordpress later on. The driver we use for minikube will fetch disk images and create a KVM-based virtual machine. For that you will need at least 2 GB of free memory and around 10 GB of free diskspace in your home-directory.
We also assume that you have an existing setup of Bareos Director and Storage Daemon and that these are accessible from your test-machine.
- Install virtualization packages using
sudo dnf install @virt
- Add your user to the group
libvirt
usingsudo usermod -a -G libvirt $USER
- Log out and back in
- Check that you're a member of libvirt now using
id
- Start
libvirtd
withsudo systemctl enable --now libvirtd
- Check setup with
sudo virt-host-validate
(IOMMU and secure guest are not needed)
- Download binary from
https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
- Install to /usr/local/bin using
install minikube-linux-amd64 /usr/local/bin/minikube
- Configure KVM2 driver with
minikube config set vm-driver kvm2
- Start minikube using
minikube start
. This will take some time. - Determine minikube's address with
minikube ip
. We will need this later on. - Install NGINX Ingress into minikube so we can access our web-service later:
minikube addons enable ingress
. - Test the Ingress by opening
http://<your-minikube-ip>
in your browser. You should see an error message stating "404 Not Found" as we don't have any application deployed yet.
You can use minikube dashboard
to get a Dashboard where you can see what minikube is doing and for example to restart a deployment.
- Run
minikube image build -t bareos-fd container-image/
to build the container image and deploy it to your minikube.
- In
k8s/wordpress.yaml
setDIR_ADDRESS
to the address of your Bareos Director. - If desired change passwords in
k8s/kustomization.yaml
and inbareos-dir.d/client/wordpress.conf
. - Deploy application with
minikube kubectl -- apply -k k8s/
. This will take some time to finish. - Open
http://<your-minikube-ip>
in your browser again. Eventually you should see the Wordpress installer.
- Add the files from
bareos-dir.d
to your Director's configuration. - Reload the configuration
- Regularly check
status dir
for the client initiated connection. This may take up to one minute.
- Go to
http://<your-minikube-ip>
. Finish the Wordpress installation. - Run the
wordpress
job in Bareos. - Do some changes in your Blog
- Restore the
wordpress
job using Bareos to the original directories (where = /). Your changes are now gone. - Nuke the Kubernetes application using
minikube kubectl -- delete -k k8s/
. - Redeploy the application with
minikube kubectl -- apply -k k8s/
. - Go back to
http://<your-minikube-ip>
. The Wordpress installer should greet you again. - Restore using Bareos again. Your Blog should be back to where it was when you took the Backup!
During testing the MySQL POD sometimes did not start up correctly, leaving Wordpress unable to connect to its database. Restarting the MySQL POD usually fixes this.