Setting custom script extension in virtual machine scale set is changing the status of instances to NotReady.

Soumya S 1 Reputation point

I have set custom script extension using az command az vmss extension set --publisher Microsoft.Azure.Extensions --version 2.0 --name CustomScript --resource-group resource_group_name --vmss-name vmss_name --settings @./customConfig.json


"fileUris": ["publiclinkoffile"],
"commandToExecute": "./filename"

Extension is set successfully and I can log into the instance and task by extension is done as expected. But unable to create any pod since the instance status is NotReady.
It can be viewed by executing command: $kubectl get nodes

By further debugging I got to know that kubelet and kubectl services are inactive(dead).I suspect this is because internally while checking health the expected path should be /usr/local/bin/kubectl But it is unable to find kubectl in /usr/local/bin path . The reason for this is after executing custom script extension many versions of kubelet and kubectl are being created .

**After Extension set:**

**Before Extension set:**

How can avoid creating multiple versions of kubelet and kubectl so that My instance will be healthy?

NOTE: I am able to see the status of instance as Running in the Azure portal. I am able to view scaled instances only in the Azure portal but not by the command (kubectl get nodes).
Unable to figure it out! Can anyone help me

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,382 questions
Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
358 questions
{count} votes