Coder Social home page Coder Social logo

aliyuncontainerservice / k8s-for-docker-desktop Goto Github PK

View Code? Open in Web Editor NEW
4.9K 136.0 1.1K 2.61 MB

为Docker Desktop for Mac/Windows开启Kubernetes和Istio。

Home Page: https://yq.aliyun.com/articles/672675

Shell 20.85% PowerShell 79.15%
kubernetes docker china k8s helm istio mac windows

k8s-for-docker-desktop's Introduction

Docker Desktop for Mac/Windows 开启 Kubernetes

中文 | English

欢迎体验阿里云容器服务 Kubernetes Serverless版 (ASK)免费试用计划 , 开启云上云原生实践之旅。 https://free.aliyun.com/?product=9596839

说明:

  • 需安装 Docker Desktop 的 Mac 或者 Windows 版本,如果没有请下载下载 Docker CE最新版本
  • 当前 master 分支已经在 Docker for Mac/Windows 4.27.0 (包含 Docker 25.0.1 和 Kubernetes v1.29.1) 版本测试通过
  • 如果需要测试其他版本,请查看 Docker Desktop版本,Docker -> About Docker Desktop about
    • 如Kubernetes版本为 v1.29.1, 请使用下面命令切换 v1.29.1 分支 git checkout v1.29.1
    • 如Kubernetes版本为 v1.28.2, 请使用下面命令切换 v1.28.2 分支 git checkout v1.28.2
    • 如Kubernetes版本为 v1.27.2, 请使用下面命令切换 v1.27.2 分支 git checkout v1.27.2
    • 如Kubernetes版本为 v1.25.9, 请使用下面命令切换 v1.25.9 分支 git checkout v1.25.9
    • 如Kubernetes版本为 v1.25.4, 请使用下面命令切换 v1.25.4 分支 git checkout v1.25.4
    • 如Kubernetes版本为 v1.25.2, 请使用下面命令切换 v1.25.2 分支 git checkout v1.25.2
    • 如Kubernetes版本为 v1.25.0, 请使用下面命令切换 v1.25.0 分支 git checkout v1.25.0
    • 如Kubernetes版本为 v1.24.2, 请使用下面命令切换 v1.24.2 分支 git checkout v1.24.2
    • 如Kubernetes版本为 v1.24.0, 请使用下面命令切换 v1.24.0 分支 git checkout v1.24.0
    • 如Kubernetes版本为 v1.23.4, 请使用下面命令切换 v1.23.4 分支 git checkout v1.23.4
    • 如Kubernetes版本为 v1.22.5, 请使用下面命令切换 v1.22.5 分支 git checkout v1.22.5
    • 如Kubernetes版本为 v1.22.4, 请使用下面命令切换 v1.22.4 分支 git checkout v1.22.4
    • 如Kubernetes版本为 v1.21.5, 请使用下面命令切换 v1.21.5 分支 git checkout v1.21.5
    • 如Kubernetes版本为 v1.21.4, 请使用下面命令切换 v1.21.4 分支 git checkout v1.21.4
    • 如Kubernetes版本为 v1.21.3, 请使用下面命令切换 v1.21.3 分支 git checkout v1.21.3
    • 如Kubernetes版本为 v1.21.2, 请使用下面命令切换 v1.21.2 分支 git checkout v1.21.2
    • 如Kubernetes版本为 v1.21.1, 请使用下面命令切换 v1.21.1 分支 git checkout v1.21.1
    • 如Kubernetes版本为 v1.19.3, 请使用下面命令切换 v1.19.3 分支 git checkout v1.19.3
    • 如Kubernetes版本为 v1.19.2, 请使用下面命令切换 v1.19.2 分支 git checkout v1.19.2
    • 如Kubernetes版本为 v1.18.8, 请使用下面命令切换 v1.18.8 分支 git checkout v1.18.8
    • 如Kubernetes版本为 v1.18.6, 请使用下面命令切换 v1.18.6 分支 git checkout v1.18.6
    • 如Kubernetes版本为 v1.18.3, 请使用下面命令切换 v1.18.3 分支 git checkout v1.18.3
    • 如Kubernetes版本为 v1.16.5, 请使用下面命令切换 v1.16.5 分支 git checkout v1.16.5
    • 如Kubernetes版本为 v1.15.5, 请使用下面命令切换 v1.15.5 分支 git checkout v1.15.5
    • 如Kubernetes版本为 v1.15.4, 请使用下面命令切换 v1.15.4 分支 git checkout v1.15.4
    • 如Kubernetes版本为 v1.14.8, 请使用下面命令切换 v1.14.8 分支 git checkout v1.14.8
    • 如Kubernetes版本为 v1.14.7, 请使用下面命令切换 v1.14.7 分支 git checkout v1.14.7
    • 如Kubernetes版本为 v1.14.6, 请使用下面命令切换 v1.14.6 分支 git checkout v1.14.6
    • 如Kubernetes版本为 v1.14.3, 请使用下面命令切换 v1.14.3 分支 git checkout v1.14.3
    • 如Kubernetes版本为 v1.14.1, 请使用下面命令切换 v1.14.1 分支 git checkout v1.14.1
    • 如Kubernetes版本为 v1.13.0, 请使用下面命令切换 v1.13.0 分支 git checkout v1.13.0
    • 如Kubernetes版本为 v1.10.11, 请使用下面命令切换 v1.10.11 分支 git checkout v1.10.11

