Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 57 additions & 29 deletions pages/serverless-containers/how-to/deploy-container.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,34 @@ You can deploy a container from the [Scaleway Container Registry](/container-reg
1. Click **Containers** in the **Serverless** section of the side menu. The containers page displays.
2. Click the relevant container's namespace.
3. Click **Deploy container**. The container creation wizard displays.
4. Complete the following steps in the wizard:
- Select the **Scaleway** Container Registry.
- Choose an [image](/serverless-containers/concepts/#container-image) from your Container Registry.
- Select the required Container Registry namespace from the drop-down list, and then select the container and tag.
- Choose the [port](/serverless-containers/concepts/#port) your container is listening on. We recommend configuring your container to listen on the `$PORT` environment variable.
- Choose a **name** for your container and, optionally, a **description**. The name must only contain alphanumeric characters and dashes.
- Choose the **resources** to be allocated to your container at runtime. These define the performance characteristics of your container.
<Message type="note">
Available memory depends on allocated vCPU, and the maximum ephemeral storage value depends on allocated memory.
</Message>
5. Set your [autoscaling](/serverless-containers/concepts/#autoscaling) preferences:

### Container image configuration

1. Select the **Scaleway** Container Registry.

2. Choose an [image](/serverless-containers/concepts/#container-image) from your Container Registry.

3. Select the required Container Registry namespace from the drop-down list, and then select the container and tag.

4. Choose the [port](/serverless-containers/concepts/#port) your container is listening on. We recommend configuring your container to listen on the `$PORT` environment variable.

5. Choose a **name** for your container and, optionally, a **description**. The name must only contain alphanumeric characters and dashes.

### Container resources and scaling

1. Choose the **CPU** resources to be allocated to your container at runtime.

2. Choose the amount of **memory** to be allocated to your container. Available memory options depend on allocated vCPU, and the maximum ephemeral storage value depends on allocated memory.
3. Set your [autoscaling](/serverless-containers/concepts/#autoscaling) preferences:
- **Request concurrency**: your container automatically scales up/down within the minimum and maximum values entered based on the number of concurrent requests received on each active instance of your container.
- **CPU percentage**: your container automatically scales up/down within the minimum and maximum values entered based on the CPU load.
- **RAM percentage**: your container automatically scales up/down within the minimum and maximum values entered based on the RAM used.
6. In the **Advanced options** section, set the following:
<Tabs>

### Container advanced options

In the **Advanced options** section, set the following:

<Tabs>
<TabsTab label="Data">
- Declare [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.
- Declare [secrets](/serverless-containers/concepts/#secrets) for your container. Secrets are environment variables that are injected into your container, but the values are not retained or displayed by Scaleway after initial validation.
Expand Down Expand Up @@ -75,9 +87,15 @@ You can deploy a container from the [Scaleway Container Registry](/container-reg
<TabsTab label="Storage">
- Modify the [ephemeral storage](/serverless-containers/concepts/#ephemeral-storage) according to your needs.
</TabsTab>
</Tabs>
7. Verify the **estimated cost**.
8. Click **Deploy container** to finish.
</Tabs>

### Container cost and validation

1. Update the **Number of requests** and **Average request duration** fields to simulate the behavior of your function.

2. Verify the **estimated cost**. Refer to the [Serverless Functions pricing](/serverless-functions/faq/#how-am-i-billed-for-serverless-functions) for more information on how billing works.

3. Click **Create function** to finish.

## Deploy from an external container registry

Expand All @@ -92,23 +110,33 @@ Private external container registries are currently not supported.
1. Click **Containers** in the **Serverless** section of the side menu. The containers page displays.
2. Click the relevant container's namespace.
3. Click **Deploy container**. The container creation wizard displays.
4. Complete the following steps in the wizard:
- Select the **External** container registry.
- Enter the public container **image URL** provided by the external registry. For example:

### Container image configuration

1. Select the **External** container registry.

2. Enter the public container **image URL** provided by the external registry. For example:
- `nginx:latest` to deploy the latest nginx image from [Docker Hub](https://hub.docker.com/)
- `ghcr.io/namespace/image` to deploy an image from [GitHub Container Registry](https://github.com/features/packages)
- Choose the [port](/serverless-containers/concepts/#port) your container is listening on. We recommend configuring your container to listen on the `$PORT` environment variable.
- Choose a **name** for your container and, optionally, a **description**. The name must only contain alphanumeric characters and dashes.
- Choose the **resources** to be allocated to your container at runtime. These define the performance characteristics of your container.
<Message type="note">
Available memory depends on allocated vCPU, and the maximum ephemeral storage value depends on allocated memory.
</Message>
5. Set your [autoscaling](/serverless-containers/concepts/#autoscaling) preferences:
3. Choose the [port](/serverless-containers/concepts/#port) your container is listening on. We recommend configuring your container to listen on the `$PORT` environment variable.

4. Choose a **name** for your container and, optionally, a **description**. The name must only contain alphanumeric characters and dashes.

### Container resources and scaling

1. Choose the **CPU** resources to be allocated to your container at runtime.

2. Choose the amount of **memory** to be allocated to your container. Available memory options depend on allocated vCPU, and the maximum ephemeral storage value depends on allocated memory.
3. Set your [autoscaling](/serverless-containers/concepts/#autoscaling) preferences:
- **Request concurrency**: your container automatically scales up/down within the minimum and maximum values entered based on the number of concurrent requests received on each active instance of your container.
- **CPU percentage**: your container automatically scales up/down within the minimum and maximum values entered based on the CPU load.
- **RAM percentage**: your container automatically scales up/down within the minimum and maximum values entered based on the RAM used.
6. In the **Advanced options** section, set the following:
<Tabs>

### Container advanced options

In the **Advanced options** section, set the following:

<Tabs>
<TabsTab label="Data">
- Declare [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.
- Declare [secrets](/serverless-containers/concepts/#secrets) for your container. Secrets are environment variables that are injected into your container, but the values are not retained or displayed by Scaleway after initial validation.
Expand Down Expand Up @@ -138,6 +166,6 @@ Private external container registries are currently not supported.
<TabsTab label="Storage">
- Modify the [ephemeral storage](/serverless-containers/concepts/#ephemeral-storage) according to your needs.
</TabsTab>
</Tabs>
</Tabs>
7. Verify the **estimated cost**.
8. Click **Deploy container** to finish.
47 changes: 25 additions & 22 deletions pages/serverless-functions/how-to/create-a-function.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,31 @@ This page shows you how to deploy a [function](/serverless-functions/concepts/#s
Define a minimum of **one instance** or more to avoid [cold starts](/serverless-functions/concepts/#cold-start).
</Message>

### Function advanced options (optional)

1. Click **+ Advanced options**.

2. Define any **environment variables** you want to inject into your function. For each environment variable, click **+ Add variable** and enter the key/value pair.

3. Define any **Secrets** you want to inject into your function. For each secret, click **+ Add secret** and enter the key/value pair. Secrets are environment variables which are injected into your function and stored securely, but not displayed in the console after initial validation.

<Message type="note">
Encode your environment variables and secrets to `base64` if they are too large, and contain carriage returns.
</Message>

4. 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**).

5. Tick the box under **HTTPS connections only** to prevent your function from being called from insecure HTTP connections. All HTTP traffic will be redirected to HTTPS.

6. Set the desired timeout for your function.

7. Choose the desired **Sandbox** environment for your function.
<Message type="note">
[Triggers](/serverless-functions/concepts/#trigger) can no longer be added from this screen. For more information, refer to the [How to add a trigger to a function](/serverless-functions/how-to/add-trigger-to-a-function/) documentation.
</Message>
### Function advanced options

In the **Advanced options** section, set the following:

<Tabs>
<TabsTab label="Data">
- Declare [environment variables](/serverless-functions/concepts/#environment-variables) you want to inject into your function. For each environment variable, click **+Add variable** and enter the key/value pair.
- Declare [secrets](/serverless-functions/concepts/#secrets) for your function. Secrets are environment variables that are injected into your function, but the values are not retained or displayed by Scaleway after initial validation.
<Message type="note">
Encode your environment variables and secrets to `base64` if they are too large, and contain carriage returns.
</Message>
</TabsTab>
<TabsTab label="Security">
- Set the desired [privacy policy](/serverless-functions/concepts/#privacy-policy) for your function. This defines whether function 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-functions/#authentication) (**private**).
- Tick the box under **HTTPS connections only** to prevent your function from being called from insecure HTTP connections. All HTTP traffic will be redirected to HTTPS.
</TabsTab>
<TabsTab label="Requests">
- Set a custom [timeout](/serverless-functions/concepts/#request-timeout) for the duration of the requests received by your function.
</TabsTab>
<TabsTab label="Performances">
- Select a [sandbox](/serverless-functions/concepts/#sandbox) version:
- Sandbox v2 for shorter cold starts (recommended).
- Sandbox v1 if you require full compatibility with the Linux system call interface (legacy).
</TabsTab>
</Tabs>

### Function cost and validation

Expand Down