Open Digital-Shane opened 3 years ago
This is not currently supported via Terraform. You can find the docs for the API endpoint here:
https://developers.digitalocean.com/documentation/v2/#install-kubernetes-1-click-applications
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"addon_slugs": ["nginx-ingress-controller", "monitoring-stack"], "cluster_uuid": "$CLUSTER_UUID"}' \
"https://api.digitalocean.com/v2/1-clicks/kubernetes"
One thing to note is that while 1-Click apps can be added to a cluster via the API, it is not currently possible to remove them or list the ones that have been installed already via the API. So the feature does not fit very well with Terraform's state management as it is currently implemented.
Thanks for getting back to me so quickly, Andrew!
That API should work well for my use case. Primarily, I want to make sure those installs are automated without me entering the UI. That will make it immensely easier to restore a full cluster during disaster recovery. The only case I'd want to remove nginx and Prometheus would be during a full cluster teardown, so ongoing tracking is less of a concern
I do think a complete implementation through a terraform resource or input to the cluster would be useful for others though. You might want to consider the feature when your backlog allows.
Thanks again!
Hi there,
Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.
Terraform Version
Terraform v0.14.5
Affected Resource(s)
Terraform Configuration Files
Example:
Expected Behavior
The resource should install the provided list of one-click apps. The list of apps would be restricted to those under the Kubernetes category.
The nginx app documentation seems to imply this is possible in the UI, but I'm not sure because the text and command in that section seem to only create the Kubernetes cluster. If I can find the correct endpoint to create an app on the Kubernetes cluster a null provisioner can be a workaround, but managing everything through the provider is preferred.
Actual Behavior
What actually happened?
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids
Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example: