https://rancher.com/ logo
Title
l

loud-diamond-82990

04/17/2023, 10:55 AM
Hi, is there any way to dynamically change configurations in /etc/rancher/rke2/config.yaml after installation? Say I have a running RKE2 environment, based on default configurations, node-monitor-grace-period is 40s and default-not-ready-toleration-seconds is 300s. If on a running RKE2 cluster, I want to reduce those values for all pods, what can I do? Currently the steps I figured out is, 1. change values in /etc/rancher/rke2/config.yaml 2. restart all master nodes to let k8s service load new values 3. cordon & drain all nodes to recreate all pods, so each pod can adopt new values as value for 'tolerations' But those steps definitely affects running services' availability, so wondering if there is any easier way to make those changes, thanks
b

busy-flag-55906

04/17/2023, 11:21 AM
hi, i have just found this doc https://ranchermanager.docs.rancher.com/pages-for-subheaders/k3s-hardening-guide#reference-hardened-k3s-template-configuration and trying to customize kube-api, i believe it could help u as well. After modifications, all pods will be restarted by rancher, no need to do this manually
l

loud-diamond-82990

04/17/2023, 12:18 PM
Thanks, I'm new here so have some questions about the wiki you gave. In wiki page, it seems there is a k8s resource "kind: Cluster". It supports rkeConfig in its yaml. Once I changed any configurations there, this kind of resource will automatically restart all pods to adopt the changes right? My question is, where does "kind: Cluster" comes from? is it a customized resource which will write the changes in yaml file and restart pods by itself? If that's the case, then what I really ask is, does RKE2 itself support dynamic config changes. That means, once I update configurations somewhere, pods can adopt the changes automatically without pods restart
Also after I changed the value in rkeConfig, how RKE2 services like kube-apiserver/kube-controller adopt the changes without restart? What's the mechanism behind? Does RKE2 has some restful API to support config change without restart? Thanks