Comments (5)
I don't think k0s passes any --node-ip flags to kubelet at all. According to the CLI flag's description, it defaults to IPv4. That's what you're seeing in your cluster, I suppose.
--node-ip string IP address (or comma-separated dual-stack IP addresses) of the node. If unset, kubelet will use the node's default IPv4 address, if any, or its default IPv6 address if it has no IPv4 addresses. You can pass '::' to make it prefer the default IPv6 address rather than the default IPv4 address.
You could pass your own values via --kubelet-extra-args=--node-ip=...
in spec.hosts[*].installFlags
for the time being.
/cc @ncopa WDYT about this?
from k0sctl.
I don't think k0s passes any --node-ip flags to kubelet at all.
@twz123 You are right. I specified privateAddress:
. If I remove that, no "--node-ip" is passed to kubelet.
vm-002 ~ # ps www | grep kubelet
464 root 1267m S /var/lib/k0s/bin/kubelet --root-dir=/var/lib/k0s/kubelet --config=/var/lib/k0s/kubelet-config.yaml --kubeconfig=/var/lib/k0s/kubelet.conf --v=1 --cert-dir=/var/lib/k0s/kubelet/pki --containerd=/run/k0s/containerd.sock --runtime-cgroups=/system.slice/containerd.service
But for dual-stack it seems that you must specify "comma-separated dual-stack IP addresses" to get it right:
vm-002 ~ # k0s kubectl get node $(hostname) -o json | jq .status.addresses
[
{
"address": "192.168.1.2",
"type": "InternalIP"
},
{
"address": "vm-002",
"type": "Hostname"
}
]
(ipv6 is missing)
from k0sctl.
If it's connected to privateAddress
, then it's probably something in k0sctl, not in k0s itself ... Indeed, it is: https://github.com/k0sproject/k0sctl/blob/v0.18.1/pkg/apis/k0sctl.k0sproject.io/v1beta1/cluster/host.go#L320-L327
Not sure what to do here, since the IPv6 is not part of the k0sctl config at all. /cc @kke How would k0s or k0sctl know which IP to use if it isn't specified? Sure, there could be some magic auto-detection, but less magic is usually preferable. Would it make sense to make privateAddress
a list and accept multiple IPs, or is that a bad idea? 🤔
from k0sctl.
You could pass your own values via --kubelet-extra-args=--node-ip=... in spec.hosts[*].installFlags for the time being.
Yes, that works 😃
vm-002 ~ # k0s kubectl get node $(hostname) -o json | jq .status.addresses
[
{
"address": "192.168.1.2",
"type": "InternalIP"
},
{
"address": "fd00::c0a8:102",
"type": "InternalIP"
},
{
"address": "vm-002",
"type": "Hostname"
}
]
I removed privateAddress:
and instead specified:
installFlags:
- "--kubelet-extra-args=--node-ip=192.168.1.2,fd00::192.168.1.2"
If privateAddress:
is only used for passing an address to kubelet via --node-ip, it should take comma-separated dual-stack IP addresses, same as kubelet.
For a better user experience, k0sctl
may specify the first IPv4 and the first global IPv6 for "privateInterface:" as --node-ip if dual-stack is enabled.
This problem should be documented in any case.
I am happy with this work-around, and you may close this issue if you like, or keep it for reference.
from k0sctl.
see also k0sproject/k0s#3954
from k0sctl.
Related Issues (20)
- Same version of k0s binary re-downloaded when it already exists HOT 7
- Apply failed on Alpine Linux HOT 2
- failed to download k0s HOT 4
- Add a smoke-test for non-root login user
- Upgrade to 1.29.4 fails with k0s doesn't appear to be running but has been installed as a service at /etc/systemd/system/k0scontroller.service HOT 4
- Regression in k0s ostests (0.17.5 -> 0.17.7) HOT 2
- k0sctl apply: selects wrong IP address for ClusterConfig HOT 1
- ssh host key mismatch HOT 1
- Use "k0s kubeconfig" to get kubeconfig HOT 12
- Question: Is it possible to add additional control plane nodes after initializing the k0s cluster? HOT 3
- Detect conditions when workers need to be restarted or re-joined
- drain option configuable
- kubeconfig files generated by k0sctl 0.18.0 use private IP of cluster nodes and ignore cluster name HOT 3
- extraArgs multiple values HOT 1
- Rename k0sctl-linux-x64 to k0sctl-linux-amd64 HOT 1
- Cannot run locally built k0s binary without specifying the exact version
- k0sctl apply fails following the docs' steps HOT 2
- Problem with Control Plane HA HOT 1
- ansi color panic on Windows when using busybox sh HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from k0sctl.