注:如果发现K8s版本与您的环境不一致,可以修改images.properties文件指明所需镜像版本,欢迎Pull Request。

开启 Kubernetes

为 Docker daemon 配置镜像加速,参考阿里云镜像服务 或中科大镜像加速地址https://docker.mirrors.ustc.edu.cn

mirror

可选操作: 为 Kubernetes 配置 CPU 和 内存资源,建议分配 4GB 或更多内存。

resource

从阿里云镜像服务下载 Kubernetes 所需要的镜像

在 Mac 上执行如下脚本

./load_images.sh

在Windows上,使用 PowerShell

 .\load_images.ps1

说明:

  • 如果因为安全策略无法执行 PowerShell 脚本,请在 “以管理员身份运行” 的 PowerShell 中执行 Set-ExecutionPolicy RemoteSigned 命令。
  • 如果需要,可以通过修改 images.properties 文件自行加载你自己需要的镜像

开启 Kubernetes,并等待 Kubernetes 开始运行 k8s

TIPS

在Mac上:

如果在Kubernetes部署的过程中出现问题,可以通过docker desktop应用日志获得实时日志信息:

pred='process matches ".*(ocker|vpnkit).*"
  || (process in {"taskgated-helper", "launchservicesd", "kernel"} && eventMessage contains[c] "docker")'
/usr/bin/log stream --style syslog --level=debug --color=always --predicate "$pred"

在Windows上:

如果在Kubernetes部署的过程中出现问题,可以在 C:\ProgramData\DockerDesktop下的service.txt 查看Docker日志, 在 C:\Users\yourUserName\AppData\Local\Docker下的log.txt 查看Kubernetes日志

问题诊断

如果看到 Kubernetes一直在启动状态,请参考

K8S进入容器方法

K8s如何进入一个pod里有多个容器的方法

kubectl --namespace=kube-system exec -it kube-dns-1336009800-15b1h --container nginx -- sh

kubectl --namespace=kube-system exec -it kube-dns-1336009800-15b1h  -c  nginx -- sh

注释:--namespace 为命名空间kube-dns为pod的名字,-c或-container为Pod里其中的一个容器名字

配置 Kubernetes

可选操作: 切换Kubernetes运行上下文至 docker-desktop (之前版本的 context 为 docker-for-desktop)

kubectl config use-context docker-desktop

验证 Kubernetes 集群状态

kubectl cluster-info
kubectl get nodes

配置 Kubernetes 控制台

部署 Kubernetes dashboard

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.5.1/aio/deploy/recommended.yaml

kubectl apply -f kubernetes-dashboard.yaml

检查 kubernetes-dashboard 应用状态

kubectl get pod -n kubernetes-dashboard

开启 API Server 访问代理

kubectl proxy

通过如下 URL 访问 Kubernetes dashboard

http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/

配置控制台访问令牌

授权kube-system默认服务账号

kubectl apply -f kube-system-default.yaml

对于Mac环境

TOKEN=$(kubectl -n kube-system describe secret default| awk '$1=="token:"{print $2}')
kubectl config set-credentials docker-desktop --token="${TOKEN}"
echo $TOKEN

对于Windows环境

$TOKEN=((kubectl -n kube-system describe secret default | Select-String "token:") -split " +")[1]
kubectl config set-credentials docker-desktop --token="${TOKEN}"
echo $TOKEN

登录dashboard的时候

resource

选择 令牌

输入上文控制台输出的内容

或者选择 Kubeconfig 文件,路径如下:

Mac: $HOME/.kube/config
Win: %UserProfile%\.kube\config

点击登陆,进入Kubernetes Dashboard

配置 Ingress

说明:如果测试 Istio,不需要安装 Ingress

安装 Ingress

源地址安装说明

验证

kubectl get pods --all-namespaces -l app.kubernetes.io/name=ingress-nginx

测试示例应用

部署测试应用,详情参见社区文章

kubectl create -f sample/apple.yaml
kubectl create -f sample/banana.yaml
kubectl create -f sample/ingress.yaml

测试示例应用

$ curl -kL http://localhost/apple
apple
$ curl -kL http://localhost/banana
banana

删除示例应用

kubectl delete -f sample/apple.yaml
kubectl delete -f sample/banana.yaml
kubectl delete -f sample/ingress.yaml

删除 Ingress

kubectl delete -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.2.0/deploy/static/provider/cloud/deploy.yaml

kubectl delete -f ingress-nginx-controller.yaml

安装 Helm

