Skip to content

Commit 5407ee4

Browse files
SamyOubouaziztgenaitay
authored andcommitted
docs(srv): add notes and troubleshooting on encoding secrets and env vars MTA-5183 (#3889)
1 parent 2b808c2 commit 5407ee4

File tree

8 files changed

+68
-2
lines changed

8 files changed

+68
-2
lines changed

serverless/containers/how-to/deploy-a-container-from-external-container-registry.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ For now, Serverless Containers only supports public images.
4848
- Set your [scaling](/serverless/containers/concepts/#scaling) preferences, or leave them at default values. The Scaleway platform autoscales the number of available instances of your container to match the incoming load, depending on the settings you define here.
4949
- Click **Advanced options** to define any [environment variables](/serverless/containers/concepts/#environment-variables) you want to inject into your container. For each environment variable, click **+Add variable** and enter the key/value pair.
5050
- Add [secrets](/serverless/containers/concepts/#secrets) for your container. Secrets are environment variables which are injected into your container, but the values are not retained or displayed by Scaleway after initial validation.
51+
<Message type="note">
52+
Encode your environment variables and secrets to `base64` if they are too large, and contain carriage returns.
53+
</Message>
5154
- Set the desired [privacy policy](/serverless/containers/concepts/#privacy-policy) for your container. This defines whether container invocation may be done anonymously (**public**) or only via an authentication mechanism provided by the [Scaleway API](https://www.scaleway.com/en/developers/api/serverless-containers/#authentication) (**private**).
5255
- Set a custom [timeout](/serverless/containers/concepts/#timeout) for your container.
5356
- Verify the **estimated cost**.

serverless/containers/how-to/deploy-a-container-from-scaleway-container-registry.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ You can deploy a container from the [Scaleway Container Registry](/containers/co
4242
- Set your [scaling](/serverless/containers/concepts/#scaling) preferences, or leave them at default values. The Scaleway platform autoscales the number of available instances of your container to match the incoming load, depending on the settings you define here.
4343
- Click **Advanced options** to define any [environment variables](/serverless/containers/concepts/#environment-variables) you want to inject into your container. For each environment variable, click **+Add variable** and enter the key/value pair.
4444
- Add [secrets](/serverless/containers/concepts/#secrets) for your container. Secrets are environment variables which are injected into your container, but the values are not retained or displayed by Scaleway after initial validation.
45+
<Message type="note">
46+
Encode your environment variables and secrets to `base64` if they are too large, and contain carriage returns.
47+
</Message>
4548
- Set the desired [privacy policy](/serverless/containers/concepts/#privacy-policy) for your container. This defines whether container invocation may be done anonymously (**public**) or only via an authentication mechanism provided by the [Scaleway API](https://www.scaleway.com/en/developers/api/serverless-containers/#authentication) (**private**).
4649
- Set a custom [timeout](/serverless/containers/concepts/#timeout) for your container.
4750
- Verify the **estimated cost**.

serverless/containers/troubleshooting/common-errors.mdx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,21 @@ Serverless products support external public registries (such as [Docker Hub](htt
6565

6666
### Solution
6767

68-
We recommend using [Scaleway's Container Registry](/containers/container-registry/) instead, as it allows for a seamless integration with Serverless Containers and Jobs at a [competitive price](/faq/containerregistry/#how-am-i-billed-for-scaleway-container-registry).
68+
We recommend using [Scaleway's Container Registry](/containers/container-registry/) instead, as it allows for a seamless integration with Serverless Containers and Jobs at a [competitive price](/faq/containerregistry/#how-am-i-billed-for-scaleway-container-registry).
69+
70+
## My environment variable or secret is not properly injected in my container
71+
72+
### Cause
73+
74+
Environment variables or secrets that are too large, contain carriage returns and spread over several lines, as shown below, will not be injected properly.
75+
76+
```
77+
"hello
78+
world
79+
.
80+
"
81+
```
82+
83+
### Solution
84+
85+
To avoid issues while injecting environment variables and secrets, we recommend encoding them to `base64`.

serverless/functions/how-to/create-a-function.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ This page shows you how to deploy a [function](/serverless/functions/concepts/#f
4141
5. Click **+ Advanced options** and complete the following steps:
4242
- Define any **environment variables** you want to inject into your function. For each environment variable, click **+ Add variable** and enter the key/value pair.
4343
- Optionally, set secret environment variables. **Secrets** are environment variables which are injected into your function and stored securely, but not displayed in the console after initial validation. Add a **key** and a **value**.
44+
<Message type="note">
45+
Encode your environment variables and secrets to `base64` if they are too large, and contain carriage returns.
46+
</Message>
4447
- Set the desired **privacy policy** for your function. This defines whether a function can be executed anonymously (**public**) or only via an authentication mechanism provided by the [Scaleway API](https://www.scaleway.com/en/developers/api/serverless-functions/#authentication) (**private**).
4548
- Set the desired timeout for your function.
4649
<Message type="note">

serverless/functions/troubleshooting/common-errors.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,20 @@ The new deploy failed, and the [fallback mechanism has been triggered](/serverle
108108
### Possible solution
109109

110110
Identify the element that caused the deployment to fail, fix the error, and deploy the function again.
111+
112+
## My environment variable or secret is not properly injected in my function
113+
114+
### Cause
115+
116+
Environment variables or secrets that are too large, contain carriage returns and spread over several lines, as shown below, will not be injected properly.
117+
118+
```
119+
"hello
120+
world
121+
.
122+
"
123+
```
124+
125+
### Solution
126+
127+
To avoid issues while injecting environment variables and secrets, we recommend encoding them to `base64`.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ Private external container registries are currently not supported.
3939
- Choose the **resources** to be allocated to your job at runtime. These define the performance characteristics of your job.
4040
- Optionally, add a **cron schedule** in the `* * * * *` format, and select your time zone to run your job periodically. Refer to the [cron schedules documentation](/serverless/jobs/reference-content/cron-schedules/) for more information.
4141
- Define any **environment variables** you want to inject into your job in the advanced options. For each environment variable, click **+Add new variable** and enter the key/value pair.
42+
<Message type="note">
43+
Encode your environment variables to `base64` if they are too large, and contain carriage returns.
44+
</Message>
4245
- Add a **startup command** to your job. It will be executed every time your job is run.
4346
- Set a **maximum duration** to your job to stop it automatically if it does not complete within this limit.
4447
- Verify the **estimated cost**.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ Scaleway's Serverless Jobs allows you to create jobs from several container [reg
3434
- Choose the **resources** to be allocated to your job at runtime. These define the performance characteristics of your job.
3535
- Add a **cron schedule** in the `* * * * *` format, and select your time zone to run your job periodically. Refer to the [cron schedules documentation](/serverless/jobs/reference-content/cron-schedules/) for more information.
3636
- Define any **environment variables** you want to inject into your job in the advanced options. For each environment variable, click **+Add new variable** and enter the key/value pair.
37+
<Message type="note">
38+
Encode your environment variables to `base64` if they are too large, and contain carriage returns.
39+
</Message>
3740
- Add a **startup command** to your job. It will be executed every time your job is run.
3841
- Set a **maximum duration** to your job to stop it automatically if it does not complete within this limit.
3942
- Verify the **estimated cost**.

serverless/jobs/troubleshooting/common-errors.mdx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,21 @@ Serverless products support external public registries (such as [Docker Hub](htt
2929

3030
### Solution
3131

32-
We recommend using [Scaleway's Container Registry](/containers/container-registry/) instead, as it allows for a seamless integration with Serverless Containers and Jobs at a [competitive price](/faq/containerregistry/#how-am-i-billed-for-scaleway-container-registry).
32+
We recommend using [Scaleway's Container Registry](/containers/container-registry/) instead, as it allows for a seamless integration with Serverless Containers and Jobs at a [competitive price](/faq/containerregistry/#how-am-i-billed-for-scaleway-container-registry).
33+
34+
## My environment variable or secret is not properly injected in my job
35+
36+
### Cause
37+
38+
Environment variables or secrets that are too large, contain carriage returns and spread over several lines, as shown below, will not be injected properly.
39+
40+
```
41+
"hello
42+
world
43+
.
44+
"
45+
```
46+
47+
### Solution
48+
49+
To avoid issues while injecting environment variables and secrets, we recommend encoding them to `base64`.

0 commit comments

Comments
 (0)