unknown field "configMap" in io.k8s.api.core.v1.NodeConfigSource

2/12/2019

I am trying to add kublet parameter for garbage-collection to be taken care automatically. I followed below steps and while editing the node getting error as "unknown field "configMap" in io.k8s.api.core.v1.NodeConfigSource"

step 1:

bash kubectl proxy --port=8001 &

Step 2: Pulled the current config file

  NODE_NAME="the-name-of-the-node-you-are-reconfiguring"; curl -sSL "http://localhost:8001/api/v1/nodes/${NODE_NAME}/proxy/configz" | jq '.kubeletconfig|.kind="KubeletConfiguration"|.apiVersion="kubelet.config.k8s.io/v1beta1"' > kubelet_configz_${NODE_NAME}

Step 3: I edited this values

"imageGCHighThresholdPercent": 70,
"imageGCLowThresholdPercent": 65,

Step 4: Pushed the configuration to control plane

kubectl -n kube-system create configmap my-node-config --from-file=kubelet=kubelet_configz_${NODE_NAME} --append-hash -o yaml

Step 5: Edit node

kubectl edit node ${NODE_NAME}

Added configsource in it

configSource:
configMap:
    name: CONFIG_MAP_NAME #my new created configmap name added
    namespace: kube-system
    kubeletConfigKey: kubelet

While saving the edit node geting error as "unknown field "configMap" in io.k8s.api.core.v1.NodeConfigSource"

My node info

nodeInfo:
  architecture: amd64
  bootID: 951c736d-9a2c-4a81-bf32-922c53970ab3
  containerRuntimeVersion: docker://17.3.2
  kernelVersion: 3.10.0-693.11.6.el7.x86_64
  kubeProxyVersion: v1.10.6
  kubeletVersion: v1.10.6
  machineID: 609bbd29e32a4898e604f49bff82a88c
  operatingSystem: linux
  osImage: CentOS Linux 7 (Core)
  systemUUID: EC20197C-6279-B13C-6A3A-000FDAC5C4E8

apiVersion: v1
items:
- apiVersion: v1
  kind: Node
  metadata:
    annotations:
      node.alpha.kubernetes.io/ttl: "0"
      volumes.kubernetes.io/controller-managed-attach-detach: "true"

Spec Info:

spec:
  externalID: i-0f84faccd78dff3b3
  podCIDR: 109.92.5.0/24
  providerID: aws:///ap-south-1a/i-0foh4faccdsdcns3b3

Ref link: https://kubernetes.io/docs/tasks/administer-cluster/reconfigure-kubelet/

-- Manoj K
garbage-collection
kops
kubelet
kubernetes

1 Answer

2/12/2019
configSource:
    configMap:
        name: CONFIG_MAP_NAME
        namespace: kube-system
        kubeletConfigKey: kubelet

try this once

-- Harsh Manvar
Source: StackOverflow