Kubernetes config version error - your configuration file uses an old API spec: "kubeadm.k8s.io/v1alpha1"

5/5/2019

I'm following this tutorial to create a Raspberry Pi Kubernetes cluster. This is what my config looks like:

apiVersion: kubeadm.k8s.io/v1alpha1
kind: MasterConfiguration
controllerManagerExtraArgs:
  pod-eviction-timeout: 10s
  node-monitor-grace-period: 10s

The problem is, when I run sudo kubeadm init --config kubeadm_conf.yaml I get the following error:

your configuration file uses an old API spec: "kubeadm.k8s.io/v1alpha1". Please use kubeadm v1.11 instead and run 'kubeadm config migrate --old-config old.yaml --new-config new.yaml', which will write the new, similar spec using a newer API version.

I've tried looking here for help, but nothing's worked. Help is appreciated.

If I use v1beta1"

>W0505 13:10:25.319213   15824 strict.go:47] unknown configuration schema.GroupVersionKind{Group:"kubeadm.k8s.io", Version:"v1beta1", Kind:"MasterConfiguration"}                                                                                                                                    for scheme definitions in "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/scheme/scheme.go:31" and "k8s.io/kubernetes/cmd/kubeadm/app/componentconfigs/scheme.go:28"
[config] WARNING: Ignored YAML document with GroupVersionKind kubeadm.k8s.io/v1beta1, Kind=MasterConfiguration
no InitConfiguration or ClusterConfiguration kind was found in the YAML file
-- Widdles
kubernetes

2 Answers

5/6/2019

what is the kubernetes version are you using?

try below

apiVersion: kubeadm.k8s.io/v1alpha2

OR

apiVersion: kubeadm.k8s.io/v1alpha3

-- P Ekambaram
Source: StackOverflow

6/18/2019
  1. Verify versions:
    kubeadm version
    kubeadm config view
  1. Generate default settings for your init command to see your settings (should be modified):
    kubeadm init --config defaults
  1. Did you try the solution provided by the output?
     kubeadm config migrate --old-config old.yaml --new-config new.yaml

You can find tutorial about kubeadm init --config

In addition if you are using older version please take a look for documentation

It is recommended that you migrate your old v1alpha3 configuration to v1beta1 using the kubeadm config migrate command, because v1alpha3 will be removed in Kubernetes 1.15. For more details on each field in the v1beta1 configuration you can navigate to our API reference pages

Migration from old kubeadm config versions:

kubeadm v1.11 should be used to migrate v1alpha1 to v1alpha2; kubeadm v1.12 should be used to translate v1alpha2 to v1alpha3)

Fo the second issue no InitConfiguration or ClusterConfiguration kind was found in the YAML file there is also answer in docs:

When executing kubeadm init with the --config option, the following configuration types could be used: InitConfiguration, ClusterConfiguration, KubeProxyConfiguration, KubeletConfiguration, but only one between InitConfiguration and ClusterConfiguration is mandatory.

-- Hanx
Source: StackOverflow