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
.
-
Verify the presence of the token by running the following command:
kubectl -n saagie-common get secret saagie-common-conf-upload-token
-
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.
-
Generate a token.
-
Create a secret named
saagie-common-conf-upload-token
that contains the token you generated. -
Reboot the Conf’o’rama pod.
-
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:
-
Create files
-
Delete files
-
List files
-
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>/<platform_id>/<my/file/path/mounted/in/jobs.xml> -T my-file.xml -H "Authorization: Bearer $TOKEN" (1)
1 | Replace <saagie_host> , <customer> , <platform_id> , and <my/file/path/mounted/in/jobs.xml> with your values. |
The <my/file/path/mounted/in/jobs.xml> value is the path to the location where your file will be saved.
|
2.2. Delete files
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" (1)
1 | Replace <saagie_host> , <customer> , <platform_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.
-
First, connect to service via the Conf’o’rama port by running the following command:
kubectl port-forward service/saagie-common-conforama 8080:80
-
Then, list the mounted files by running the following cURL:
curl http://localhost:8080/configuration/<customer>/<platform_id>?path=/ (1)
1 Replace <customer>
and<platform_id>
with your values.
2.4. Retrieve file contents
Retrieving the contents of a file is a two-step process.
-
First, connect to service via the Conf’o’rama port by running the following command:
kubectl port-forward service/saagie-common-conforama 8080:80
-
Then, 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> (1)
1 Replace <customer>
,<platform_id>
, and<my/file/path/mounted/in/jobs.xml>
with your values.