kubernetes upgrade from 1.9.0 to 1.10 FATAL: could not decode configuration: unable to decode config from bytes

4/1/2018

I am trying to upgrade my 1.9.0 cluster to 1.10. kubeadm upgrade plan command giving below error message. How to resolve this error message

 kubeadm upgrade plan
[preflight] Running pre-flight checks.
[upgrade] Making sure the cluster is healthy:
[upgrade/config] Making sure the configuration is correct:
[upgrade/config] Reading configuration from the cluster...
[upgrade/config] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
[upgrade/config] FATAL: could not decode configuration: unable to decode config from bytes: v1alpha1.MasterConfiguration: KubeProxy: v1alpha1.KubeProxy: Config: v1alpha1.KubeProxyConfiguration: FeatureGates: ReadMapCB: expect { or n, but found ", error found in #10 byte of ...|reGates":"","healthz|..., bigger context ...|24h0m0s"},"enableProfiling":false,"featureGates":"","healthzBindAddress":"0.0.0.0:10256","hostnameOv|...

YAML config file output:

apiVersion: v1
data:
  MasterConfiguration: |
    api:
      advertiseAddress: 192.168.16.211
      bindPort: 6443
    authorizationModes:
    - Node
    - RBAC
    certificatesDir: /etc/kubernetes/pki
    cloudProvider: ""
    etcd:
      caFile: ""
      certFile: ""
      dataDir: /var/lib/etcd
      endpoints: null
      image: ""
      keyFile: ""
    imageRepository: gcr.io/google_containers
    kubeProxy:
      config:
        bindAddress: 0.0.0.0
        clientConnection:
          acceptContentTypes: ""
          burst: 10
          contentType: application/vnd.kubernetes.protobuf
          kubeconfig: /var/lib/kube-proxy/kubeconfig.conf
          qps: 5
        clusterCIDR: 10.244.0.0/16
        configSyncPeriod: 15m0s
        conntrack:
          max: null
          maxPerCore: 32768
          min: 131072
          tcpCloseWaitTimeout: 1h0m0s
          tcpEstablishedTimeout: 24h0m0s
        enableProfiling: false
        featureGates: ""
        healthzBindAddress: 0.0.0.0:10256
        hostnameOverride: ""
        iptables:
          masqueradeAll: false
          masqueradeBit: 14
          minSyncPeriod: 0s
          syncPeriod: 30s
        ipvs:
          minSyncPeriod: 0s
          scheduler: ""
          syncPeriod: 30s
        metricsBindAddress: 127.0.0.1:10249
        mode: ""
        oomScoreAdj: -999
        portRange: ""
        resourceContainer: /kube-proxy
        udpTimeoutMilliseconds: 250ms
    kubeletConfiguration: {}
    kubernetesVersion: v1.9.0
    networking:
      dnsDomain: cluster.local
      podSubnet: 10.244.0.0/16
      serviceSubnet: 10.96.0.0/12
    nodeName: k8sm-01
    token: ""
    tokenTTL: 24h0m0s
    unifiedControlPlaneImage: ""
kind: ConfigMap
metadata:
  creationTimestamp: 2017-10-06T20:44:05Z
  name: kubeadm-config
  namespace: kube-system
  resourceVersion: "2462269"
  selfLink: /api/v1/namespaces/kube-system/configmaps/kubeadm-config
  uid: 1818b79c-aad7-11e7-9ef5-525400ada096
-- sfgroups
kubeadm
kubernetes

1 Answer

4/2/2018

This is followed by kubernetes issue 61764, which mentions the Before upgrading section:

kube-proxy: feature gates are now specified as a map when provided via a JSON or YAML KubeProxyConfiguration, rather than as a string of key-value pairs.
For example:

KubeProxyConfiguration Before:

apiVersion: kubeproxy.config.k8s.io/v1alpha1
 kind: KubeProxyConfiguration
 **featureGates: "SupportIPVSProxyMode=true"**

KubeProxyConfiguration After:

apiVersion: kubeproxy.config.k8s.io/v1alpha1
 kind: KubeProxyConfiguration
 **featureGates:**
 **  SupportIPVSProxyMode: true**

And:

if featureGates: "", replace with with featureGates: {}

Actually, the OP sfgroups ads in the comments:

changed config like this: featureGates: {""}

-- VonC
Source: StackOverflow