InfluxDB stacks are stateful InfluxDB templates that let you add, update, and remove templated resources over time, avoid duplicating resources when applying the same or similar templates more than once, and apply changes to distributed instances of InfluxDB OSS or InfluxDB Cloud.
Ideal use cases for InfluxDB stacks
Stacks help save time and effort in the following use cases:
- Actively develop and extend templates
- Apply updates from source-controlled templates
- Apply template updates across multiple InfluxDB instances
Actively develop and extend templates
InfluxDB stacks aid in developing and maintaining InfluxDB templates. Stacks let you modify and update template manifests and apply those changes in any stack that uses the template.
Apply updates from source-controlled templates
You can use a variety of InfluxDB templates from many different sources including Community Templates or self-built custom templates. As templates are updated over time, stacks allow template users to gracefully apply updates without creating duplicate resources.
Apply template updates across multiple InfluxDB instances
In many cases, users have more than one instance of InfluxDB running and apply the same template to each separate instance. By using stacks, you can make changes to a stack on one instance, export the stack as a template and then apply the changes to your other InfluxDB instances.
Manage InfluxDB Stacks
Initialize a stack
InfluxDB automatically creates a new stack each time you apply an InfluxDB template without providing a stack ID. To manually create or initialize a new stack, use the
influx stacks init command.
influx apply \ -o example-org \ -f path/to/template.yml
influx stacks init \ -o example-org \ -n "Example Stack" \ -d "InfluxDB stack for monitoring some awesome stuff" \ -u https://example.com/template-1.yml \ -u https://example.com/template-2.yml
Update a stack
influx apply command to update a stack with a modified template. When applying a template to an existing stack, InfluxDB checks to see if the resources in the template match existing resources. InfluxDB updates, adds, and removes resources to resolve differences between the current state of the stack and the newly applied template.
influx apply \ -o example-org \ -u http://example.com/template-1.yml \ -u http://example.com/template-2.yml \ --stack-id=12ab34cd56ef
influx stacks command to view installed InfluxDB stacks and their associated resources.
influx stacks -o example-org
Remove a stack
influx stacks remove command to remove an InfluxDB stack and all its associated resources.
influx stacks remove \ -o example-org \ --stack-id=12ab34cd56ef
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, use the following resources:
InfluxDB Cloud and InfluxDB Enterprise customers can contact InfluxData Support.