Portainer icon

Portainer

Interact with Portainer via API

Actions190

Stacks → Stack Create Kubernetes Git

AI-generated

Overview

This node operation allows you to create a Kubernetes stack in Portainer by providing a Git repository configuration. It is useful for automating the deployment of containerized applications managed via Kubernetes, directly from Git repositories. Typical use cases include continuous deployment pipelines where infrastructure as code is stored in Git and needs to be deployed or updated automatically.

For example, you can specify a Git repository containing Kubernetes manifests or Helm charts, and this node will instruct Portainer to create a new stack based on that configuration.

Properties

Name Meaning
Endpoint Id Identifier of the environment (Kubernetes endpoint) where the stack will be deployed.
Body The stack configuration in JSON or YAML format describing the Kubernetes resources to deploy.

Output

The node outputs JSON data representing the response from the Portainer API after attempting to create the Kubernetes stack. This typically includes details about the created stack such as its ID, status, and any metadata returned by the API.

No binary data output is expected from this operation.

Dependencies

  • Requires an active connection to a Portainer instance with API access.
  • Needs an API authentication token configured in n8n credentials to authorize requests.
  • The Portainer environment must have a Kubernetes endpoint registered and accessible.
  • The node uses the Portainer REST API to perform operations.

Troubleshooting

  • Invalid Endpoint Id: If the specified environment ID does not exist or is inaccessible, the API call will fail. Verify the environment ID corresponds to a valid Kubernetes endpoint in Portainer.
  • Malformed Stack Config: The body property must contain a valid stack configuration. Invalid JSON/YAML or missing required fields will cause errors. Validate your stack config before sending.
  • Authentication Errors: Ensure the API key credential is correctly set up and has sufficient permissions to create stacks.
  • Network Issues: Connectivity problems between n8n and the Portainer server will prevent successful API calls.
  • API Version Mismatch: Using incompatible Portainer API versions may cause unexpected errors. Confirm compatibility with your Portainer instance.

Links and References

Discussion