Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] add datasource for civo_kubernetes_clusters #183

Open
codekoala opened this issue Jul 18, 2023 · 4 comments
Open

[FEATURE] add datasource for civo_kubernetes_clusters #183

codekoala opened this issue Jul 18, 2023 · 4 comments

Comments

@codekoala
Copy link

Description

I would like to be able to access information about Kubernetes clusters in a given region to help with dynamic configuration. Right now we have civo_kubernetes_cluster, but it requires foreknowledge of a specific cluster's name.

Screenshots

No response

Additional information

No response

@alejandrojnm
Copy link
Member

Do you have an example of your idea ??, maybe that can help the team to take a decision

@codekoala
Copy link
Author

Sure! I was thinking something like this (untested, probably some invalid HCL, but hopefully the point gets across):

locals {
  cluster_endpoints = {
    for cluster in data.civo_kubernetes_clusters.nyc1.results :
    cluster.name => cluster.api_endpoint
  }
}

data "civo_kubernetes_clusters" "nyc1" {
  region = "NYC1"
}

I want to use this to dynamically update our monitoring stack to include all clusters we may have.

@alejandrojnm
Copy link
Member

So, your idea is to have a data source to get all the clusters in a region, and then use that to populate your system. Is that ??

@codekoala
Copy link
Author

That is correct. The immediate use case I had in mind when I created this ticket is using the data source to iterate over all clusters in a region to update a configuration file for a monitoring platform. The main goal being to have periodic checks whether the respective API endpoints are accessible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants