The Private Networks feature can only be enabled on newly created namespaces. Existing namespaces that do not have the feature enabled cannot be integrated in a Private Network.
How to use Private Networks with your Serverless Containers
Private Networks allow your Serverless Containers to communicate in an isolated and secure network without needing to be connected to the public internet. Each container can be connected to one or several Private Networks, letting you build your own network topologies.
For full information about Scaleway Private Networks and VPC, see our dedicated documentation and best practices guide.
Before you startLink to this anchor
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- Created a Private Network
How to create a Private NetworkLink to this anchor
This action must be carried out from the VPC section of the console. Follow the procedure detailed in our dedicated VPC documentation.
How to create a Private Networks-enabled namespaceLink to this anchor
Before attaching a Private Network to a Serverless Container, you must create it within a namespace with the Private Networks feature enabled.
-
Click Containers in the Serverless section of the side menu. The containers page displays.
-
Click + Create namespace. If you have no existing Serverless Containers resources in your current Project, click Create a container. The containers namespace creation wizard displays.
-
Complete the following steps in the wizard:
- Enter a name or use the automatically generated one. The name can only contain lowercase alphanumeric characters and dashes.
- Enter an optional description and tags.
- Choose a region, which is the geographical location in which your namespace will be deployed.
- Tick the Enable VPC support box. This parameter cannot be edited once the namespace is created.
- Click + Add advanced options to define any environment variables you want to inject into your container. For each environment variable, click + Add variable and enter the key/value pair.
- Set optional secret environment variables. Secrets are environment variables which are injected into your container and stored securely, but not displayed in the console after initial validation. Add a key and a value.
-
Click Create namespace only to finish, or click Create namespace and add a container if you want to create a container next.
How to attach a Serverless Container to a Private NetworkLink to this anchor
- Click Containers in the Serverless section of the side menu. The containers page displays.
- Click the relevant containers namespace.
- Click the name of the container you want to manage.
- Open the Settings tab, then scroll to the Advanced options section.
- In the VPC tab, select a Private Network from the dropdown menu.
- Click Save container settings.
Your container is redeployed, and is now attached to the selected Private Network.
- Click Containers in the Serverless section of the side menu. The containers page displays.
- Click the Private Networks-enabled containers namespace in which you want to create your container.
- Click + Create container. The container creation wizard displays.
- Scroll to the Advanced options section.
- In the VPC tab, select a Private Network from the dropdown menu.
- Configure the other parameters of your container, then click Create container. Refer to the How to create a container for more information.
Your new container is deployed, and is attached to the selected Private Network.
How to detach a container from a Private NetworkLink to this anchor
- Click Containers in the Serverless section of the side menu. The containers page displays.
- Click the relevant containers namespace.
- Click the name of the container you want to manage.
- Open the Settings tab, then scroll to the Advanced options section.
- In the VPC tab, click the «Unlink Icon» icon next to the Private Network attached to your container.
- Click Save container settings.
Your container is redeployed and is now detached from the Private Network.
How to delete a Private NetworkLink to this anchor
Before deleting a Private Network, you must detach all resources attached to it.
This must be carried out from the VPC section of the console. Follow the procedure detailed in our dedicated VPC documentation.