Kind: HA cluster with kind on Windows errors on copying certificate.

Created on 4 May 2020  路  3Comments  路  Source: kubernetes-sigs/kind

What happened:
When i try to create a cluster with three control-plane nodes I get an error on copying the ca certificate to the 2nd control plane node.

ERROR: failed to create cluster: failed to copy admin kubeconfig: failed to write "/etc/kubernetes/pki/ca.crt" to node: command "docker exec --privileged -i cluster1-control-plane2 cp /dev/stdin /etc/kubernetes/pki/ca.crt" failed with error: exit status 1

Command Output: cp: cannot create regular file '/etc/kubernetes/pki/ca.crt': No such file or directory

Stack Trace:
sigs.k8s.io/kind/pkg/errors.WithStack
/src/pkg/errors/errors.go:51
sigs.k8s.io/kind/pkg/exec.(LocalCmd).Run
/src/pkg/exec/local.go:124
sigs.k8s.io/kind/pkg/cluster/internal/providers/docker.(
nodeCmd).Run
/src/pkg/cluster/internal/providers/docker/node.go:146
sigs.k8s.io/kind/pkg/cluster/nodeutils.CopyNodeToNode
/src/pkg/cluster/nodeutils/util.go:70
sigs.k8s.io/kind/pkg/cluster/internal/create/actions/kubeadminit.(action).Execute
/src/pkg/cluster/internal/create/actions/kubeadminit/init.go:95
sigs.k8s.io/kind/pkg/cluster/internal/create.Cluster
/src/pkg/cluster/internal/create/create.go:135
sigs.k8s.io/kind/pkg/cluster.(
Provider).Create
/src/pkg/cluster/provider.go:138
sigs.k8s.io/kind/pkg/cmd/kind/create/cluster.runE
/src/pkg/cmd/kind/create/cluster/createcluster.go:91
sigs.k8s.io/kind/pkg/cmd/kind/create/cluster.NewCommand.func1
/src/pkg/cmd/kind/create/cluster/createcluster.go:56
github.com/spf13/cobra.(Command).execute
/go/pkg/mod/github.com/spf13/[email protected]/command.go:842
github.com/spf13/cobra.(
Command).ExecuteC
/go/pkg/mod/github.com/spf13/[email protected]/command.go:950
github.com/spf13/cobra.(*Command).Execute
/go/pkg/mod/github.com/spf13/[email protected]/command.go:887
sigs.k8s.io/kind/cmd/kind/app.Run
/src/cmd/kind/app/main.go:53
sigs.k8s.io/kind/cmd/kind/app.Main
/src/cmd/kind/app/main.go:35
main.main
/src/main.go:25
runtime.main
/usr/local/go/src/runtime/proc.go:203
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1373

What you expected to happen:
A multi-master deployed kind cluster

How to reproduce it (as minimally and precisely as possible):
<< config >>
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:

  • role: control-plane
  • role: control-plane
  • role: control-plane
  • role: worker
  • role: worker
  • role: worker
    << /config >>

command: kind create cluster --config config.yaml

Anything else we need to know?:
-Docker is running in Linux mode
-Single master cluster and multiple workers goes fine

Environment:
Windows 10 Pro

  • kind version: 0.8.1:
  • Kubernetes version: 1.18.2:
  • Docker version: 19.03.8:
  • OS: Windows 10 Professional
kinbug

Most helpful comment

/assign

All 3 comments

/assign

This doesn't make much sense, we mkdir -p the directory before ...

... except that we use filepath package, which uses the hosts's path formats... :man_facepalming:

We've been pretty good about this, but it's easy to slip up, usually it would be more correct to use filepath for file paths (shocker!) than path but ... not in this case. we need #1529

fix in https://github.com/kubernetes-sigs/kind/pull/1630

We are (at least) lucky enough to be learning everyday ;)
Thanks for identifying the issue.

Was this page helpful?
0 / 5 - 0 ratings