从 ACS 引擎 Kubernetes 集群拉取镜像并连接到该集群

Pull image from and connect to the ACS Engine Kubernetes Cluster

对于我当前的环境,我创建了一个母体和多个代理(windows 个容器)。 问题来了:

  1. ssh进入master后,尝试拉取镜像失败,出现这种现象。请问如何才能成功拉取镜像? azureuser@k8s-master-0000000-0:~$ docker pull microsoft/iis Using default tag: latest latest: Pulling from microsoft/iis 3889bb8d808b: Retrying in 1 second e29afd68a947: Downloading 4c670d580638: Download complete d9f92ede2908: Download complete ad1e133a7ea1: Download complete e0a8179d5f31: Download complete unknown blob

  2. 连接到 Windows 节点需要哪些步骤??

May I know how can I pull the image successfully?

您正在 Linux 命令行上使用 docker 来拉取 windows 图像。正如我们所知,关于Linux和windows的容器是不同的。问题是你不是 运行 作为 windows/amd 的服务器,所以系统将 return unknown blob.

根据您的描述,您已经在 Azure 上部署了具有 windows 个节点的 ACS。 Kubernetes 是一个用来管理容器的工具,因此我们可以使用 k8s 将 IIS 部署到 windows 个节点。
1.create iis.json 文件,像这样:

{
 "apiVersion": "v1",
 "kind": "Pod",
 "metadata": {
   "name": "iis",
   "labels": {
     "name": "iis"
   }
 },
 "spec": {
   "containers": [
     {
       "name": "iis",
       "image": "nanoserver/iis",
       "ports": [
         {
         "containerPort": 80
         }
       ]
     }
   ],
   "nodeSelector": {
    "beta.kubernetes.io/os": "windows"
    }
  }
}

2.usekubctl apply命令创建pods,像这样:

kubectl apply -f iis.json

更多关于如何使用k8s部署windows IIS容器,请参考这篇link

What are the steps required to connect to the Windows Node??

默认情况下,我们应该登录这些节点,我们应该通过kubernetes管理容器,所以Azure创建没有public IP地址的节点。

如果你想连接k8s节点并在其上部署IIS容器,我们可以在本地PC和Azure vnet之间部署一个点到站点VPN。但我不推荐它,因为这样,我们只是将 k8s 集群作为单个 VM 使用,而容器工作将没有 HA,如果容器宕机,k8s 集群将不会创建另一个来保持可用。