From 16e81aaab7a4f3a4d5205053176f8f7fa0614bda Mon Sep 17 00:00:00 2001 From: scott-the-programmer Date: Wed, 30 Jul 2025 00:39:29 +1200 Subject: [PATCH] set api server port on both kube config and node config --- minikube/resource_cluster.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/minikube/resource_cluster.go b/minikube/resource_cluster.go index 8f9396c..e5efe6e 100644 --- a/minikube/resource_cluster.go +++ b/minikube/resource_cluster.go @@ -293,6 +293,8 @@ func initialiseMinikubeClient(d *schema.ResourceData, m interface{}) (lib.Cluste apiserverNames = state_utils.ReadSliceState(d.Get("apiserver_names")) } + apiserverPort := d.Get("apiserver_port").(int) + networkPlugin := d.Get("network_plugin").(string) // This is a deprecated parameter in Minikube, however, // it is still used internally, so we need to set it to a default value if it is not set. We should expect // this to be a blank string usually, which should default to cni @@ -334,7 +336,7 @@ func initialiseMinikubeClient(d *schema.ResourceData, m interface{}) (lib.Cluste n := config.Node{ Name: "", - Port: 8443, + Port: apiserverPort, KubernetesVersion: k8sVersion, ContainerRuntime: containerRuntime, ControlPlane: true, @@ -378,7 +380,7 @@ func initialiseMinikubeClient(d *schema.ResourceData, m interface{}) (lib.Cluste cc := config.ClusterConfig{ Addons: addonConfig, - APIServerPort: d.Get("apiserver_port").(int), + APIServerPort: apiserverPort, Name: d.Get("cluster_name").(string), KeepContext: d.Get("keep_context").(bool), EmbedCerts: d.Get("embed_certs").(bool),