minikube 安装在 OS X 上失败

minikube install failes on OS X

我在 OS X (Catalina 10.15.7) 上从 releases/latest/minikube-darwin-amd64 下载 minikube,当 运行 时失败,见下文:

minikube version
/usr/local/bin/minikube: line 1: syntax error near unexpected token `<'
/usr/local/bin/minikube: line 1: `<?xml version='1.0' encoding='UTF-8'?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Details>No such object: minikube/releases/latest/minikube-darwin-amd</Details></Error>'

不确定它指的是哪个键。

此问题是由 curl 命令中的无效 URL 引起的。查看错误消息,我的猜测是最后缺少 64

我重现了这个错误,我们可以看到错误消息与问题中的完全相同(我使用的是 Linux 所以我使用 [=19 而不是 minikube-darwin-amd64 =]):
注意:我最后没有提供64

$ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   205  100   205    0     0   6029      0 --:--:-- --:--:-- --:--:--  6029
$ sudo install minikube-linux-amd /usr/local/bin/minikube

尺寸对于 minikube 来说太小了:

$ ls -lh /usr/local/bin/minikube
-rwxr-xr-x 1 root root 205 Aug 13 07:30 /usr/local/bin/minikube

错误信息:

$ minikube version
/usr/local/bin/minikube: line 1: syntax error near unexpected token `<'
/usr/local/bin/minikube: line 1: `<?xml version='1.0' encoding='UTF-8'?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Details>No such object: minikube/releases/latest/minikube-linux-amd</Details></Error>'

现在让我们正确安装minikube

$ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
$ sudo install minikube-linux-amd64 /usr/local/bin/minikube

我们可以看到minikube的真实大小是>65M:

$ ls -lh /usr/local/bin/minikube
-rwxr-xr-x 1 root root 67M Aug 13 07:32 /usr/local/bin/minikube

一切都按预期进行:

$ minikube version
minikube version: v1.22.0
commit: a03fbcf166e6f74ef224d4a63be4277d017bb62e