Replies: 3 comments 4 replies
|
Hi @ben-freke Thanks a lot for using the Portainer Terraform provider and for taking the time to raise this issue!🙌🏽 You’re absolutely right — implementing both the ability to specify the swarm_node, setting the X-PortainerAgent-Target header for config-only networks is now not implement. We’re confirming acceptance of this feature request, and we will proceed with the implementation. Thanks again — feel free to reach out with any other ideas or needs regarding the provider!👍🏽 |
|
Hi @ben-freke 👋 Thanks again for raising this! We’re happy to let you know that starting from v1.7.0, the portainer_docker_network resource has been enhanced to support specifying the target Swarm node for macvlan networks created.
Thanks again for using the Portainer Terraform provider! 🙌 |
|
Hey @grulicht 👋🏼 Apologies for the delay in testing this out, I've been on an extended holiday. I've got: Which I think, looking at the docs, is correct. But I recieve I have a feeling this might be caused by the defaults, as the plan generates: When I try and specify Running version |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe
I am trying to create
macvlannetworks on several Docker Swarm nodes. Whilst I know this is straying from a best-practice architecture, Swarm and Portainer do support this.When creating a configuration-only network on Docker Swrm, the Portainer UI allows the user to specify which node they wish to configure the network on.

From a bit of digging, it looks like this is passed in the
X-PortainerAgent-Targetrequest in order to arrive on the correct node.However, the
portainer_docker_networkresource does not support supplying the Node ID with the request, meaning it's always created on the node the Server is running on.Describe the solution you'd like
An attribute on the resource that allows the user to specify the Node ID that the network is going to be created on for configuration-only networks. Terraform would then pass this in the request header as above. This option would be available on either config_only configurations for
macvlandrivers or networks created withipvlandrivers. For example:It looks like whilst the UI Screenshot I posted above supports selecting multiple for one config, it's making multiple calls under the hood.
Describe alternatives you've considered
I am currently creating the configuration-only networks manually in the console, and then using the
portainer_docker_networkin Terraform to useconfig_fromand consuming the manually-created resources. This is not ideal, especially as there is currently no import functionality for docker_network meaning that the entire network will need to be destroyed and re-created.Additional context
Just to add some additional context, the typical approach here for macvlan in swarm is to:
All reactions