apiserver_ips not applied to API server certificate SANs when using docker driver #217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses a bug when using the docker driver with apiserver_ips.
Even when apiserver_ips is configured in Terraform, the specified IPs are not added to the Kubernetes API server certificate SANs. As a result, clients connecting via the configured IP hit TLS validation errors (x509: certificate is valid for … not ).
Problem
Example Terraform config:
Running
minikube -p terraform-provider-minikube-docker ssh -- \ "sudo openssl x509 -noout -text -in /var/lib/minikube/certs/apiserver.crt | grep -A1 'Subject Alternative Name'"Actual result (missing 192.168.100.82)
the IPs do not appear in the Kubernetes API server certificate SAN
X509v3 Subject Alternative Name: DNS:kubernetes.local, DNS:minikubeCA, DNS:control-plane.minikube.internal, DNS:terraform-provider-minikube-docker, DNS:kubernetes.default.svc.cluster.local, DNS:kubernetes.default.svc, DNS:kubernetes.default, DNS:kubernetes, DNS:localhost, IP Address:10.96.0.1, IP Address:127.0.0.1, IP Address:10.0.0.1, IP Address:192.168.49.2Expected result (with 192.168.100.82 included)
X509v3 Subject Alternative Name: DNS:kubernetes.local, DNS:minikubeCA, DNS:control-plane.minikube.internal, DNS:terraform-provider-minikube-docker, DNS:kubernetes.default.svc.cluster.local, DNS:kubernetes.default.svc, DNS:kubernetes.default, DNS:kubernetes, DNS:localhost, IP Address:192.168.100.82, IP Address:10.96.0.1, IP Address:127.0.0.1, IP Address:10.0.0.1, IP Address:192.168.49.2Context
This issue occurs only via the Terraform provider.
Running minikube start --apiserver-ips=192.168.100.82 directly works as expected and adds the IP to SANs.
The provider currently doesn’t propagate apiserver_ips to the underlying minikube/kubeadm configuration, which causes the mismatch.