Portainer icon

Portainer

Interact with Portainer via API

Actions190

Stacks → Stack Create Kubernetes File

AI-generated

Overview

This node allows you to create a Kubernetes stack configuration file in a specified environment by interacting with the Portainer API. It is useful for automating the deployment of Kubernetes stacks through Portainer, enabling infrastructure as code practices and seamless integration into CI/CD pipelines.

Typical use cases include:

  • Deploying new Kubernetes stacks programmatically.
  • Managing stack configurations centrally via Portainer.
  • Automating environment setup in Kubernetes clusters.

Properties

Name Meaning
Endpoint Id Identifier of the target environment where the Kubernetes stack will be deployed.
Body The stack configuration content in string format, representing the Kubernetes stack file.

Output

The node outputs JSON data representing the response from the Portainer API after attempting to create the Kubernetes stack file. This typically includes details about the created stack or any error messages returned by the API.

No binary data output is involved.

Dependencies

  • Requires an API key credential to authenticate with the Portainer API.
  • Needs the base URL of the Portainer instance configured in the credentials.
  • Depends on the Portainer API being accessible and properly configured to accept stack creation requests.

Troubleshooting

  • Invalid Endpoint Id: If the environment identifier is incorrect or does not exist, the API call will fail. Verify the endpoint ID corresponds to a valid environment in Portainer.
  • Malformed Stack Config: Providing an invalid or improperly formatted stack configuration in the Body property may cause errors. Ensure the stack config follows Kubernetes YAML/JSON standards expected by Portainer.
  • Authentication Errors: Missing or invalid API credentials will prevent successful communication with Portainer. Confirm that the API key and URL are correctly set.
  • Network Issues: Connectivity problems between n8n and the Portainer server can cause timeouts or failures. Check network access and firewall settings.

Links and References

Discussion