Note-to-self: How to run a Akeeba restore job on the vanilla bitnami Joomla helm chart installation.
The plan is to create a directory on the bitnami container with k3s ctr. Copy the Akeeba files to this directory and simply run the Akeeba installer (kickstart). A huge work-a-round for not being able to fix bitnami no-root helm chart. Using k3s CLI tools for copying the Akeeba image and setting the correct access right for the two files. Not an elegant way to go.
What is needed:
- (sudo) Access to the relevant host for running the k3s CLI tool
- Akeeba backup and Akeeba kickstart file
- A running vanilla bitnami joomla (helm chart) installation
For a docker setup, a possible fix is to add 'user: root' in the compose file and you will have the necessary access right on the container. Possible even 'docker exec' will access the container with root access (kubectl exec will not). The security settings for the bitnami joomla chat is (chart version: 14.1.3):
podSecurityContext: enabled: true fsGroup: 1001 ## containerSecurityContext: enabled: true runAsUser: 1001 runAsNonRoot: true
Source files (Akeeba backup and kickstart.php)
akeeba ├── kickstart.php └── site-www.XXX.xxx-20230622-15cest-PBGHGTRhJHkLDsB.jpa
Destination (Vanilla bitnami Joomla installation)
kubectl get pods -n bitnami -o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES bitnami-mariadb-0 1/1 Running 0 139m 10.42.0.193 test0 bitnami-joomla-86dfc87b77-cpkv5 1/1 Running 0 139m 10.42.2.132 test2
The Joomla (bitnami-joomla-86dfc87b77-cpkv5) pod is running on host 'test02'.
Get container ID for 'bitnami-joomla-86dfc87b77-cpkv5' (showing only part of the output) with kubectl describe.
kubectl describe pods bitnami-joomla-86dfc87b77-cpkv5 -n bitnami Name: bitnami-joomla-86dfc87b77-cpkv5 ... Containers: joomla: Container ID: containerd://0c8f2f66dc40b72ee6132b59518cfa107e28826771f0e90a65e5069a49cd4b90 Image: docker.io/bitnami/joomla:4.3.2-debian-11-r0
Container ID in this case is: 0c8f2f66dc40b72ee6132b59518cfa107e28826771f0e90a65e5069a49cd4b90
Access the relevant host directly. Below I am logged in to the 'test2' host.
sudo ctr containers list | grep -i 0c8f2f66dc40b72ee6132b59518cfa107e28826771f0e90a65e5069a49cd4b90 0c8f2f66dc40b72ee6132b59518cfa107e28826771f0e90a65e5069a49cd4b90 docker.io/bitnami/joomla:4.3.2-debian-11-r0 io.containerd.runc.v2
Above simply confirm that pod 'bitnami-joomla-86dfc87b77-cpkv5' is running on this computer.
Log in to the container and create a directory needed as destination for the copy job.
sudo ctr -n k8s.io task exec -t -exec-id 0 --user 0 0c8f2f66dc40b72ee6132b59518cfa107e28826771f0e90a65e5069a49cd4b90 sh
As the server is not exposed externally (and will have a very shot lifespan) the directory 'tmp/backup' is getting some excessive access rights. The directory should be delete right after the files have been removed.
cd /tmp mkdir backup chmod 777 backup
Now the directory is created on the bitnami container, copy both the Akeeba backup file and the kickstart file into this directory (below is run from you normal terminal (i.e. outside the container) and where you have access to your backup files).
kubectl cp akeeba/kickstart.php bitnami-joomla-86dfc87b77-cpkv5:/tmp/backup -n bitnami
Inside the container: Both file must end up in the ''/bitnami/joomla' directory. Copy both files:
cp kickstart.php /bitnami/joomla cp site-www.60877727.dk-20230622-143435cest-PBGPENXIhJHkLDsB.jpa /bitnami/joomla
Delete the /tmp/backup directory now.
Still inside the container. Give kickstart and the backup files the necessary access (both files will be delete as part of the install process)
pwd /bitnami/joomla chmod 777 kickstart.php chmod 777 site-www.XXX.xxx-20622-145cest-PBGGFDREkLDsB.jpa
'kickstart.php' is now accessible from the webserver.
In darkness I dwell, A shattered soul, lost and worn, Hope's whispers arise. Embrace gentle mends, Fragments unite, piece by piece, Budding strength within. Fragile steps I take, A mosaic of rebirth, Finding light once more