scott-the-programmer / terraform-provider-minikube

A terraform provider for minikube!
MIT License
51 stars 7 forks source link

[Feature] resource_cluster data source #119

Open scott-the-programmer opened 8 months ago

scott-the-programmer commented 8 months ago

To be close to feature complete, we should implement the ability to reference an existing minikube cluster as a data source

The goal is to allow users to reference previously created clusters (either created via the cli, or through a separate terraform stack) by specifying something like

data "minikube_cluster" "some_cluster" {
    cluster_name = "some_existing_cluster_name"
}

provider "kubernetes" {
  host = minikube_cluster.some_cluster.host

  client_certificate     = data.minikube_cluster.some_cluster.client_certificate
  client_key             = data.minikube_cluster.some_cluster.client_key
  cluster_ca_certificate = data.minikube_cluster.some_cluster.cluster_ca_certificate
}
caerulescens commented 8 months ago

Awesome feature, can't wait.

caerulescens commented 3 weeks ago

I could use this functionality; may I implement it?

scott-the-programmer commented 3 weeks ago

I could use this functionality; may I implement it?

Yup, that would be awesome! I haven't had much time lately, so any help would be appreciated.

I suspect that the implementation would be fairly easy, i.e. pulling the existing config via a cluster name - but i'm not entirely sure if there's a convenient call in minikube to grab this

caerulescens commented 2 weeks ago

Great, and that's what I was expecting too; nothing too difficult.