可以根据文档安装 helm v3 https://helm.sh/docs/intro/install/ 在国内由于helm的cdn节点使用的是谷歌云所以可能访问不到,可以参考已存在的官方issue: helm/helm#7028

在 Mac OS 上安装

通过 brew 安装
# Use homebrew on Mac
brew install helm

# Add helm repo
helm repo add stable http://mirror.azure.cn/kubernetes/charts/

# Update charts repo
helm repo update

在Windows上安装

如果在后续使用 helm 安装组件的过程中出现版本兼容问题,可以参考 通过二进制包安装 思路安装匹配的版本

# Use Chocolatey on Windows
# 注:安装的时候需要保证网络能够访问googleapis这个域名
choco install kubernetes-helm

# Change helm repo
helm repo add stable http://mirror.azure.cn/kubernetes/charts/

# Update charts repo
helm repo update

测试 Helm (可选)

安装 Wordpress

helm install wordpress stable/wordpress

查看 wordpress 发布状态

helm status wordpress

卸载 wordpress 发布

helm uninstall wordpress

配置 Istio

说明:Istio Ingress Gateway和Ingress缺省的端口冲突,请移除Ingress并进行下面测试

可以根据文档安装 Istio https://istio.io/docs/setup/getting-started/

下载 Istio 1.5.0

curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.5.0 sh -
cd istio-1.5.0
export PATH=$PWD/bin:$PATH

在Windows上,您可以手工下载Istio安装包,或者把getLatestIstio.ps1拷贝到你希望下载 Istio 的目录,并执行 - 说明:根据社区提供的安装脚本修改而来

.\getLatestIstio.ps1

安装 Istio

istioctl manifest apply --set profile=demo

检查 Istio 状态

kubectl get pods -n istio-system

default 名空间开启自动 sidecar 注入

kubectl label namespace default istio-injection=enabled
kubectl get namespace -L istio-injection

安装 Book Info 示例

请参考 https://istio.io/docs/examples/bookinfo/

kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml

查看示例应用资源

kubectl get svc,pod

确认示例应用在运行中

kubectl exec -it $(kubectl get pod -l app=ratings -o jsonpath='{.items[0].metadata.name}') -c ratings -- curl productpage:9080/productpage | grep -o "<title>.*</title>"

创建 Ingress Gateway

kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml

查看 Gateway 配置

kubectl get gateway

确认示例应用可以访问

export GATEWAY_URL=localhost:80
curl -s http://${GATEWAY_URL}/productpage | grep -o "<title>.*</title>"

可以通过浏览器访问

http://localhost/productpage

删除实例应用

samples/bookinfo/platform/kube/cleanup.sh

卸载 Istio

istioctl manifest generate --set profile=demo | kubectl delete -f -

k8s-for-docker-desktop's People

Contributors

0x9be00ff1 avatar 297513458 avatar birnfly avatar bluesbreaker45 avatar celeron533 avatar cyberhan123 avatar denverdino avatar eoeac avatar expcat avatar flyingonion avatar ghosind avatar inouekonoha avatar jiangzm avatar lufever avatar maguowei avatar mark4z avatar mazyi avatar moodpo avatar mzmuer avatar rusherman avatar silent-night-no-trace avatar taobig avatar vallens avatar wuwx avatar wuyongdec avatar xiaods avatar zhucebuliaopx avatar zhusaidong avatar zlzforever avatar zuozishi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

k8s-for-docker-desktop's Issues

k8s一直starting

为什么我下了同一个版本的docker desktop v2.0.0.3,也下载了对应的k8s-for-docker-desktop,但是点击enable k8s,apply后,有一台是好的,但是另外一台怎么都starting状态,会存在哪些原因造成这种现象。

docker-desktop版本问题

docker hub下载到的docker-desktop最新版本 k8s的版本已经升级了,怎么下载旧版本的docker-desktop

macOS v2.0.0.2 doesn't work

the last step ,when "enable kubernetes" , docker for mac will prompt "install kubernetes cluster" which have 2 options cancel and ok, when cancel it will cancel the "enable", when ok, docker will install kubernetes , the status always "Kubernetes is starting"

kubernetes is starting....

Version

image

Problem

I use branch v1.14.7 and reset docker desktop to factory default, but it can't work for me, always display Kubernetes is starting...

Log

2019-10-25 16:34:01.460933+0800  localhost com.docker.driver.amd64-linux[21448]: (libsystem_info.dylib) [com.apple.network.libinfo:getaddrinfo] nat64_v4_requires_synthesis(127.0.0.1) == false
2019-10-25 16:34:01.467968+0800  localhost com.docker.driver.amd64-linux[21448]: (libsystem_info.dylib) [com.apple.network.libinfo:getaddrinfo] nat64_v4_requires_synthesis(127.0.0.1) == false
2019-10-25 16:34:02.308591+0800  localhost com.docker.vpnkit[21447]: ICMP: destination unreachable from *******
2019-10-25 16:34:02.458750+0800  localhost com.docker.driver.amd64-linux[21448]: (libsystem_info.dylib) [com.apple.network.libinfo:getaddrinfo] nat64_v4_requires_synthesis(127.0.0.1) == false
2019-10-25 16:34:02.471642+0800  localhost com.docker.driver.amd64-linux[21448]: (libsystem_info.dylib) [com.apple.network.libinfo:getaddrinfo] nat64_v4_requires_synthesis(127.0.0.1) == false
2019-10-25 16:34:03.300455+0800  localhost com.docker.vpnkit[21447]: ICMP: destination unreachable from ********
2019-10-25 16:34:03.456669+0800  localhost com.docker.driver.amd64-linux[21448]: (libsystem_info.dylib) [com.apple.network.libinfo:getaddrinfo] nat64_v4_requires_synthesis(127.0.0.1) == false
2019-10-25 16:34:03.471750+0800  localhost com.docker.driver.amd64-linux[21448]: (libsystem_info.dylib) [com.apple.network.libinfo:getaddrinfo] nat64_v4_requires_synthesis(127.0.0.1) == false

kubernetes failed to start

2019-05-24 23:11:20.328280+0800 localhost com.docker.vpnkit[7531]: HTTP proxy --> 106.14.52.175:443 Host:registry.docker-cn.com:443 (Origin): Failed to connect to 106.14.52.175:443
2019-05-24 23:11:20.328345+0800 localhost com.docker.vpnkit[7531]: HTTP proxy: returning 503 Service_unavailable

运行./load_images.sh 时报错

bash shell 运行./load_images.sh 出现错误 invalid reference farmat
错误如下:
$ ./load_images.sh images.properties found. invalid reference format Error parsing reference: "registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.1\r" is not a valid repository/tag: invalid reference format Error response from daemon: invalid reference format invalid reference format Error parsing reference: "registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:v1.15.4\r" is not a valid repository/tag: invalid reference format Error response from daemon: invalid reference format invalid reference format Error parsing reference: "registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:v1.15.4\r" is not a valid repository/tag: invalid reference format Error response from daemon: invalid reference format invalid reference format Error parsing reference: "registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.15.4\r" is not a valid repository/tag: invalid reference format Error response from daemon: invalid reference format invalid reference format Error parsing reference: "registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.3.10\r" is not a valid repository/tag: invalid reference format Error response from daemon: invalid reference format invalid reference format Error parsing reference: "registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:1.3.1\r" is not a valid repository/tag: invalid reference format Error response from daemon: invalid reference format invalid reference format Error parsing reference: "registry.cn-hangzhou.aliyuncs.com/google_containers/kubernetes-dashboard-amd64:v1.10.1\r" is not a valid repository/tag: invalid reference format Error response from daemon: invalid reference format invalid reference format Error parsing reference: "registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller:0.26.1\r" is not a valid repository/tag: invalid reference format Error response from daemon: invalid reference format

升级2.1.0.4 (39773)后报Cannot list nodes: Get https://kubernetes.docker.internal:6443/api/v1/nodes: EOF

Version: 2.1.0.4 (39773)
Channel: stable
Engine: 19.03.4
Uploading 图片.png…
报错
[16:03:45.645][ApiProxy ][Error ] time="2019-11-09T16:03:45+08:00" msg="Cannot list nodes: Get https://kubernetes.docker.internal:6443/api/v1/nodes: EOF"
[16:03:46.644][ApiProxy ][Error ] time="2019-11-09T16:03:46+08:00" msg="Cannot list nodes: Get https://kubernetes.docker.internal:6443/api/v1/nodes: EOF"
[16:03:46.843][VpnKit ][Info ] vpnkit.exe: Expired 256 UDP NAT rules

[16:03:47.643][ApiProxy ][Error ] time="2019-11-09T16:03:47+08:00" msg="Cannot list nodes: Get https://kubernetes.docker.internal:6443/api/v1/nodes: EOF"
[16:03:48.644][ApiProxy ][Error ] time="2019-11-09T16:03:48+08:00" msg="Cannot list nodes: Get https://kubernetes.docker.internal:6443/api/v1/nodes: EOF"
[16:03:49.644][ApiProxy ][Error ] time="2019-11-09T16:03:49+08:00" msg="Cannot list nodes: Get https://kubernetes.docker.internal:6443/api/v1/nodes: EOF"
[16:03:50.152][VpnKit ][Info ] vpnkit.exe: Connected Ethernet interface f6:16:36:bc:f9:c6

[16:03:50.152][VpnKit ][Info ] vpnkit.exe: UDP interface connected on 74.125.23.82

[16:03:50.644][ApiProxy ][Error ] time="2019-11-09T16:03:50+08:00" msg="Cannot list nodes: Get https://kubernetes.docker.internal:6443/api/v1/nodes: EOF"

2.1.0.4 kubernetes is starting

问下该版本是不是还没支持k8s?我看对应1.14.7分支上用的是1.15.4的版本,
日志中错误是:
[10:41:10.815][GoBackendProcess ][Info ] error copying: EOF
[10:41:10.815][ApiProxy ][Error ] time="2019-10-26T10:41:10+08:00" msg="Cannot list nodes: Get https://kubernetes.docker.internal:6443/api/v1/nodes: EOF"
[10:41:11.817][ApiProxy ][Error ] time="2019-10-26T10:41:11+08:00" msg="Cannot list nodes: Get https://kubernetes.docker.internal:6443/api/v1/nodes: EOF"
[10:41:12.813][ApiProxy ][Error ] time="2019-10-26T10:41:12+08:00" msg="Cannot list nodes: Get https://kubernetes.docker.internal:6443/api/v1/nodes: EOF"

docker desktop for windows 2.0.3.0,k8s无法启动

您好,我的docker desktop for windows 版本是 2.0.3.0,k8s-for-docker-desktop的分支是master,但k8s一直处于starting状态,截取了部分日志如下

`[22:34:12.220][VpnKit ][Info ] vpnkit.exe: Expired 256 UDP NAT rules

[22:34:12.908][ApiProxy ][Error ] time="2019-03-26T22:34:12+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[22:34:13.901][ApiProxy ][Error ] time="2019-03-26T22:34:13+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[22:34:14.903][ApiProxy ][Error ] time="2019-03-26T22:34:14+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[22:34:24.352][ApiProxy ][Info ] time="2019-03-26T22:34:24+08:00" msg="Cluster is ready"
[22:34:24.352][ApiProxy ][Info ] time="2019-03-26T22:34:24+08:00" msg="0/3 system pods running, found labels but still waiting for labels k8s-app=kube-dns, component=kube-controller-manager, component=kube-apiserver..."
[22:34:24.352][ApiProxy ][Info ] time="2019-03-26T22:34:24+08:00" msg="Waiting for system pods"
[22:34:24.679][ApiProxy ][Info ] time="2019-03-26T22:34:24+08:00" msg="0/3 system pods running, found labels but still waiting for labels k8s-app=kube-dns, component=kube-controller-manager, component=kube-apiserver..."
[22:34:25.676][ApiProxy ][Info ] time="2019-03-26T22:34:25+08:00" msg="0/3 system pods running, found labels but still waiting for labels k8s-app=kube-dns, component=kube-controller-manager, component=kube-apiserver..."
[22:34:26.672][ApiProxy ][Info ] time="2019-03-26T22:34:26+08:00" msg="0/3 system pods running, found labels but still waiting for labels k8s-app=kube-dns, component=kube-controller-manager, component=kube-apiserver..."
[22:34:27.361][ApiProxy ][Info ] time="2019-03-26T22:34:27+08:00" msg="0/3 system pods running, found labels but still waiting for labels k8s-app=kube-dns, component=kube-controller-manager, component=kube-apiserver..."
[22:34:27.676][ApiProxy ][Info ] time="2019-03-26T22:34:27+08:00" msg="0/3 system pods running, found labels but still waiting for labels k8s-app=kube-dns, component=kube-controller-manager, component=kube-apiserver..."`

docker版本信息:
image

拉取的镜像信息如下:
image

Docker desktop for win 2.0.4.1 k8s 一直处于starting

k8s 版本号为:v1.14.1
service.txt输出的日志如下:
[Warning] time="2019-05-11T09:24:54+08:00" msg="Error while setting up kubernetes: cannot expose the external port: cannot connect to vpnkit: open \\.\pipe\dockerVpnKitControl: The system cannot find the file specified.. Retrying in 1s"

请问这是什么问题呢?

curl return Empty reply from server

Windows 10 64位,docker for windows:
Engine: 18.09.0
Kubernetes: v1.10.3
在MINGW64里面:
curl -kL http://localhost/apple
返回结果如下:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
curl: (52) Empty reply from server

这是什么原因?
注:
在power shell里面:kubectl get ingress,结果如下:
NAME HOSTS ADDRESS PORTS AGE
example-ingress * 80 8h

安装不成功

你好,我把镜像下载下来了,但kubernetes还是启动不成功。不知道如何排查问题。
kubernetes is starting一直是这个状态。

使用homebrew安装helm命令变更

使用brew install helm安装helm提示报错:No available formula with the name "helm"。
查了helm的github主页,安装命令已变更为brew install kubernetes-helm
安装完后需要helm init之后在add helm repo

Kubernetes cluster installation 19.03.4

QQ图片20191024171417

The initial Kubernetes cluster installation takes a few minutes and requires an Internet connection.

Install the Kubernetes cluster now?
这个是必须安装才能往下走,
QQ图片20191024181210

Kubernetes is starting

使用最新的DockerDestop版本和v1.14.7分支
image

报错日志如下:
[10:01:44.429][SegmentApi ][Info ] Usage statistic: actionMenuFeedback
[10:01:44.439][NamedPipeClient ][Info ] Sending app/version()...
[10:01:44.440][NamedPipeClient ][Info ] Received response for app/version
[10:01:44.440][NamedPipeClient ][Info ] Sending diagnostics/gather()...
[10:01:44.440][NamedPipeServer ][Info ] app/version()
[10:01:44.440][NamedPipeServer ][Info ] app/version done in 00:00:00.
[10:01:44.440][NamedPipeServer ][Info ] diagnostics/gather()
[10:01:44.633][ApiProxy ][Error ] time="2019-11-04T10:01:44+08:00" msg="Cannot list nodes: Get https://kubernetes.docker.internal:6443/api/v1/nodes: dial tcp: lookup kubernetes.docker.internal: no such host"
[10:01:45.636][ApiProxy ][Error ] time="2019-11-04T10:01:45+08:00" msg="Cannot list nodes: Get https://kubernetes.docker.internal:6443/api/v1/nodes: dial tcp: lookup kubernetes.docker.internal: no such host"

kubernetes is starting

拉完镜像一直在starting ,看日志一直报
Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF

参照另一个issuse,已经用管理员权限运行docker for windows ,还是不行
docker for windows version: Version 2.0.0.2 (30215)
Engine: 18.09.1

按照readme步骤学习部署ingress,curl: (7) Failed to connect to localhost port 80: Connection refused

我用mac的 docker desktop ,已经验证 ingress-nginx 处在running状态

kubectl get pods --all-namespaces -l app.kubernetes.io/name=ingress-nginx
NAMESPACE       NAME                                      READY     STATUS    RESTARTS   AGE
ingress-nginx   nginx-ingress-controller-54f689bd-64sp5   1/1       Running   0          3h

接着部署了 apple,banana ingress (都先下到本地)

kubectl create -f sample/apple.yaml
kubectl create -f sample/banana.yaml
kubectl create -f sample/ingress.yaml
kubectl get ingress                                                                                                                                git:k8s
NAME              HOSTS     ADDRESS   PORTS     AGE
example-ingress   *                   80        5m

但是 ,请问怎么解决?

curl -kL http://localhost/apple                                                                                                                    git:k8s
curl: (7) Failed to connect to localhost port 80: Connection refused

docker desktop for windows 2.0.3.0,k8s卡在starting

您好,我安装docker for windows并下载相应的镜像文件后,依然无法启动k8s。尝试措施如下:
1.为vpnkit放通防火墙策略
2.删除~/.kube文件夹,并以管理员重启docker for win

以上措施没有得到成效,log报错如下

[23:39:27.792][NamedPipeClient][Info   ] Received response for GetDefaultVhdxPath
[23:39:27.788][NamedPipeServer][Info   ] Version done in 00:00:00.
[23:39:27.789][NamedPipeServer][Info   ] GetDefaultVhdxPath()
[23:39:27.792][NamedPipeServer][Info   ] GetDefaultVhdxPath done in 00:00:00.0029997.
[23:39:27.851][NamedPipeClient][Info   ] Sending Version()...
[23:39:27.852][NamedPipeClient][Info   ] Received response for Version
[23:39:27.853][NamedPipeClient][Info   ] Sending TryGetVhdxSize(D:\DockerImages\MobyLinuxVM.vhdx)...
[23:39:27.852][NamedPipeServer][Info   ] Version()
[23:39:27.852][NamedPipeServer][Info   ] Version done in 00:00:00.
[23:39:27.853][NamedPipeServer][Info   ] TryGetVhdxSize(D:\DockerImages\MobyLinuxVM.vhdx)
[23:39:27.853][PowerShell     ][Info   ] Run script...
[23:39:27.929][NamedPipeClient][Info   ] Received response for TryGetVhdxSize
[23:39:27.929][NamedPipeServer][Info   ] TryGetVhdxSize done in 00:00:00.0759810.
[23:39:27.931][NamedPipeClient][Info   ] Sending Version()...
[23:39:27.931][NamedPipeClient][Info   ] Received response for Version
[23:39:27.932][NamedPipeClient][Info   ] Sending TryGetVhdxSize(D:\DockerImages\MobyLinuxVM.vhdx)...
[23:39:27.931][NamedPipeServer][Info   ] Version()
[23:39:27.931][NamedPipeServer][Info   ] Version done in 00:00:00.
[23:39:27.932][NamedPipeServer][Info   ] TryGetVhdxSize(D:\DockerImages\MobyLinuxVM.vhdx)
[23:39:27.932][PowerShell     ][Info   ] Run script...
[23:39:27.987][NamedPipeClient][Info   ] Received response for TryGetVhdxSize
[23:39:27.986][NamedPipeServer][Info   ] TryGetVhdxSize done in 00:00:00.0540045.
[23:39:28.329][ApiProxy       ][Info   ] Init returned
[23:39:28.329][ApiProxy       ][Info   ] time="2019-03-26T23:39:28+08:00" msg="Cluster config received"
[23:39:28.349][ApiProxy       ][Info   ] get_ip returned {192.168.65.3}
[23:39:28.349][VpnKit         ][Info   ] vpnkit.exe: Using protocol TwoThousand msize 16384

[23:39:28.350][ApiProxy       ][Info   ] Expose tcp:0.0.0.0:6445:tcp:192.168.65.3:6443
[23:39:28.351][ApiProxy       ][Info   ] Failed to walk to [tcp:0.0.0.0:6445:tcp:192.168.65.3:6443] 9p: file not found
[23:39:28.380][ApiProxy       ][Info   ] Expose tcp:0.0.0.0:6445:tcp:192.168.65.3:6443: succeeded with tcp:0.0.0.0:6445:tcp:192.168.65.3:6443
[23:39:29.406][ApiProxy       ][Info   ] time="2019-03-26T23:39:29+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:30.387][ApiProxy       ][Info   ] time="2019-03-26T23:39:30+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:30.869][VpnKit         ][Info   ] vpnkit.exe: Connected Ethernet interface f6:16:36:bc:f9:c6

[23:39:30.869][VpnKit         ][Info   ] vpnkit.exe: UDP interface connected on 192.168.65.1

[23:39:30.923][VpnKit         ][Info   ] vpnkit.exe: Connected Ethernet interface f6:16:36:bc:f9:c6

[23:39:30.923][VpnKit         ][Info   ] vpnkit.exe: UDP interface connected on 108.177.125.82

[23:39:31.385][ApiProxy       ][Info   ] time="2019-03-26T23:39:31+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:32.385][ApiProxy       ][Info   ] time="2019-03-26T23:39:32+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:33.389][ApiProxy       ][Info   ] time="2019-03-26T23:39:33+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:34.386][ApiProxy       ][Info   ] time="2019-03-26T23:39:34+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:35.391][ApiProxy       ][Info   ] time="2019-03-26T23:39:35+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:36.388][ApiProxy       ][Info   ] time="2019-03-26T23:39:36+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:37.385][ApiProxy       ][Info   ] time="2019-03-26T23:39:37+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:38.385][ApiProxy       ][Info   ] time="2019-03-26T23:39:38+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:39.389][ApiProxy       ][Info   ] time="2019-03-26T23:39:39+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:40.387][ApiProxy       ][Info   ] time="2019-03-26T23:39:40+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:41.385][ApiProxy       ][Info   ] time="2019-03-26T23:39:41+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:42.384][ApiProxy       ][Info   ] time="2019-03-26T23:39:42+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:43.389][ApiProxy       ][Info   ] time="2019-03-26T23:39:43+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:44.389][ApiProxy       ][Info   ] time="2019-03-26T23:39:44+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:45.387][ApiProxy       ][Info   ] time="2019-03-26T23:39:45+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:46.389][ApiProxy       ][Info   ] time="2019-03-26T23:39:46+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:47.386][ApiProxy       ][Info   ] time="2019-03-26T23:39:47+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:47.907][SegmentApi     ][Info   ] Usage statistic: actionMenuFeedback
[23:39:47.963][NamedPipeClient][Info   ] Sending Version()...
[23:39:47.965][NamedPipeClient][Info   ] Received response for Version
[23:39:47.965][NamedPipeClient][Info   ] Sending GatherDiagnostics(-path C:\Users\liu.zhangshu\AppData\Local\Temp\ gather -id 1F18E3CE-D1CA-435A-A28D-C494875EDE9C/20190326233947, C:\Users\liu.zhangshu\AppData\Local\Temp\1F18E3CE-D1CA-435A-A28D-C494875EDE9C/20190326233947.zip)...
[23:39:47.965][NamedPipeServer][Info   ] Version()
[23:39:47.965][NamedPipeServer][Info   ] Version done in 00:00:00.
[23:39:47.966][NamedPipeServer][Info   ] GatherDiagnostics(-path C:\Users\liu.zhangshu\AppData\Local\Temp\ gather -id 1F18E3CE-D1CA-435A-A28D-C494875EDE9C/20190326233947, C:\Users\liu.zhangshu\AppData\Local\Temp\1F18E3CE-D1CA-435A-A28D-C494875EDE9C/20190326233947.zip)
[23:39:48.385][ApiProxy       ][Info   ] time="2019-03-26T23:39:48+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:49.385][ApiProxy       ][Info   ] time="2019-03-26T23:39:49+08:00" msg="Cannot list nodes: Get https://localhost:6445/api/v1/nodes: EOF"
[23:39:49.459][FeedbackWindow ][Info   ] Open logs

Kubernetes is always starting...

macOS 10.14.6

屏幕快照 2019-09-10 上午9 31 09

