From b939ee7a0962ef11c2899f502bee42300a819370 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 5 Sep 2021 20:25:42 +0200 Subject: [PATCH] website/docs: use kubectl exec with deployment, add note for backup version Signed-off-by: Jens Langhammer #1349 --- website/docs/maintenance/backups/index.md | 17 ++++++++--------- website/docs/troubleshooting/emails.md | 2 +- website/docs/troubleshooting/login.md | 2 +- .../docs/troubleshooting/missing_permission.md | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/website/docs/maintenance/backups/index.md b/website/docs/maintenance/backups/index.md index c3a97bcc6..8004833f5 100644 --- a/website/docs/maintenance/backups/index.md +++ b/website/docs/maintenance/backups/index.md @@ -17,27 +17,26 @@ Local backups can be created by running the following command in your authentik ``` docker-compose run --rm worker backup # Or for kubernetes -kubectl exec -it authentik-worker-.... -- ./lifecycle/bootstrap.sh backup +kubectl exec -it deployment/authentik-worker -c authentik -- ak backup ``` This will dump the current database into the `./backups` folder. By defaults, the last 10 Backups are kept. ### Restore +:::warning +Currently, it is only supported to restore backups into the same version they have been taken from. Different versions *might* work, but this is not guarantee. +Instead, install the version the backup was taken with, restore the backup and then upgrade. +::: + Run this command in your authentik installation directory -``` -docker-compose run --rm worker restore -# Or for kubernetes -kubectl exec -it authentik-worker-.... -- ./lifecycle/bootstrap.sh restore -``` - -This will prompt you to restore from your last backup. If you want to restore from a specific file, use the `-i` flag with the filename: +The filename can be found by either looking into the `./backups` directory or using S3. ``` docker-compose run --rm worker restore -i default-2020-10-03-115557.psql # Or for kubernetes -kubectl exec -it authentik-worker-.... -- ./lifecycle/bootstrap.sh restore -i default-2020-10-03-115557.psql +kubectl exec -it deployment/authentik-worker -c authentik -- ak restore -i default-2020-10-03-115557.psql ``` After you've restored the backup, it is recommended to restart all services with `docker-compose restart` or `kubectl restart deployment --all`. diff --git a/website/docs/troubleshooting/emails.md b/website/docs/troubleshooting/emails.md index 13323624e..71efad742 100644 --- a/website/docs/troubleshooting/emails.md +++ b/website/docs/troubleshooting/emails.md @@ -19,5 +19,5 @@ docker-compose exec -it worker ./manage.py test_email [...] To run this command with Kubernetes, use ``` -kubectl exec -it authentik-worker-xxxxx -- ./manage.py test_email [...] +kubectl exec -it deployment/authentik-worker -c authentik -- ./manage.py test_email [...] ``` diff --git a/website/docs/troubleshooting/login.md b/website/docs/troubleshooting/login.md index 07136f0bc..5dd68fb63 100644 --- a/website/docs/troubleshooting/login.md +++ b/website/docs/troubleshooting/login.md @@ -17,7 +17,7 @@ docker-compose run --rm server create_recovery_key 10 akadmin or, for Kubernetes, run ``` -kubectl exec -it authentik-web- -- ./manage.py create_recovery_key 10 akadmin +kubectl exec -it deployment/authentik-web -c authentik -- ak create_recovery_key 10 akadmin ``` This will output a link, that can be used to instantly gain access to authentik as the user specified above. The link is valid for amount of years specified above, in this case, 10 years. diff --git a/website/docs/troubleshooting/missing_permission.md b/website/docs/troubleshooting/missing_permission.md index 23c2890ba..27331764a 100644 --- a/website/docs/troubleshooting/missing_permission.md +++ b/website/docs/troubleshooting/missing_permission.md @@ -11,7 +11,7 @@ If it does, you can run the following command to ensure all permissions exist: ``` docker-compose run --rm worker repair_permissions # Or for kubernetes -kubectl exec -it authentik-worker-.... -- ak repair_permissions +kubectl exec -it deployment/authentik-worker -c authentik -- ak repair_permissions ``` If the error persists after running this command, please open an Issue on [GitHub](https://github.com/goauthentik/authentik/issues/)