rootsongjc/kubernetes-vagrant-centos-cluster

Missing kubectl after vagrant up

metaabc opened this issue · 7 comments

Environment

  • OS: Windows 10
  • Kubernetes version:
  • VirtualBox version: 6.0.12
  • Vagrant version: 2.2.5

What I did?

Your operations on this repo.

vagrant up

Messages

Logs or error messages.

   node3: cp: cannot stat ‘/vagrant/kubernetes/server/bin/*’: No such file or directory
    node3: configure node3
    node3: Created symlink from /etc/systemd/system/multi-user.target.wants/kubelet.service to /usr/lib/systemd/system/kubelet.service.
    node3: Created symlink from /etc/systemd/system/multi-user.target.wants/kube-proxy.service to /usr/lib/systemd/system/kube-proxy.service.
    node3: deploy coredns
    node3: /tmp/vagrant-shell: line 198: kubectl: command not found
    node3: /home/vagrant
    node3: deploy kubernetes dashboard
    node3: /tmp/vagrant-shell: line 202: kubectl: command not found
    node3: create admin role token
    node3: /tmp/vagrant-shell: line 204: kubectl: command not found
    node3: the admin role token is:
    node3: /tmp/vagrant-shell: line 206: kubectl: command not found
    node3: /tmp/vagrant-shell: line 206: kubectl: command not found
    node3: login to dashboard with the above token
    node3: /tmp/vagrant-shell: line 208: kubectl: command not found
    node3: https://172.17.8.101:
    node3: install traefik ingress controller
    node3: /tmp/vagrant-shell: line 210: kubectl: command not found
    node3: Configure Kubectl to autocomplete
    node3: /tmp/vagrant-shell: line 214: kubectl: command not found

从报错来看是找不到 kubectl 文件,请检查 node3 中的 kubernetes 安装包是否正常解压。

@fastdevops
https://v1-15.docs.kubernetes.io/docs/setup/release/notes/

下载v1.15的版本(v1.16版的一些apiversion改了,Dashboard和Traefik会安装失败)

kubernetes-client-linux-amd64.tar.gz
kubernetes-server-linux-amd64.tar.gz

放置在kubernetes-vagrant-centos-cluster目录下

执行vagrant up

之后根据文档修复 node3 dns-deploy.sh安装失败的问题,以及win10 chrome 访问dashboard 提示NET::ERR_CERT_INVALID 的问题即可

@rootsongjc
kubernetes-vagrant-centos-cluster目录下未放置安装包 直接执行vagrant up 后会触发
node3: /tmp/vagrant-shell: line 198: kubectl: command not found

在执行 vagrant up 之前建议先下载 kubernetes 安装包,并命名为 kubernetes-server-linux-amd64.tar.gz

你好:
mac下出现以下报错:怎么解决呢

▶ vagrant up --provider=virtualbox
Bringing machine 'node1' up with 'virtualbox' provider...
Bringing machine 'node2' up with 'virtualbox' provider...
Bringing machine 'node3' up with 'virtualbox' provider...
==> node1: Importing base box 'centos/7'...
==> node1: Matching MAC address for NAT networking...
==> node1: Setting the name of the VM: node1
==> node1: Clearing any previously set network interfaces...
There was an error while executing VBoxManage, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

Stderr: 0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg *)" at line 94 of file VBoxManageHostonly.cpp

There was an error while executing VBoxManage, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart
is able to solve this problem.

Environment

  • OS: Windows 10
  • Kubernetes version:
  • VirtualBox version: 6.0.12
  • Vagrant version: 2.2.5

What I did?

Your operations on this repo.

vagrant up

Messages

Logs or error messages.

   node3: cp: cannot stat ‘/vagrant/kubernetes/server/bin/*’: No such file or directory
    node3: configure node3
    node3: Created symlink from /etc/systemd/system/multi-user.target.wants/kubelet.service to /usr/lib/systemd/system/kubelet.service.
    node3: Created symlink from /etc/systemd/system/multi-user.target.wants/kube-proxy.service to /usr/lib/systemd/system/kube-proxy.service.
    node3: deploy coredns
    node3: /tmp/vagrant-shell: line 198: kubectl: command not found
    node3: /home/vagrant
    node3: deploy kubernetes dashboard
    node3: /tmp/vagrant-shell: line 202: kubectl: command not found
    node3: create admin role token
    node3: /tmp/vagrant-shell: line 204: kubectl: command not found
    node3: the admin role token is:
    node3: /tmp/vagrant-shell: line 206: kubectl: command not found
    node3: /tmp/vagrant-shell: line 206: kubectl: command not found
    node3: login to dashboard with the above token
    node3: /tmp/vagrant-shell: line 208: kubectl: command not found
    node3: https://172.17.8.101:
    node3: install traefik ingress controller
    node3: /tmp/vagrant-shell: line 210: kubectl: command not found
    node3: Configure Kubectl to autocomplete
    node3: /tmp/vagrant-shell: line 214: kubectl: command not found
node3: deploy coredns
node3: /tmp/vagrant-shell: line 198: kubectl: command not found
node3: /home/vagrant
node3: deploy kubernetes dashboard
node3: /tmp/vagrant-shell: line 202: kubectl: command not found
node3: create admin role token
node3: /tmp/vagrant-shell: line 204: kubectl: command not found
node3: the admin role token is:
node3: /tmp/vagrant-shell: line 206: kubectl: command not found
node3: /tmp/vagrant-shell: line 206: kubectl: command not found
node3: login to dashboard with the above token
node3: /tmp/vagrant-shell: line 208: kubectl: command not found
node3: https://172.17.8.101:
node3: install traefik ingress controller
node3: /tmp/vagrant-shell: line 210: kubectl: command not found
node3: Configure Kubectl to autocomplete
node3: /tmp/vagrant-shell: line 214: kubectl: command not found

same problem here

在执行 vagrant up 之前建议先下载 kubernetes 安装包,并命名为 kubernetes-server-linux-amd64.tar.gz

修改命令测试OK了,希望这块最好能优化下,还有安装过程中会输出红线,还以为是报错