2019-09-10 09:27:59.947570+0800  localhost com.docker.driver.amd64-linux[864]: (libsystem_info.dylib) [com.apple.network.libinfo:getaddrinfo] nat64_v4_requires_synthesis(127.0.0.1) == false
2019-09-10 09:28:00.947981+0800  localhost com.docker.driver.amd64-linux[864]: (libsystem_info.dylib) [com.apple.network.libinfo:getaddrinfo] nat64_v4_requires_synthesis(127.0.0.1) == false
2019-09-10 09:28:01.947089+0800  localhost com.docker.driver.amd64-linux[864]: (libsystem_info.dylib) [com.apple.network.libinfo:getaddrinfo] nat64_v4_requires_synthesis(127.0.0.1) == false
2019-09-10 09:28:02.950933+0800  localhost com.docker.driver.amd64-linux[864]: (libsystem_info.dylib) [com.apple.network.libinfo:getaddrinfo] nat64_v4_requires_synthesis(127.0.0.1) == false
2019-09-10 09:28:03.947908+0800  localhost com.docker.driver.amd64-linux[864]: (libsystem_info.dylib) [com.apple.network.libinfo:getaddrinfo] nat64_v4_requires_synthesis(127.0.0.1) == false
2019-09-10 09:28:04.945991+0800  localhost com.docker.driver.amd64-linux[864]: (libsystem_info.dylib) [com.apple.network.libinfo:getaddrinfo] nat64_v4_requires_synthesis(127.0.0.1) == false
2019-09-10 09:28:05.948405+0800  localhost com.docker.driver.amd64-linux[864]: (libsystem_info.dylib) [com.apple.network.libinfo:getaddrinfo] nat64_v4_requires_synthesis(127.0.0.1) == false
2019-09-10 09:28:06.947051+0800  localhost com.docker.driver.amd64-linux[864]: (libsystem_info.dylib) [com.apple.network.libinfo:getaddrinfo] nat64_v4_requires_synthesis(127.0.0.1) == false

之前安装成功了,但在Docker Desktop自动更新完成后,就一直报这个错误,麻烦请问一下,这个问题怎么解决啊?

谢谢了!

怎么准确得到各版本dockerCE依赖的k8s版本

怎么得到各版本dockerCE依赖的k8s版本,包含其他的依赖?
比如 pause etcd 等?
谢谢

k8s.gcr.io/pause-amd64:3.1=registry.cn-hangzhou.aliyuncs.com/google_containers/pause-amd64:3.1
k8s.gcr.io/kube-controller-manager-amd64:v1.14.8=registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager-amd64:v1.14.8
k8s.gcr.io/kube-scheduler-amd64:v1.14.8=registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler-amd64:v1.14.8
k8s.gcr.io/kube-proxy-amd64:v1.14.8=registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy-amd64:v1.14.8
k8s.gcr.io/kube-apiserver-amd64:v1.14.8=registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver-amd64:v1.14.8
k8s.gcr.io/etcd-amd64:3.1.12=registry.cn-hangzhou.aliyuncs.com/google_containers/etcd-amd64:3.1.12
k8s.gcr.io/k8s-dns-sidecar-amd64:1.14.8=registry.cn-hangzhou.aliyuncs.com/google_containers/k8s-dns-sidecar-amd64:1.14.8
k8s.gcr.io/k8s-dns-kube-dns-amd64:1.14.8=registry.cn-hangzhou.aliyuncs.com/google_containers/k8s-dns-kube-dns-amd64:1.14.8
k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64:1.14.8=registry.cn-hangzhou.aliyuncs.com/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.8
k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1=registry.cn-hangzhou.aliyuncs.com/google_containers/kubernetes-dashboard-amd64:v1.10.1
quay.io/coreos/hyperkube:v1.7.6_coreos.0=registry.cn-hangzhou.aliyuncs.com/coreos_containers/hyperkube:v1.7.6_coreos.0
quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.21.0=registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller:0.21.0

如何添加node节点

如何将其他机器上安装的Docker DeskTop作为node添加到这个K8s来做统一管理?

Cannot list nodes: Get https://localhost:6443/api/v1/nodes: EOF

2019-06-11 18:22:47.246242+0800 localhost com.docker.driver.amd64-linux[22898]: Cannot list nodes: Get https://localhost:6443/api/v1/nodes: EOF
2019-06-11 18:22:48.141257+0800 localhost com.docker.driver.amd64-linux[22898]: (libsystem_network.dylib) [com.apple.network:] sa_dst_compare_statistics not prefering 1, dst1 min rtt 0.218750 < dst2 min rtt 0.875000, leeway 100 small leeway 10
2019-06-11 18:22:48.141296+0800 localhost com.docker.driver.amd64-linux[22898]: (libsystem_network.dylib) [com.apple.network:] sa_dst_compare_rfc6724 Rule 6, prefer d2, d2 precedence 50 > d1 precedence 35
2019-06-11 18:22:48.141334+0800 localhost com.docker.driver.amd64-linux[22898]: (libsystem_network.dylib) [com.apple.network:] sa_dst_compare_internal 127.0.0.1:0@0 < ::1.0@0
2019-06-11 18:22:48.142775+0800 localhost com.docker.driver.amd64-linux[22898]: Cannot list nodes: Get https://localhost:6443/api/v1/nodes: EOF

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.