Score:0

Kubernetes: no errors when editing node config, but changes not reflected

fo flag

I am following this tutorial on kubernetes site to reconfigure my nodes so that I can change gracefullshutdown from 0s to 30s.

after generating the configz file from kubectl proxy, I made the changes and pushed it to the control plane kube-system config location.

running: k get configmap -n kube-system yields the below:

NAME                                 DATA   AGE
coredns                              1      113d
extension-apiserver-authentication   6      113d
kube-flannel-cfg                     2      113d
kube-proxy                           2      113d
kube-root-ca.crt                     1      113d
kubeadm-config                       1      113d
kubelet-config-1.22                  1      113d
my-config-v1-ttk6dmhmmk              1      55m

taking a look at my-config-v1-ttkxxxxxx shows that it is indeed in the correct format with my gracefullshutdown changes:

# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
data:
  kubelet: |
    {
      "enableServer": true,
      "staticPodPath": "/etc/kubernetes/manifests",
      "syncFrequency": "1m0s",
       ...
      "enableSystemLogHandler": true,
      "shutdownGracePeriod": "30s",
      "shutdownGracePeriodCriticalPods": "10s",
      "enableProfilingHandler": true,
      "enableDebugFlagsHandler": true,
      "seccompDefault": false,
      "memoryThrottlingFactor": 0.8,
      "registerNode": true,
      "kind": "KubeletConfiguration",
      "apiVersion": "kubelet.config.k8s.io/v1beta1"
    }
kind: ConfigMap
metadata:
  creationTimestamp: "2022-03-26T09:52:34Z"
  name: my-config-v1-ttk6dmhmmk
  namespace: kube-system
  resourceVersion: "168825"
  uid: 09876a0a-fadd-4bc4-b80a-6a058304f304

This is where the problem comes about

I am trying to apply this config map to the node. I don't get any errors, but the changes are not applied either...

NODE_NAME=my-node-1
CONFIG_MAP_NAME=my-config-v1-ttk6dmhmmk
kubectl patch node ${NODE_NAME} -p "{\"spec\":{\"configSource\":{\"configMap\":{\"name\":\"${CONFIG_MAP_NAME}\",\"namespace\":\"kube-system\",\"kubeletConfigKey\":\"kubelet\"}}}}"

# result:
node/my-node-1 patched

finally, when I check back on it with kubectl get no ${NODE_NAME} -o json | jq '.status.config' the result is null....

any idea what is happening?

moonkotte avatar
in flag
Welcome to server fault community! Which kubernetes version is used? What kind of cluster is used? On-premise (kubeadm) or managed (like GKE or EKS)?
jake wong avatar
fo flag
hello. kubernetes version `1.23` `Platform:"linux/arm64"`, and yes, its set up using `kubeadm` locally on my tinkerboard (similar to raspberry pi4)
moonkotte avatar
in flag
Thank you for response, based on the documentation `FEATURE STATE: Kubernetes v1.22 [deprecated]` it looks like it's expected that it does not work. Can you try with `1.21` version to make sure?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.