terraform-provider-minikube icon indicating copy to clipboard operation
terraform-provider-minikube copied to clipboard

[Feature] resource_cluster data source

Open scott-the-programmer opened this issue 1 year ago • 5 comments

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
}

scott-the-programmer avatar Dec 23 '23 03:12 scott-the-programmer

Awesome feature, can't wait.

caerulescens avatar Dec 31 '23 12:12 caerulescens

I could use this functionality; may I implement it?

caerulescens avatar Aug 07 '24 00:08 caerulescens

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

scott-the-programmer avatar Aug 07 '24 01:08 scott-the-programmer

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

caerulescens avatar Aug 07 '24 11:08 caerulescens

I'm actually going to need this functionality at work, so I'll address this.

caerulescens avatar Feb 19 '25 17:02 caerulescens