Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some options of default config.yml don't work as expectation #2335

Closed
MrMYHuang opened this issue Jan 9, 2022 · 2 comments
Closed

Some options of default config.yml don't work as expectation #2335

MrMYHuang opened this issue Jan 9, 2022 · 2 comments

Comments

@MrMYHuang
Copy link

MrMYHuang commented Jan 9, 2022

Environmental Info:
RKE2 Version:
rke2 version v1.22.5+rke2r1 (ce3e572)
go version go1.16.10b7

Node(s) CPU architecture, OS, and Version:
Linux myhsp7 5.10.74.3-microsoft-standard-WSL2+ #2 SMP Sat Jan 8 01:17:54 CST 2022 x86_64 x86_64 x86_64 GNU/Linux

Cluster Configuration:
1 server

Describe the bug:
Some options, node-ip, node-external-ip, in the default config.yml, /etc/rancher/rke2/config.yml, doesn't work as expectation if start rke2 by sudo systemctl start rke2-server. However, if start rke2 by sudo rke2 server --node-ip www.xxx.yyy.zzz --node-external-ip www.xxx.yyy.zzz, it works correctly. We can check IPs in etcd config, sudo cat /var/lib/rancher/rke2/server/db/etcd/config, to see the difference of two methods to start rke2.

Steps To Reproduce:
I created a vlan with a static IP 172.27.137.122 and followed the rke2 quick start with the default config.yml: https://docs.rke2.io/install/quickstart/

sudo ip link add link eth0 name eth0.1 type vlan id 1
sudo ip addr add 172.27.137.112/20 dev eth0.1
sudo ip link set dev eth0.1 up

curl -sfL https://get.rke2.io | sudo sh -

echo "cni: cilium
node-ip: 172.27.137.112
node-external-ip: 172.27.137.112" > config.yml
sudo mkdir -p /etc/rancher/rke2
sudo cp config.yml /etc/rancher/rke2

sudo systemctl start rke2-server.service

After etcd starts, run sudo cat /var/lib/rancher/rke2/server/db/etcd/config to check IPs and you will find they are not IP 172.27.137.112!

Expected behavior:

IPs in etcd config should be 172.27.137.112 of eth0.1, not the IP (e.g. 172.27.140.163) of eth0.

Actual behavior:

IPs in etcd config is the IP of eth0. node-ip, node-external-ip in the rke2 default config.yml don't work as expected. However, cni: cilium in it works (can be confirmed by kubectl get pod -A).

Additional context / logs:

Instead of using sudo systemctl start rke2-server, if run sudo rke2 server --node-ip 172.27.137.112 --node-external-ip 172.27.137.112 --cni cilium, IPs in etcd config are correctly set to 172.27.137.112 of eth0.1.

@brandond
Copy link
Member

brandond commented Jan 10, 2022

The file is /etc/rancher/rke2/config.yaml - note that the extension is .yaml, not .yml. This is documented at https://docs.rke2.io/install/install_options/install_options/#configuration-file

@MrMYHuang
Copy link
Author

The file is /etc/rancher/rke2/config.yaml - note that the extension is .yaml, not .yml. This is documented at https://docs.rke2.io/install/install_options/install_options/#configuration-file

Thank you. It works.

MrMYHuang added a commit to MrMYHuang/rke2 that referenced this issue Jan 10, 2022
Notice user that correct default config file extension is yaml, not yml. Otherwise, it doesn't work. See rancher#2335.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants