简体   繁体   中英

Azure container service not creating the agent nodes

I have been working on the deployment of windows container from Azure Container Registry to Azure Container Service with Kubernetes Orchestra it was working fine previously. Now I'm trying to create an acs kubernetes cluster of windows but the create command is only creating a master node and while deploying I'm getting the following error No nodes are available that match all of the following predicates:: MatchNodeSelector (1)

I have followed this link https://docs.microsoft.com/en-us/azure/container-service/kubernetes/container-service-kubernetes-windows-walkthrough to create the windows based kubernetes cluster.

This is the command I have used to create the cluster

az acs create --orchestrator-type=kubernetes \
    --resource-group myResourceGroup \
    --name=myK8sCluster \
    --agent-count=2 \
    --generate-ssh-keys \
    --windows --admin-username azureuser \
    --admin-password myPassword12

As per the above documentation, the above command should create a cluster named myK8sCluster with one Linux master node and two Windows agent nodes.

To verify the creation of cluster I have used the below command

kubectl get nodes

NAME                    STATUS  AGE       VERSION
k8s-master-98dc3136-0   Ready   5m        v1.7.7

According to the above command, it shows that it created only the Linux master node, not the two windows agent nodes.

But in my case I require the windows agent nodes to deploy a windows based container in the cluster.

So I assume that due this I'm getting the following error while deploying No nodes are available that match all of the following predicates:: MatchNodeSelector (1)

As the documentation points out, ACS with a target of Kubernetes is deprecated. You want to use AKS (Azure Kubernetes as a Service).

To go about this, start here: https://docs.microsoft.com/en-us/azure/aks/windows-container-cli

Make sure you have the latest version of the CLI installed on your machine if you choose to do it locally, or use the Azure Cloud Shell .

Follow the guide on the rest of the steps as it will walk you through the commands.

For your issue, as I know the possible reason is that you need to enable the WindowsPreview feather. You can have a check through the CLI command like this:

az feature list -o table --query "[?contains(name, 'Microsoft.ContainerService/WindowsPreview')].{Name:name,State:properties.state}"

When it's OK, you also need to pay attention to the Kubernetes version. When I use the command that you have used, then the windows nodes are created successfully, but it just shows the master when I execute the command kubectl get nodes . Even if I can see the windows node in the group.

Then I try the command with additional parameter --orchestrator-version and set the value as 1.12.7 and the whole command like below:

az acs create --orchestrator-type=kubernetes \
    --resource-group myResourceGroup \
    --name=myK8sCluster \
    --agent-count=2 \
    --generate-ssh-keys \
    --windows --admin-username azureuser \
    --admin-password myPassword12 \
    --orchestrator-version \
    --location westcentralus

Then it works well and the command kubectl get nodes -o wide show like below:

在此处输入图片说明

But as you know, the ACS will be deprecated. So I would suggest you use the AKS with Windows node in the preview version. Or you can use the aks-engine as the AKS Engine is the next version of the ACS-Engine project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM