Pull image from and connect to the ACS Engine Kubernetes Cluster

帅比萌擦擦* 提交于 2019-12-12 05:36:38

问题


For my current environment, I have created one mater and several agents (windows containers). Here comes the questions:

  1. When ssh into the master, I tried to pull image but turned out failed with this phenomenon. May I know how can I pull the image successfully? 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. What are the steps required to connect to the Windows Node??


回答1:


May I know how can I pull the image successfully?

You are using docker on Linux command line to pull windows image. As we know, container about Linux and windows are different. The problem is that you are not running the server as windows/amd, so system will return unknown blob.

According to your description, you have deploy ACS on Azure with windows nodes. Kubernetes is a tool which use to manage containers, so we can use k8s to deploy IIS to windows nodes.
1.create iis.json file, like this:

{
 "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.use kubctl apply command to create pods, like this:

kubectl apply -f iis.json

More information about how to use k8s to deploy a windows IIS container, please refer to this link.

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

By default, we should not to login those nodes, we should manage containers via kubernetes, so Azure create nodes without public IP addresses.

If you want to connect k8s node and deploy IIS container on it, we can deploy a point-to-site VPN between local PC and Azure vnet. But I wouldn't recommend it, because in this way, we just use k8s cluster work as a single VM, and container work will have no HA, if container down, k8s cluster will not create another one to keep the available.



来源:https://stackoverflow.com/questions/45138558/pull-image-from-and-connect-to-the-acs-engine-kubernetes-cluster

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!