Test Rok¶
This section will guide you through testing the snapshotting functionality of Rok, so that you make sure you have installed it properly.
Fast Forward
If you have already tested the Rok snapshotting functionality, expand this box to fast-forward.
- Proceed to the What’s Next section.
Overview
What You’ll Need¶
- A configured management environment.
- Your clone of the Arrikto GitOps repository.
- An existing Rok deployment.
- A configured Rok account named
user
.
Procedure¶
Go to your GitOps repository, inside your
rok-tools
management environment:root@rok-tools:/# cd ~/ops/deploymentsSpecify the personal namespace for user
user
:root@rok-tools:~/ops/deployments# export NAMESPACE=kubeflow-user(Optional) If you are not planning to install Kubeflow alongside Rok, set the namespace to
personal-user
instead:root@rok-tools:~/ops/deployments# export NAMESPACE=personal-userRender the manifest for a PostgreSQL application with two StatefulSets:
root@rok-tools:~/ops/deployments# j2 rok/rok-test/psql.yaml.j2 \ > -o rok/rok-test/psql.yamlCommit the changes:
root@rok-tools:~/ops/deployments# git commit -am "Configure test PostgreSQL application"Expose Istio IngressGateway:
root@rok-tools:~/ops/deployments# kubectl port-forward --address 0.0.0.0 -n istio-system service/istio-ingressgateway 8080:80Forward traffic from your local host to
rok-tools
. Choose one of the following options based on how you created your management environment:user@workstation:~# kubectl port-forward services/rok-tools 8080:8080Skip to the next step.
Skip to the next step.
Visit the Rok login page at http://127.0.0.1:8080/rok/. You will immediately be redirected to Dex in order to login.
Air Gapped
Use dynamic port forwarding along with SOCKS5 protocol in your browser.
Log in as
user@example.com
with the password you created when creating theuser
Rok account.Important
After logging in you will get an error stating “Cannot access account
user
in Rok, namespaceuser
does not exist in Kubernetes”. This is a known issue. As a workaround, dismiss the message and enter the namespace manually in the top right input box:- If you followed the Configure Rok Account Management guide, use
personal-user
. - If you skipped the Configure Rok Account Management guide, use
kubeflow-user
.
- If you followed the Configure Rok Account Management guide, use
Switch to your GitOps repository, inside your
rok-tools
management environment, and pressCTRL+C
to stop forwarding traffic to your cluster.Apply your test application:
root@rok-tools:~/ops/deployments# kubectl apply -f rok/rok-test/psql.yamlResume forwarding traffic to your cluster:
root@rok-tools:~/ops/deployments# kubectl port-forward --address 0.0.0.0 -n istio-system service/istio-ingressgateway 8080:80Return to the Rok UI at http://127.0.0.1:8080/rok/.
Create a bucket, and snapshot the PostgreSQL StatefulSets in your personal namespace using the corresponding driver.
Delete or terminate the node that a PostgreSQL pod was running on to trigger an automatic restore.
Switch to your GitOps repository, inside your
rok-tools
management environment, and pressCTRL+C
to stop forwarding traffic to your cluster.Clean up the test resources you previously created:
root@rok-tools:~/ops/deployments# kubectl delete -f rok/rok-test/psql.yaml root@rok-tools:~/ops/deployments# kubectl delete pvc -n ${NAMESPACE?} -l app=postgresql
What’s Next¶
The next step is to set up Rok storage class as your default storage class.