Test Rok

This section will guide you through testing the snapshotting functionality of Rok, so that you make sure you have installed it properly.

What You’ll Need

Procedure

  1. Go to your GitOps repository, inside your rok-tools management environment:

    root@rok-tools:/# cd ~/ops/deployments
  2. Specify the personal namespace for user user:

    root@rok-tools:~/ops/deployments# export NAMESPACE=kubeflow-user
  3. (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-user
  4. Render 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.yaml
  5. Commit the changes:

    root@rok-tools:~/ops/deployments# git commit -am "Configure test PostgreSQL application"
  6. Expose Istio IngressGateway:

    root@rok-tools:~/ops/deployments# kubectl port-forward --address 0.0.0.0 -n istio-system service/istio-ingressgateway 8080:80
  7. Forward 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:8080

    Skip to the next step.

    Skip to the next step.

  8. Visit the Rok login page at http://127.0.0.1:8080/rok/. You will immediately be redirected to Dex in order to login.

  9. Log in as user@example.com with the password you created when creating the user Rok account.

    Important

    After logging in you will get an error stating “Cannot access account user in Rok, namespace user 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:

  10. Switch to your GitOps repository, inside your rok-tools management environment, and press CTRL+C to stop forwarding traffic to your cluster.

  11. Apply your test application:

    root@rok-tools:~/ops/deployments# kubectl apply -f rok/rok-test/psql.yaml
  12. Resume 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:80
  13. Return to the Rok UI at http://127.0.0.1:8080/rok/.

  14. Create a bucket, and snapshot the PostgreSQL StatefulSets in your personal namespace using the corresponding driver.

  15. Delete or terminate the node that a PostgreSQL pod was running on to trigger an automatic restore.

  16. Switch to your GitOps repository, inside your rok-tools management environment, and press CTRL+C to stop forwarding traffic to your cluster.

  17. 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

Summary

You have successfully tested the snapshotting functionality of Rok.

What’s Next

The next step is to set up Rok storage class as your default storage class.