Macos 在osx上尝试达到172.17.0.4:8080时出现minikube错误
我正在用osx上的minikube在本地做kubernetes教程。在步骤3中,我得到了错误Macos 在osx上尝试达到172.17.0.4:8080时出现minikube错误,macos,kubernetes,minikube,Macos,Kubernetes,Minikube,我正在用osx上的minikube在本地做kubernetes教程。在步骤3中,我得到了错误 % curl http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME/proxy/ Error: 'dial tcp 172.17.0.4:8080: getsockopt: connection refused' Trying to reach: 'http://172.17.0.4:8080/'% 知道为什么这在本地不起作用吗?
% curl http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME/proxy/
Error: 'dial tcp 172.17.0.4:8080: getsockopt: connection refused'
Trying to reach: 'http://172.17.0.4:8080/'%
知道为什么这在本地不起作用吗?更简单的请求确实有效
% curl http://localhost:8001/version
{
"major": "1",
"minor": "10",
"gitVersion": "v1.10.0",
"gitCommit": "fc32d2f3698e36b93322a3465f63a14e9f0eaead",
"gitTreeState": "clean",
"buildDate": "2018-03-26T16:44:10Z",
"goVersion": "go1.9.3",
"compiler": "gc",
"platform": "linux/amd64"
信息
日志
那么run命令正在启动节点,但是pod崩溃了?为什么?
$ kubectl run kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1 --port=8080
我可以毫无问题地提取图像
$ docker pull gcr.io/google-samples/kubernetes-bootcamp:v1
v1: Pulling from google-samples/kubernetes-bootcamp
5c90d4a2d1a8: Pull complete
ab30c63719b1: Pull complete
29d0bc1e8c52: Pull complete
d4fe0dc68927: Pull complete
dfa9e924f957: Pull complete
Digest: sha256:0d6b8ee63bb57c5f5b6156f446b3bc3b3c143d233037f3a2f00e279c8fcc64af
Status: Downloaded newer image for gcr.io/google-samples/kubernetes-bootcamp:v1
描述
$ kubectl describe pods
Name: kubernetes-bootcamp-74f58d6b87-w4zh8
Namespace: default
Node: minikube/10.0.2.15
Start Time: Tue, 24 Jul 2018 15:05:00 -0400
Labels: pod-template-hash=3091482643
run=kubernetes-bootcamp
Annotations: <none>
Status: Pending
IP: 172.17.0.3
Controlled By: ReplicaSet/kubernetes-bootcamp-74f58d6b87
Containers:
kubernetes-bootcamp:
Container ID:
Image: gci.io/google-samples/kubernetes-bootcamp:v1
Image ID:
Port: 8080/TCP
State: Waiting
Reason: ImagePullBackOff
Ready: False
Restart Count: 0
Environment: <none>
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-wp28q (ro)
Conditions:
Type Status
Initialized True
Ready False
PodScheduled True
Volumes:
default-token-wp28q:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-wp28q
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal BackOff 23m (x281 over 1h) kubelet, minikube Back-off pulling image "gci.io/google-samples/kubernetes-bootcamp:v1"
Warning Failed 4m (x366 over 1h) kubelet, minikube Error: ImagePullBackOff
$kubectl描述吊舱
名称:kubernetes-bootcamp-74f58d6b87-w4zh8
名称空间:默认值
节点:minikube/10.0.2.15
开始时间:2018年7月24日星期二15:05:00-0400
标签:pod模板哈希=3091482643
跑步=库伯内特斯训练营
注释:
状态:待定
IP:172.17.0.3
控制人:ReplicaSet/kubernetes-bootcamp-74f58d6b87
容器:
库伯内特斯训练营:
容器ID:
图片:gci.io/googlesamples/kubernetes训练营:v1
图像ID:
端口:8080/TCP
国家:等待
原因:图像拉回
就绪:错误
重新启动计数:0
环境:
挂载:
/来自default-token-wp28q(ro)的var/run/secrets/kubernetes.io/serviceCount
条件:
类型状态
初始化为True
准备错误
播客预定为真
卷数:
default-token-wp28q:
类型:Secret(由Secret填充的卷)
SecretName:default-token-wp28q
可选:false
QoS等级:最佳努力
节点选择器:
容差:node.kubernetes.io/未就绪:不执行300秒
node.kubernetes.io/不可访问:不执行300秒
活动:
从消息中键入原因年龄
---- ------ ---- ---- -------
正常退避23m(x281/1h)kubelet,minikube退避图片“gci.io/google samples/kubernetes训练营:v1”
警告失败4m(x366超过1h)kubelet,minikube错误:ImagePullBackOff
是一种可以在本地轻松运行的工具
Minikube运行单节点Kubernetes
群集在笔记本电脑上的虚拟机中,供希望试用Kubernetes或日常使用它进行开发的用户使用
回到你的问题上来。您是否已检查是否提供了足够的资源来运行Minikube环境
您可以尝试运行minikube并强制分配更多内存:
minikube start --memory 4096
为了进一步分析,请提供有关此安装和安装专用资源的信息
您使用的虚拟机监控程序的类型。听起来像是网络问题。您的虚拟机无法从gcr中提取映像。io:443 以下是您的
kubectl所描述的kubernetes训练营xxx的吊舱外观:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 5m default-scheduler Successfully assigned kubernetes-bootcamp-5c69669756-xbbmn to minikube
Normal SuccessfulMountVolume 5m kubelet, minikube MountVolume.SetUp succeeded for volume "default-token-cfq65"
Normal Pulling 5m kubelet, minikube pulling image "gcr.io/google-samples/kubernetes-bootcamp:v1"
Normal Pulled 5m kubelet, minikube Successfully pulled image "gcr.io/google-samples/kubernetes-bootcamp:v1"
Normal Created 5m kubelet, minikube Created container
Normal Started 5m kubelet, minikube Started container
Normal SuccessfulMountVolume 1m kubelet, minikube MountVolume.SetUp succeeded for volume "default-token-cfq65"
Normal SandboxChanged 1m kubelet, minikube Pod sandbox changed, it will be killed and re-created.
Normal Pulled 1m kubelet, minikube Container image "gcr.io/google-samples/kubernetes-bootcamp:v1" already present on machine
Normal Created 1m kubelet, minikube Created container
Normal Started 1m kubelet, minikube Started container
从主机上尝试此操作,以缩小虚拟机或主机的网络问题:
$ docker pull gcr.io/google-samples/kubernetes-bootcamp:v1
v1: Pulling from google-samples/kubernetes-bootcamp
5c90d4a2d1a8: Pull complete
ab30c63719b1: Pull complete
29d0bc1e8c52: Pull complete
d4fe0dc68927: Pull complete
dfa9e924f957: Pull complete
Digest: sha256:0d6b8ee63bb57c5f5b6156f446b3bc3b3c143d233037f3a2f00e279c8fcc64af
Status: Downloaded newer image for gcr.io/google-samples/kubernetes-bootcamp:v1
吊舱真的在运行吗?kubectl日志$POD\u NAME
有什么有趣的地方吗?这个错误消息听起来像是pod没有启动或者配置错误;pod中的进程需要监听0.0.0.0:8080。是的,教程还要求您运行kubectl get pods
,并且pod正在您的输出中运行,pod未运行:>kubernetes-bootcamp-74f58d6b87-ntn5r 0/1您可以使用命令kubectl cluster info
获取有关群集的所有信息,并检查代理是否存在。您可以使用命令curlhttp://localhost:8001/api/v1/namespaces/default/pods/kubernetes-bootcamp-79c8445fcb-72cfd/
通过API获取pod信息。如何收集有关我的环境的信息?您是否在osx上并遵循本教程?接下来,我确定pod的ip地址为172.17.0.4:8080在安装minikube时使用了什么虚拟机监控程序以及Mac上有多少RAM?不确定虚拟机监控程序是什么,virtualbox?我在一台16gb内存和chrome的mac电脑上,打开了几个选项卡。我可以建议你:?
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 5m default-scheduler Successfully assigned kubernetes-bootcamp-5c69669756-xbbmn to minikube
Normal SuccessfulMountVolume 5m kubelet, minikube MountVolume.SetUp succeeded for volume "default-token-cfq65"
Normal Pulling 5m kubelet, minikube pulling image "gcr.io/google-samples/kubernetes-bootcamp:v1"
Normal Pulled 5m kubelet, minikube Successfully pulled image "gcr.io/google-samples/kubernetes-bootcamp:v1"
Normal Created 5m kubelet, minikube Created container
Normal Started 5m kubelet, minikube Started container
Normal SuccessfulMountVolume 1m kubelet, minikube MountVolume.SetUp succeeded for volume "default-token-cfq65"
Normal SandboxChanged 1m kubelet, minikube Pod sandbox changed, it will be killed and re-created.
Normal Pulled 1m kubelet, minikube Container image "gcr.io/google-samples/kubernetes-bootcamp:v1" already present on machine
Normal Created 1m kubelet, minikube Created container
Normal Started 1m kubelet, minikube Started container
$ docker pull gcr.io/google-samples/kubernetes-bootcamp:v1
v1: Pulling from google-samples/kubernetes-bootcamp
5c90d4a2d1a8: Pull complete
ab30c63719b1: Pull complete
29d0bc1e8c52: Pull complete
d4fe0dc68927: Pull complete
dfa9e924f957: Pull complete
Digest: sha256:0d6b8ee63bb57c5f5b6156f446b3bc3b3c143d233037f3a2f00e279c8fcc64af
Status: Downloaded newer image for gcr.io/google-samples/kubernetes-bootcamp:v1