Conf’o’rama

Conf’o’rama is a component created by Saagie. Using an HTTP API call, Conf’o’rama 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.

1. Retrieve authentication token

In order to work with files mounted using Conf’o’rama, you’ll 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:

    kubectl -n saagie-common get secret saagie-common-conf-upload-token
  2. Retrieve the token by running the following command:

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

1.1. Troubleshooting

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

1.1.1. Option 1: Create a 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.

  4. Your token is ready to use.

1.1.2. Option 2: Recover the token.

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 will look similar to this:

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. There is no need to reboot the pod.

2. Using Conf’o’rama

Once files have been mounted using Conf’o’rama, the following actions are possible:

  1. Create files

  2. Delete files

  3. List files

  4. Retrieve file contents

2.1. Create files

Create a file on a platform by running the following cURL:

curl -X POST https://<saagie_host>/conf/upload/<customer>/<platorm_id>/<my/file/path/mounted/in/jobs.xml> -F file=@/my-file.xml -H "Authorization: Bearer $TOKEN" (1)
1 Replace <saagie_host>, <customer>, <platorm_id>, and <my/file/path/mounted/in/jobs.xml> with your values.

2.2. Delete files

Delete a file from a platform by running the following cURL:

curl -X DELETE https://<saagie_host>/conf/<customer>/<platorm_id>/<my/file/path/mounted/in/jobs.xml> -H "Authorization: Bearer $TOKEN" (1)
1 Replace <saagie_host>, <customer>, <platorm_id>, and <my/file/path/mounted/in/jobs.xml> with your values.

2.3. List files

Listing files mounted to a platform is a two-step process.

  1. First, connect to service via the Conf’o’rama port by running the following command:

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

    curl http://localhost:8080/configuration/<customer>/<platorm_id>?path=/ (1)
    1 Replace <customer> and <platorm_id> with your values.

2.4. Retrieve file contents

Retrieving the contents of a file is a two-step process.

  1. First, connect to service via the Conf’o’rama port by running the following command:

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

    curl http://localhost:8080/configuration/<customer>/<platorm_id>/<my/file/path/mounted/in/jobs.xml> (1)
    1 Replace <customer>, <platorm_id>, and <my/file/path/mounted/in/jobs.xml> with your values.