Closed pschichtel closed 2 weeks ago
I just checked the certificates as delivered by the API server of the first node:
DNS:kubernetes, DNS:kubernetes.default, DNS:kubernetes.default.svc, DNS:kubernetes.default.svc.cluster, DNS:kubernetes.svc.cluster.local, DNS:localhost, IP Address:127.0.0.1, IP Address:<controller1 ip>, IP Address:10.96.0.1
The other nodes look identical, except that they have their own IP in there.
In a good cluster it looks like this:
DNS:kubernetes, DNS:kubernetes.default, DNS:kubernetes.default.svc, DNS:kubernetes.default.svc.cluster, DNS:kubernetes.svc.cluster.local, DNS:localhost, DNS:controller1.example.org, DNS:controller2.example.org, DNS:controller3.example.org, IP Address:127.0.0.1, IP Address:<controller1 ip>, IP Address:<controller2 ip>, IP Address:<controller3 ip>, IP Address:10.96.0.1
Ok the missing IP addresses were caused by not having NLLB enabled. After enabling that the certificate contains the IPs of all controllers, but still no fqdns.
Adding the FQDNs manually to spec.api.sans
is not an acceptable workaround for you?
Not sure what would make sense here from k0s/k0sctl's point of view. There's some rewriting involved, though.
My problem with that is, that I also need to make sure to include all other names/ips that k8s/k0s/etcd seem to expect (see https://github.com/k0sproject/k0s/issues/4493#issuecomment-2444919451). if there was something like "extraSans" that adds entries in addition to the automatically detected value, I would be more fine with that.
But completely ignoring the workaround, the burning question for me is: Why are the fqdns included in 5/6 clusters? I'd expect 0/6 oder 6/6. The machines are built from the same VM template, they all run in the same flat network with the same DNS servers. They are all installed using k0sctl.
if there was something like "extraSans" that adds entries in addition to the automatically detected value, I would be more fine with that.
That is how the sans
field behaves in k0s internally: https://github.com/k0sproject/k0s/blob/main/pkg/apis/k0s/v1beta1/api.go#L110
So basically k0s adds all the detected addresses, cluster internal names and the given sans
from config
Why are the fqdns included in 5/6 clusters? I'd expect 0/6 oder 6/6.
k0s itself does NOT even detect FQDNs unless told to do so. So I'd assume there's some config differences between clusters, the one that does not use FQDN and the ones that do.
k0s itself does NOT even detect FQDNs unless told to do so.
then I wonder: Where do the fqdns in the certificate come from? I've never configured them anywhere.
then I wonder: Where do the fqdns in the certificate come from? I've never configured them anywhere.
That's a good question...
@kke If one configures the SSH address as node1.example.com
on k0sctl yaml, is that copied over to the k0s.yaml on the nodes?
@pschichtel maybe check the k0sctl "managed" /etc/k0s/k0s.yaml
on the nodes if you see the hostnames there?
yep, they're in there, ips and fqdns. So I guess k0sctl seems to be gathering the entries for sans.
Since I recently updated from k0sctl 0.18.1 to 0.19.x I just checked its history, this commit seems very applicable: https://github.com/k0sproject/k0sctl/commit/fd0ba50f48005339846446ffc2452db015e90272
Before creating an issue, make sure you've checked the following:
Platform
Version
v1.31.1+k0s.1
Sysinfo
`k0s sysinfo`
What happened?
I deployed a 3 node (all nodes are controller+worker) cluster with k0sctl.
k0s kubeconfig
produces a config that uses the node's IP,k0sctl kubeconfig
produces a config that contains the fqdn of the host.I have 5 other clusters where the configs produced by both k0s and k0sctl work fine, but the new cluster does not seem to include the fqdn in the sans and as such the config is unusable as it fails with:
My k0sctl config as reference:
The k0sctl version is
0.19.2
.Steps to reproduce
Expected behavior
Access via fqdn should work.
Actual behavior
Screenshots and logs
No response
Additional context
Not sure if this is a k0sctl issue or a k0s issue, I went for k0s.