Conf’o’rama

Conf’o’rama is a component created by Saagie using an HTTP API call that allows files to be mounted to a platform’s MinIO.

Conf’o’rama acts at the platform level. All files mounted using Conf’o’rama are accessible to the entire platform, meaning all namespaces, projects, jobs, and apps located on that platform.

Retrieving Authentication Token

To work with files mounted using Conf’o’rama, you will need to use an authentication token to call the Conf’o’rama API. This token is stored in a secret named saagie-common-conf-upload-token.

  1. Verify the presence of the token by running the following command line:

    kubectl -n <installationId> get secret saagie-common-conf-upload-token

    Where:

  2. Retrieve the token by running the following command line:

    TOKEN=$(kubectl -n <installationId> get secret saagie-common-conf-upload-token -o jsonpath='{@.data.token}' | base64 -d)

    Where:

Troubleshooting

If the secret saagie-common-conf-upload-token does not exist, choose one of the two following options:

  • Option 1 – Create a Token

  • Option 2 – Recover the Token

  1. Generate a token.

  2. Create a secret named saagie-common-conf-upload-token that contains the token you generated.

  3. Reboot the Conf’o’rama pod.
    Your token is ready to use.

If the secret saagie-common-conf-upload-token does not exist, Conf’o’rama automatically generates a token. You can recover this token by searching the pod’s logs. It should look like the following code lines:

2020-05-25 07:16:21.050 [main] INFO  io.saagie.conforama.infra.Main - Authentication token generated :

    Token : whtIwteJEptSXoIKogqP974bnzPgtUPWWIsiZabaFWbVVxc68OY3Nsj1FBJdE84x7LDl1K9qunDocFMEb3avTAgHLAQboymzvjZufBN1kbjYJFwejtvQpQflJE80P4mp (1)
1 This token will not function. Your token will be unique.

Once recovered, you can use it immediately. No need to reboot the pod.

Using Conf’o’rama

Once files have been mounted using Conf’o’rama, you will be able to create, delete, and list files, and retrieve file content.

  • Create Files

  • Delete Files

  • List Files

  • Retrieve File Contents

You can create a file on a platform by running the following cURL:

curl -X POST https://<saagie_host>/conf/upload/<customer>/<platform_id>/<my/file/path/mounted/in/jobs.xml> -T my-file.xml -H "Authorization: Bearer $TOKEN"

Where:

  • <saagie_host> must be replaced with your value.

  • <customer> must be replaced with your value.

  • <platform_id> must be replaced with your value.

  • <my/file/path/mounted/in/jobs.xml> must be replaced with your value, which is the path to the location where your file will be saved.

You can delete a file from a platform by running the following cURL:

curl -X DELETE https://<saagie_host>/conf/<customer>/<platform_id>/<my/file/path/mounted/in/jobs.xml> -H "Authorization: Bearer $TOKEN"

Where:

  • <saagie_host> must be replaced with your value.

  • <customer> must be replaced with your value.

  • <platform_id> must be replaced with your value.

  • <my/file/path/mounted/in/jobs.xml> must be replaced with your value, which is the path to the location where your file will be saved.

You can list files mounted to a platform.

  1. Connect to service via the Conf’o’rama port by running the following kubectl command line:

    kubectl port-forward service/saagie-common-conforama 8080:80
  2. List the mounted files by running the following cURL:

    curl http://localhost:8080/configuration/<customer>/<platform_id>?path=/

    Where:

    • <customer> must be replaced with your value.

    • <platform_id> must be replaced with your value.

You can retrieve the contents of a file.

  1. Connect to service via the Conf’o’rama port by running the following kubectl command line:

    kubectl port-forward service/saagie-common-conforama 8080:80
  2. Retrieve the contents of file by running the following cURL:

    curl http://localhost:8080/configuration/<customer>/<platform_id>/<my/file/path/mounted/in/jobs.xml>

    Where:

    • <customer> must be replaced with your value.

    • <platform_id> must be replaced with your value.

    • <my/file/path/mounted/in/jobs.xml> must be replaced with your value, which is the path to the location where your file will be saved.