Skip to content

Commit c4ba6bf

Browse files
SamyOubouaziznerda-codesRoRoJthomas-tacquetjcirinosclwy
authored
docs(srv): add SEM x Jobs documentation MTA-5199 (#3898)
* docs(srv): add SEM x Jobs documentation MTA-5199 * Update serverless/jobs/quickstart.mdx Co-authored-by: nerda-codes <[email protected]> * Update faq/serverless-jobs.mdx Co-authored-by: Rowena Jones <[email protected]> * Update serverless/jobs/how-to/reference-secret-in-job.mdx Co-authored-by: Rowena Jones <[email protected]> * Update serverless/jobs/how-to/reference-secret-in-job.mdx Co-authored-by: Thomas TACQUET <[email protected]> * Update serverless/jobs/how-to/reference-secret-in-job.mdx Co-authored-by: Rowena Jones <[email protected]> * Update serverless/jobs/how-to/reference-secret-in-job.mdx Co-authored-by: nerda-codes <[email protected]> * Update serverless/jobs/how-to/reference-secret-in-job.mdx Co-authored-by: Thomas TACQUET <[email protected]> * Update serverless/jobs/how-to/reference-secret-in-job.mdx Co-authored-by: nerda-codes <[email protected]> * Update serverless/jobs/quickstart.mdx Co-authored-by: nerda-codes <[email protected]> * docs(srv): upadate * Update serverless/jobs/how-to/reference-secret-in-job.mdx Co-authored-by: Jessica <[email protected]> * Update serverless/jobs/how-to/create-job-from-external-registry.mdx Co-authored-by: Jessica <[email protected]> --------- Co-authored-by: nerda-codes <[email protected]> Co-authored-by: Rowena Jones <[email protected]> Co-authored-by: Thomas TACQUET <[email protected]> Co-authored-by: Jessica <[email protected]>
1 parent 42b189d commit c4ba6bf

File tree

7 files changed

+99
-3
lines changed

7 files changed

+99
-3
lines changed

faq/serverless-jobs.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Serverless Jobs are billed on a pay-as-you-go basis, strictly on resource consum
6666
* *Billed resources:* 864 000 - 400 000 = 464 000 GB-s
6767
* *Cost:* 464 000 * €0.0000010 = **€0.47**
6868
* **vCPU consumption**
69-
* *Allocated vCPU conversion:* 1120mVCPU = 1.12 vCPU
69+
* *Allocated vCPU conversion:* 1120 mVCPU = 1.12 vCPU
7070
* *Resource consumption:* 432 000 s * 1.12 vCPU = 483 840 vCPU-s
7171
* *Free tier:* 200 000 vCPU-s
7272
* *Billed resources:* 483 840 - 200 000 = 283 840 vCPU-s
@@ -120,3 +120,7 @@ skopeo copy --override-os linux docker://docker.io/alpine:latest docker://rg.fr-
120120
Scaleway Serverless Jobs does not currently support Scaleway VPC or Private Networks, though this feature is under development.
121121

122122
To add network restrictions on your resource, consult the [list of prefixes used at Scaleway](https://www.scaleway.com/en/peering/). Serverless resources do not have dedicated or predictable IP addresses.
123+
124+
## Can I securely use sensitive information with Serverless Jobs?
125+
126+
Yes, you can use sensitive data such as API secret keys, passwords, TLS/SSL certificates, or tokens. Serverless Jobs seamlessly integrates with [Secret Manager](/identity-and-access-management/secret-manager/), which allows you to securely reference sensitive information within your jobs. Refer to the [dedicated documentation](/serverless/jobs/how-to/reference-secret-in-job/) for more information.

menu/navigation.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3933,6 +3933,10 @@
39333933
"label": "Manage the scheduling of a job",
39343934
"slug": "manage-job-schedule"
39353935
},
3936+
{
3937+
"label": "Reference secrets in a job",
3938+
"slug": "reference-secret-in-job"
3939+
},
39363940
{
39373941
"label": "Delete a job",
39383942
"slug": "delete-job"

serverless/jobs/concepts.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ The maximum duration option allows you to define the maximum execution time befo
5353

5454
A schedule (cron) is a mechanism used to automatically start a Serverless Job at a specific time on a recurring schedule. It works similarly to a traditional Linux cron job, using the `* * * * *` format. Refer to our [cron schedules reference](/serverless/jobs/reference-content/cron-schedules/) for more information.
5555

56+
## Secrets reference
57+
58+
A secret reference is a mechanism that allows you to use a secret stored in [Secret Manager](/identity-and-access-management/secret-manager/) within Serverless Jobs. It allows you to securely reference sensitive data, such as API secret keys, passwords, tokens, or certificates.
59+
5660
## Startup command
5761

5862
This optional field allows you to specify a custom command executed upon starting your job if your container image does not have one already, or if you use a public container image.

serverless/jobs/how-to/create-job-from-external-registry.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Private external container registries are currently not supported.
4242
<Message type="note">
4343
Encode your environment variables to `base64` if they are too large, and contain carriage returns.
4444
</Message>
45+
- Add the desired [secret references](/serverless/jobs/how-to/reference-secret-in-job/) to your job.
4546
- Add a **startup command** to your job. It will be executed every time your job is run.
4647
- Set a **maximum duration** to your job to stop it automatically if it does not complete within this limit.
4748
- Verify the **estimated cost**.

serverless/jobs/how-to/create-job-from-scaleway-registry.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Scaleway's Serverless Jobs allows you to create jobs from several container [reg
3737
<Message type="note">
3838
Encode your environment variables to `base64` if they are too large, and contain carriage returns.
3939
</Message>
40+
- Add the desired [secret references](/serverless/jobs/how-to/reference-secret-in-job/) to your job.
4041
- Add a **startup command** to your job. It will be executed every time your job is run.
4142
- Set a **maximum duration** to your job to stop it automatically if it does not complete within this limit.
4243
- Verify the **estimated cost**.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
meta:
3+
title: How to reference secrets in Serverless Jobs
4+
description: Steps to reference secrets from Secret Manager in your Serverless Jobs.
5+
content:
6+
h1: How to reference secrets in Serverless Jobs
7+
paragraph: Steps to reference secrets from Secret Manager in your Serverless Jobs.
8+
tags: serverless jobs secrets secret-manager environment-variable
9+
dates:
10+
validation: 2024-10-27
11+
posted: 2024-10-27
12+
categories:
13+
- serverless
14+
- jobs
15+
---
16+
17+
Serverless Jobs seamlessly integrates with [Secret Manager](/identity-and-access-management/secret-manager/), which allows you to store, manage, and access sensitive information, such as credentials, SSH keys, SSL/TLS certificates, or any key/value pairs you need to secure.
18+
19+
You can reference any secret stored in Secret Manager in a job, without having to hardcode any sensitive data.
20+
21+
A [job run](/serverless/jobs/concepts/#job-run) accesses each secret at startup, and each access generates a call to the Secret Manager API, which is billed accordingly. Refer to the [Secret Manager pricing](/identity-and-access-management/secret-manager) for more information.
22+
23+
<Macro id="requirements" />
24+
25+
- A Scaleway account logged into the [console](https://console.scaleway.com)
26+
- [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization
27+
- [Created a Serverless Job](/serverless/jobs/how-to/create-job-from-scaleway-registry/)
28+
- [Created a secret](/identity-and-access-management/secret-manager/how-to/create-secret/)
29+
30+
## Reference a secret in a job
31+
32+
1. Click **Jobs** in the **Serverless** section of the side menu. The jobs page displays.
33+
34+
2. Click the name of the job to which you want to add a secret, then open the **Settings** tab.
35+
36+
3. In the **Secrets references** section, click **+ Add secret reference**. A pop-up displays.
37+
38+
4. Select the secret you want to reference, and the desired version, then click **Select reference method**.
39+
40+
5. Select the desired reference method:
41+
42+
- **File**: copies the encrypted value of your secret to a file stored at the indicated location within your container. This method is recommended for large or complex data. For example, if your secret is a certificate, you can store it as a file in the `/my-certificates` folder in your container.
43+
44+
- **Environment variable**: passes the encrypted value of your secret to your job as a variable. This method is recommended for small pieces of information, such as passwords, or API secret keys. For example, if you name this variable `MY_SECRET`, calling `$MY_SECRET` in your container will return the value of the selected secret in a secure way.
45+
46+
6. Click **Add reference** to add the secret to your Serverless Job. Optionally, tick the **Add another reference** to add a new secret right away, then repeat steps 4 to 6.
47+
48+
The secret is now referenced in your Serverless Job, and can be used within the container.
49+
50+
## Update a secret reference from a job
51+
52+
1. Click **Jobs** in the **Serverless** section of the side menu. The jobs page displays.
53+
54+
2. Click the name of the job for which you want to update a secret, then open the **Settings** tab.
55+
56+
3. In the **Secret references** section, click the <Icon name="edit" /> icon next to the secret reference you want to update. A pop-up displays.
57+
58+
4. Update the secret version if needed, then click **Update** to save your changes, or click **Select reference method** to continue.
59+
60+
5. Either update the location of the file, or the name of the environment variable, then click **Update reference** to confirm your changes.
61+
62+
<Message type="note">
63+
You cannot change the reference method of an existing secret. You have to delete the secret reference within the job first, then create it again with the desired reference method.
64+
</Message>
65+
66+
## Delete a secret reference from a job
67+
68+
1. Click **Jobs** in the **Serverless** section of the side menu. The jobs page displays.
69+
70+
2. Click the name of the job for which you want to delete a secret, then open the **Settings** tab.
71+
72+
3. In the **Secret references** section, click the <Icon name="delete" /> icon next to the secret reference you want to delete. A confirmation pop-up displays.
73+
74+
4. Click **Delete reference** to confirm.
75+
76+
The secret is no longer referenced in your Serverless Job.
77+
78+
<Message type="note">
79+
Deleting a secret from the **Settings** tab of a job only deletes the secret reference, not the secret itself. To permanently delete a secret, follow [this procedure](/identity-and-access-management/secret-manager/how-to/delete-secret/).
80+
</Message>

serverless/jobs/quickstart.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,12 @@ This page explains how to create a job definition with the latest Alpine Linux i
6262

6363
3. From the **Overview** tab, click **Run job**.
6464

65-
The execution appears in the **Job runs** section of the **Overview** tab.
65+
The execution appears in the **Job runs** section of the **Overview** tab.
66+
67+
4. Click the <Icon name="more"> icon next to the last execution in the **Job runs** section, then click **Logs** to access your job's logs.
6668

6769
<Message type="note">
68-
Refer to [How to monitor a job](/serverless/jobs/how-to/monitor-job/) to see the logs of the job you just executed.
70+
Make sure that you [have retrieved your Grafana credentials](/observability/cockpit/how-to/retrieve-grafana-credentials/) before accessing your job's logs.
6971
</Message>
7072

7173
## How to delete a job

0 commit comments

Comments
 (0)