error unmarshaling configuration schema.GroupVersionKind{Group:"kubeadm.k8s.io", Version:"v1alpha3", Kind:"InitConfiguration"}
jk2K opened this issue ยท comments
Meng Ye commented
start cluster, got below errors
minikube start --vm-driver=hyperkit --registry-mirror=https://registry.docker-cn.com
๐ minikube v0.35.0 on darwin (amd64)
๐ก Tip: Use 'minikube start -p <name>' to create a new cluster, or 'minikube delete' to delete this one.
๐ Re-using the currently running hyperkit VM for "minikube" ...
โ Waiting for SSH access ...
๐ถ "minikube" IP address is 192.168.64.2
๐ณ Configuring Docker as the container runtime ...
โจ Preparing Kubernetes environment ...
๐ Pulling images required by Kubernetes v1.13.4 ...
โ Unable to pull images, which may be OK: running cmd: sudo kubeadm config images pull --config /var/lib/kubeadm.yaml: command failed: sudo kubeadm config images pull --config /var/lib/kubeadm.yaml
stdout:
stderr: W0313 11:35:37.149909 9133 strict.go:54] error unmarshaling configuration schema.GroupVersionKind{Group:"kubeadm.k8s.io", Version:"v1alpha3", Kind:"InitConfiguration"}: error unmarshaling JSON: while decoding JSON: json: unknown field "imageRepository"
failed to pull image "registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.13.4": output: Error response from daemon: Get https://registry.cn-hangzhou.aliyuncs.com/v2/: dial tcp: lookup registry.cn-hangzhou.aliyuncs.com on 192.168.64.1:53: read udp 192.168.64.2:36381->192.168.64.1:53: read: connection refused
, error: exit status 1
: Process exited with status 1
๐ Relaunching Kubernetes v1.13.4 using kubeadm ...
โ Waiting for pods: apiserver^C
Meng Ye commented
imageRepository is in wrong place, InitConfiguration
should not have imageRepository
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package kubeadm
import (
"fmt"
"sort"
"text/template"
)
var kubeadmConfigTemplateV1Alpha1 = template.Must(template.New("kubeadmConfigTemplate-v1alpha1").Funcs(template.FuncMap{
"printMapInOrder": printMapInOrder,
}).Parse(`apiVersion: kubeadm.k8s.io/v1alpha1
kind: MasterConfiguration
{{if .NoTaintMaster}}noTaintMaster: true{{end}}
api:
advertiseAddress: {{.AdvertiseAddress}}
bindPort: {{.APIServerPort}}
controlPlaneEndpoint: localhost
kubernetesVersion: {{.KubernetesVersion}}
imageRepository: "registry.cn-hangzhou.aliyuncs.com/google_containers"
certificatesDir: {{.CertDir}}
networking:
serviceSubnet: {{.ServiceCIDR}}
etcd:
dataDir: {{.EtcdDataDir}}
nodeName: {{.NodeName}}
{{if .CRISocket}}criSocket: {{.CRISocket}}
{{end}}{{range .ExtraArgs}}{{.Component}}:{{range $i, $val := printMapInOrder .Options ": " }}
{{$val}}{{end}}
{{end}}{{if .FeatureArgs}}featureGates: {{range $i, $val := .FeatureArgs}}
{{$i}}: {{$val}}{{end}}
{{end}}`))
var kubeadmConfigTemplateV1Alpha3 = template.Must(template.New("kubeadmConfigTemplate-v1alpha3").Funcs(template.FuncMap{
"printMapInOrder": printMapInOrder,
}).Parse(`
apiVersion: kubeadm.k8s.io/v1alpha3
kind: InitConfiguration
apiEndpoint:
advertiseAddress: {{.AdvertiseAddress}}
bindPort: {{.APIServerPort}}
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
ttl: 24h0m0s
usages:
- signing
- authentication
nodeRegistration:
criSocket: {{if .CRISocket}}{{.CRISocket}}{{else}}/var/run/dockershim.sock{{end}}
name: {{.NodeName}}
taints: []
---
apiVersion: kubeadm.k8s.io/v1alpha3
kind: ClusterConfiguration
{{range .ExtraArgs}}{{.Component}}:{{range $i, $val := printMapInOrder .Options ": " }}
{{$val}}{{end}}
{{end}}{{if .FeatureArgs}}featureGates: {{range $i, $val := .FeatureArgs}}
{{$i}}: {{$val}}{{end}}
{{end}}
certificatesDir: {{.CertDir}}
clusterName: kubernetes
controlPlaneEndpoint: localhost:{{.APIServerPort}}
etcd:
local:
dataDir: {{.EtcdDataDir}}
kubernetesVersion: {{.KubernetesVersion}}
imageRepository: "registry.cn-hangzhou.aliyuncs.com/google_containers"
networking:
dnsDomain: cluster.local
podSubnet: ""
serviceSubnet: {{.ServiceCIDR}}
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
# disable disk resource management by default, as it doesn't work well within the minikube environment.
imageGCHighThresholdPercent: 100
# Don't evict jobs, as we only have a single node to run on.
evictionHard:
nodefs.available: "0%"
nodefs.inodesFree: "0%"
imagefs.available: "0%"
`))
var kubeletSystemdTemplate = template.Must(template.New("kubeletSystemdTemplate").Parse(`
[Unit]
{{if or (eq .ContainerRuntime "cri-o") (eq .ContainerRuntime "cri")}}Wants=crio.service{{else}}Wants=docker.socket{{end}}
[Service]
ExecStart=
ExecStart=/usr/bin/kubelet {{.ExtraOptions}} {{if .FeatureGates}}--feature-gates={{.FeatureGates}}{{end}}
[Install]
`))
const kubeletService = `
[Unit]
Description=kubelet: The Kubernetes Node Agent
Documentation=http://kubernetes.io/docs/
[Service]
ExecStart=/usr/bin/kubelet
Restart=always
StartLimitInterval=0
RestartSec=10
[Install]
WantedBy=multi-user.target
`
var kubeadmInitTemplate = template.Must(template.New("kubeadmInitTemplate").Parse(loadImageScripts() + `
sudo /usr/bin/kubeadm init --config {{.KubeadmConfigFile}} {{if .SkipPreflightChecks}}--skip-preflight-checks{{else}}{{range .Preflights}}--ignore-preflight-errors={{.}} {{end}}{{end}}
`))
// printMapInOrder sorts the keys and prints the map in order, combining key
// value pairs with the separator character
//
// Note: this is not necessary, but makes testing easy
func printMapInOrder(m map[string]string, sep string) []string {
if m == nil {
return nil
}
keys := []string{}
for k := range m {
keys = append(keys, k)
}
sort.Strings(keys)
for i, k := range keys {
keys[i] = fmt.Sprintf("%s%s\"%s\"", k, sep, m[k])
}
return keys
}
Li Yi commented
ๆ่ฟ่พนๆฏๅฏไปฅ็
$ minikube start --registry-mirror=https://registry.docker-cn.com
๐ minikube v0.35.0 on darwin (amd64)
๐ฅ Creating virtualbox VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
๐ฟ Downloading Minikube ISO ...
184.42 MB / 184.42 MB [============================================] 100.00% 0s
๐ถ "minikube" IP address is 192.168.99.100
๐ณ Configuring Docker as the container runtime ...
โจ Preparing Kubernetes environment ...
๐พ Downloading kubeadm v1.13.4
๐พ Downloading kubelet v1.13.4
๐ Pulling images required by Kubernetes v1.13.4 ...
๐ Launching Kubernetes v1.13.4 using kubeadm ...
โ Waiting for pods: apiserver proxy etcd scheduler controller addon-manager dns
๐ Configuring cluster permissions ...
๐ค Verifying component health .....
๐ kubectl is now configured to use "minikube"
๐ Done! Thank you for using minikube!
$ minikube dashboard
๐ Enabling dashboard ...
๐ค Verifying dashboard health ...
๐ Launching proxy ...
๐ค Verifying proxy health
Li Yi commented
่ฏท้ๆฐ้ช่ฏ๏ผๅค่ฐข