aks-engine icon indicating copy to clipboard operation
aks-engine copied to clipboard

Custom VMSS worker images fail to register with masters when using 0.38.1 and 0.37.5

Open PacoGuy opened this issue 7 years ago • 26 comments

Describe the bug When using aks-engine version v0.38.1 & v0.37.5 with a VMSS agent pool specifying a custom image the deployment succeeds but the nodes never register with the master or show as available. The exact same cluster definition works with v0.34.0 as tested today.

Steps To Reproduce

{
  "apiVersion": "vlabs",
  "properties": {
    "orchestratorProfile": {
      "orchestratorType": "Kubernetes",
      "orchestratorVersion": "1.13.5",
      "kubernetesConfig": {
        "networkPolicy": "azure",
        "apiServerConfig": {
          "--enable-admission-plugins":"NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota",
          "--requestheader-allowed-names":"aggregator",
          "--authorization-mode": "Node,RBAC"
        },
        "controllerManagerConfig": {
          "--horizontal-pod-autoscaler-use-rest-clients":"true",
          "--horizontal-pod-autoscaler-sync-period":"1s"
        },
        "kubeletConfig": {
          "--max-pods": "40",
          "--eviction-hard": "memory.available<750Mi,nodefs.available<10%,nodefs.inodesFree<5%"
        },
        "schedulerConfig": {
	  "--feature-gates": "PodPriority=false"
	},
        "useInstanceMetadata": true,
        "privateCluster": {
          "enabled": true
      	},
        "addons": [
          {
            "name": "cluster-autoscaler",
            "enabled": true,
            "config": {
              "min-nodes": "7",
              "max-nodes": "15",
              "scan-interval": "60s"
            }
          }
        ]
       }
    },
    "masterProfile": {
      "count": 1,
      "dnsPrefix": "****",
      "vmSize": "Standard_D8_v3",
      "ipAddressCount": 44,
      "vnetSubnetId": "/subscriptions/****/resourceGroups/****/providers/Microsoft.Network/virtualNetworks/****/subnets/****",
      "firstConsecutiveStaticIP": "10.xxx.xxx.xxx",
      "OSDiskSizeGB": 300,
      "vnetCidr": "10.xxx.xxx.xxx/22"
    },
    "agentPoolProfiles": [
      {
        "name": "agentpool1",
        "count": 7,
        "ipAddressCount": 44,
        "imageReference": {
          "name": "k8sNodeImage****",
          "resourceGroup": "****"
        },
        "vmSize": "Standard_D8s_v3",
        "vnetSubnetId": "/subscriptions/****/resourceGroups/****/providers/Microsoft.Network/virtualNetworks/****/subnets/****",
        "storageProfile" : "ManagedDisks",
        "availabilityProfile": "VirtualMachineScaleSets",
        "customNodeLabels": {
          "role_a": "all",
          "role_b": "all"
        },
        "OSDiskSizeGB": 1023
      }
    ],
    "linuxProfile": {
      "adminUsername": "azuser",
      "ssh": {
        "publicKeys": [
          {
            "keyData": "****"
          }
        ]
      }
    },
    "servicePrincipalProfile": {
      "clientId": "****",
      "secret": "****"
    }
  }
}

Expected behavior The VMSS nodes should register properly with the master nodes and be in a Ready state.

AKS Engine version Failing in v0.38.1 & v0.37.5 Working in v0.34.0

Kubernetes version 13.5

Additional context With aks-engine version 0.38.1 & 0.37.5:

$ kubectl get nodes
NAME                    STATUS    ROLES     AGE       VERSION
k8s-master-32831985-0   Ready     master    4m19s     v1.13.5

With aks-engine version 0.34.0

$ kubectl get nodes
NAME                                 STATUS    ROLES     AGE       VERSION
k8s-agentpool1-********-vmss000000   Ready     agent     57m       v1.13.5
k8s-agentpool1-********-vmss000001   Ready     agent     58m       v1.13.5
k8s-agentpool1-********-vmss000002   Ready     agent     58m       v1.13.5
k8s-agentpool1-********-vmss000003   Ready     agent     58m       v1.13.5
k8s-agentpool1-********-vmss000004   Ready     agent     58m       v1.13.5
k8s-agentpool1-********-vmss000005   Ready     agent     58m       v1.13.5
k8s-agentpool1-********-vmss000006   Ready     agent     58m       v1.13.5
k8s-master-********-0                Ready     master    58m       v1.13.5

The image used is created using the same config provided above with 1 master/1 agent pool node, no "imageReference", no cluster-autoscaler addon and an availabilty set.

After the 1 master/1 agent pool cluster is running the agent pool node is connected to:

azuser@k8s-agentpool1-32016089-0:~$ sudo waagent -deprovision+user -force
WARNING! The waagent service will be stopped.
WARNING! Cached DHCP leases will be deleted.
WARNING! root password will be disabled. You will not be able to login as root.
WARNING! /etc/resolvconf/resolv.conf.d/tail and /etc/resolvconf/resolv.conf.d/original will be deleted.
WARNING! azuser account and entire home directory will be deleted.
azuser@k8s-agentpool1-32016089-0:~$ exit

then

$ az vm deallocate --resource-group ****    --name k8s-agentpool1-****-0
$ az vm generalize --resource-group **** --name k8s-agentpool1-****-0
$ az image create --resource-group **** --name k8sNodeImage**** --source k8s-agentpool1-****-0

PacoGuy avatar Jul 11 '19 21:07 PacoGuy

@PacoGuy does the same thing repro with v0.37.4 and v0.38.0?

CecileRobertMichon avatar Jul 11 '19 21:07 CecileRobertMichon

Unfortunately yes, when tested earlier this week with the image created on Sunday. I had waited to submit this ticket until the base image had been updated and hotfix releases published today.

Do you need me to test again with this specific image?

On Thu, Jul 11, 2019, 4:25 PM Cecile Robert-Michon [email protected] wrote:

@PacoGuy https://github.com/PacoGuy does the same thing repro with v0.37.4 and v0.38.0?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Azure/aks-engine/issues/1612?email_source=notifications&email_token=AAFQOQQQ6F6GPQ4FEGKQLQTP66QNLA5CNFSM4IBVP7B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZYA2MY#issuecomment-510659891, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFQOQUSWEYYHO7IWICPTI3P66QNLANCNFSM4IBVP7BQ .

PacoGuy avatar Jul 11 '19 21:07 PacoGuy

I just wanted to make sure this wasn't a regression we introduced as part of the patch... if it's reproducible on other versions that's still worrisome but it's a separate issue.

When you say "until the base image was updated" what do you mean exactly? If you're using a custom image for the agents you aren't using our base image (only for the master), or am I misunderstanding?

CecileRobertMichon avatar Jul 11 '19 21:07 CecileRobertMichon

From my testing it seems like a regression which was introduced between v0.34.0 and now.

I am using the base image for the master and a custom image for the agents only. That custom image was created off of the base image via the steps here https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image which has worked for over a year for us.

My reference to "until the base image was updated" was to https://github.com/Azure/aks-engine/issues/1580 because that caused our deployment to fail on Monday. I created the new image to avoid the clear-container repo key issue.

PacoGuy avatar Jul 11 '19 21:07 PacoGuy

Here's the definition used to create the image:

{
  "apiVersion": "vlabs",
  "properties": {
    "orchestratorProfile": {
      "orchestratorType": "Kubernetes",
      "orchestratorVersion": "1.13.5",
      "kubernetesConfig": {
        "networkPolicy": "azure",
        "apiServerConfig": {
          "--enable-admission-plugins":"NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota",
          "--requestheader-allowed-names":"aggregator",
          "--authorization-mode": "Node,RBAC"
        },
        "controllerManagerConfig": {
          "--horizontal-pod-autoscaler-use-rest-clients":"true",
          "--horizontal-pod-autoscaler-sync-period":"1s"
        },
        "kubeletConfig": {
          "--max-pods": "40",
          "--eviction-hard": "memory.available<750Mi,nodefs.available<10%,nodefs.inodesFree<5%"
        },
        "schedulerConfig": {
	  "--feature-gates": "PodPriority=false"
	},
        "useInstanceMetadata": true,
        "privateCluster": {
          "enabled": true
      	}
       }
    },
    "masterProfile": {
      "count": 1,
      "dnsPrefix": "****",
      "vmSize": "Standard_D8_v3",
      "ipAddressCount": 44,
      "vnetSubnetId": "/subscriptions/****/resourceGroups/****/providers/Microsoft.Network/virtualNetworks/****/subnets/****",
      "firstConsecutiveStaticIP": "****",
      "OSDiskSizeGB": 128,
      "vnetCidr": "****/22"
    },
    "agentPoolProfiles": [
      {
        "name": "agentpool1",
        "count": 1,
        "ipAddressCount": 44,
        "vmSize": "Standard_D8s_v3",
        "vnetSubnetId": "/subscriptions/****/resourceGroups/****/providers/Microsoft.Network/virtualNetworks/****/subnets/****",
        "storageProfile" : "ManagedDisks",
        "availabilityProfile": "AvailabilitySet",
        "customNodeLabels": {
          "role_worker": "all",
          "role_notebook": "all"
        },
        "OSDiskSizeGB": 1023
      }
    ],
    "linuxProfile": {
      "adminUsername": "azuser",
      "ssh": {
        "publicKeys": [
          {
            "keyData": "****"
          }
        ]
      }
    },
    "servicePrincipalProfile": {
      "clientId": "****",
      "secret": "****"
    }
  }
}

After the cluster is up we create the image as indicated above so that our image contains all of the required packages and configs from the base image.

PacoGuy avatar Jul 11 '19 21:07 PacoGuy

@CecileRobertMichon I just confirmed that the same missing agent results are found when using v0.36.5

PacoGuy avatar Jul 11 '19 22:07 PacoGuy

I see, thanks for explaining. Just out of curiosity, what's the need for building your own custom image based on an aks-engine VM using the AKS base image? Are there things missing on the image for your use case?

When you deploy with the broken versions, are the deployments successful? Any useful error messages in the Azure portal on the deployment blade? Could you please ssh into one of the agentpool VMs and check the logs in /var/log/azure/cluster-provision.log? What do these end with?

CecileRobertMichon avatar Jul 11 '19 22:07 CecileRobertMichon

Are there things missing on the image for your use case?

  • Yes, we need a newer version of the glusterfs package, install sysdig and also need to add the azure search domain (qm1k***********500cg.cx.internal.cloudapp.net) to /etc/resolvconf/resolv.conf.d/base due to our company's DNS configuration.

When you deploy with the broken versions, are the deployments successful? -Yes, Azure reports the deployment as successful. Since the deployment shows success there are not any useful messages to be found there.

Could you please ssh into one of the agentpool VMs and check the logs in /var/log/azure/cluster-provision.log? What do these end with?

  • I'm provisioning with v0.38.1 again and will report here shortly. With that cluster deployed I can also check any other required logs.

PacoGuy avatar Jul 11 '19 22:07 PacoGuy

Could you please ssh into one of the agentpool VMs and check the logs in /var/log/azure/cluster-provision.log? What do these end with?

...
++ grep hyperkube
+ retrycmd_if_failure 120 5 25 apt-mark unhold walinuxagent
+ retries=120
+ wait_sleep=5
+ timeout=25
+ shift
+ shift
+ shift
++ seq 1 120
+ for i in '$(seq 1 $retries)'
+ timeout 25 apt-mark unhold walinuxagent
+ docker rmi
+ docker rmi
+ docker rmi
+ docker rmi
+ docker rmi
"docker rmi" requires at least 1 argument.
See 'docker rmi --help'.

Usage:  docker rmi [OPTIONS] IMAGE [IMAGE...]

Remove one or more images
"docker rmi" requires at least 1 argument.
See 'docker rmi --help'.

Usage:  docker rmi [OPTIONS] IMAGE [IMAGE...]

Remove one or more images
"docker rmi" requires at least 1 argument.
See 'docker rmi --help'.

Usage:  docker rmi [OPTIONS] IMAGE [IMAGE...]

Remove one or more images
"docker rmi" requires at least 1 argument.
See 'docker rmi --help'.

Usage:  docker rmi [OPTIONS] IMAGE [IMAGE...]

Remove one or more images
"docker rmi" requires at least 1 argument.
See 'docker rmi --help'.

Usage:  docker rmi [OPTIONS] IMAGE [IMAGE...]

Remove one or more images
dpkg: error: dpkg frontend is locked by another process
E: Sub-process dpkg --set-selections returned an error code (2)
E: Executing dpkg failed. Are you root?
+ '[' 1 -eq 120 ']'
+ sleep 5
+ for i in '$(seq 1 $retries)'
+ timeout 25 apt-mark unhold walinuxagent
Canceled hold on walinuxagent.
+ break
+ echo Executed '"apt-mark' unhold 'walinuxagent"' 2 times
Executed "apt-mark unhold walinuxagent" 2 times
azuser@k8s-agentpool1-31598640-vmss000000:~$

PacoGuy avatar Jul 11 '19 22:07 PacoGuy

Here's the entire log: cluster-provision.log

PacoGuy avatar Jul 11 '19 22:07 PacoGuy

@CecileRobertMichon Any other logs that I can provide?

PacoGuy avatar Jul 12 '19 18:07 PacoGuy

@PacoGuy I'm not seeing anything abnormal in the logs you sent me so not sure what's going on.

Could you please check the kubelet logs both on the master and on one of the nodes? sudo journalctl -u kubelet

CecileRobertMichon avatar Jul 15 '19 16:07 CecileRobertMichon

So, I had deleted that cluster for the weekend so can't get logs from that one. Today I provisioned a cluster via jenkins with the same config and the same deployer image with aks-engine v0.38.1 and it is working properly now. The two agent nodes I requested registered properly and show as ready via a kubectl get nodes. Since nothing on my end changed that I know of is there anything that could have been changed in either a CSE or azure itself? I'm having a hard time accounting for things that fail one day and work as expected the next so any insight into why this is working now is appreciated.

PacoGuy avatar Jul 15 '19 19:07 PacoGuy

Nothing changed that I know of on our side. If you are still using 0.38.1, CSE and the rest of the aks-engine provisioning code will be the same than it was last week since we don't change releases after they are out. I know it's not what you want to hear but it's hard to know what happened without a repro/logs. It's possible that this was a transient kubelet error.

I'm going to close this issue for now. If you do run into this again, please reopen it and we will investigate.

CecileRobertMichon avatar Jul 15 '19 20:07 CecileRobertMichon

Ok, the same issue happened again yesterday and I was able to reproduce again today using v0.38.1 @CecileRobertMichon. I even went so far as to use the same k8s.json locally from my laptop instead of our jenkins server with v0.38.2 (to confirm that there was nothing secondary in my automation which was interfering) but got the same results with no agents registered in kubernetes.

Version 0.34.0 created a functional cluster with no issues while using the same custom image.

Here's the end of the kubelet log from yesterday's agent node:

Jul 15 22:24:28 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:28.570151    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:28 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: I0715 22:24:28.636206    4352 certificate_manager.go:336] Rotating certificates
Jul 15 22:24:28 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:28.638074    4352 certificate_manager.go:348] Failed while requesting a signed certificate from the master: cannot create certificate signing request: Unauthorized
Jul 15 22:24:28 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:28.670327    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:28 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:28.770500    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:28 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:28.870677    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:28 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:28.970839    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:29 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:29.071115    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:29 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:29.171278    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:29 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:29.271446    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:29 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:29.300116    4352 reflector.go:125] k8s.io/kubernetes/pkg/kubelet/kubelet.go:453: Failed to list *v1.Node: Unauthorized
Jul 15 22:24:29 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:29.300813    4352 reflector.go:125] k8s.io/kubernetes/pkg/kubelet/kubelet.go:444: Failed to list *v1.Service: Unauthorized
Jul 15 22:24:29 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:29.302108    4352 reflector.go:125] k8s.io/kubernetes/pkg/kubelet/config/apiserver.go:47: Failed to list *v1.Pod: Unauthorized
Jul 15 22:24:29 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:29.371604    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:29 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:29.471827    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:29 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:29.572097    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:29 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:29.672333    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:29 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:29.772560    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:29 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:29.872721    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:29 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:29.972910    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:30.073180    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:30.173379    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:30.273618    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: I0715 22:24:30.296459    4352 kubelet_node_status.go:279] Setting node annotation to enable volume controller attach/detach
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: I0715 22:24:30.296511    4352 kubelet_node_status.go:327] Adding node label from cloud provider: beta.kubernetes.io/instance-type=Standard_D8s_v3
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: I0715 22:24:30.296521    4352 kubelet_node_status.go:338] Adding node label from cloud provider: failure-domain.beta.kubernetes.io/zone=0
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: I0715 22:24:30.296527    4352 kubelet_node_status.go:342] Adding node label from cloud provider: failure-domain.beta.kubernetes.io/region=eastus2
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:30.302102    4352 reflector.go:125] k8s.io/kubernetes/pkg/kubelet/kubelet.go:453: Failed to list *v1.Node: Unauthorized
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:30.302652    4352 reflector.go:125] k8s.io/kubernetes/pkg/kubelet/kubelet.go:444: Failed to list *v1.Service: Unauthorized
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:30.303951    4352 reflector.go:125] k8s.io/kubernetes/pkg/kubelet/config/apiserver.go:47: Failed to list *v1.Pod: Unauthorized
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: I0715 22:24:30.335575    4352 kubelet_node_status.go:447] Recording NodeHasSufficientMemory event message for node k8s-agentpool1-36296323-vmss000000
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: I0715 22:24:30.335616    4352 kubelet_node_status.go:447] Recording NodeHasNoDiskPressure event message for node k8s-agentpool1-36296323-vmss000000
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: I0715 22:24:30.335626    4352 kubelet_node_status.go:447] Recording NodeHasSufficientPID event message for node k8s-agentpool1-36296323-vmss000000
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: I0715 22:24:30.335645    4352 kubelet_node_status.go:72] Attempting to register node k8s-agentpool1-36296323-vmss000000
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:30.337309    4352 kubelet_node_status.go:94] Unable to register node "k8s-agentpool1-36296323-vmss000000" with API server: Unauthorized
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:30.337272    4352 event.go:203] Server rejected event '&v1.Event{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"k8s-agentpool1-36296323-vmss000000.15b1b4a533800305", 
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:30.373795    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:30.474006    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:30.574406    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found
Jul 15 22:24:30 k8s-agentpool1-36296323-vmss000000 kubelet[4352]: E0715 22:24:30.674583    4352 kubelet.go:2266] node "k8s-agentpool1-36296323-vmss000000" not found

And the entire kubelet log from both the master and agent are attached here as well. agent-k8s-agentpool1-36296323-vmss000000-kubelet.log master-k8s-master-36296323-0-kubelet.log

PacoGuy avatar Jul 16 '19 16:07 PacoGuy

Seeing E0715 22:28:22.058625 4352 kubelet_node_status.go:94] Unable to register node "k8s-agentpool1-36296323-vmss000000" with API server: Unauthorized

and F0715 22:18:35.670552 2835 server.go:261] failed to run Kubelet: unable to configure TLS for the rest client: tls: private key does not match public key

which points to certificate issues. Will try to dig into this more later today if time permits.

CecileRobertMichon avatar Jul 16 '19 17:07 CecileRobertMichon

I think i saw this before, I believe it's mainly network issue that master and agent nodes are not able to communicate with API server which at the end led to certificates creation issue. try to curl the kube-api-server endpoint from both master and agent pool, check the docker daemon logs, Azure CNI Plugin logs and kube-api-server pod logs

mo-saeed avatar Jul 16 '19 19:07 mo-saeed

Here's some more info and logs:

There are currently no running docker pods & no available logs:

user@k8s-agentpool1-89566682-vmss00000Y:/var/log$ docker ps -a
CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS                           PORTS               NAMES
68449592bd45        0b2e1d3bb948                 "/bin/install_blobfu…"   45 hours ago        Exited (255) About an hour ago                       k8s_blobfuse-flexvol-installer_blobfuse-flexvol-installer-pp79k_kube-system_41610b73-a740-11e9-9d87-000d3a7b1138_2
d6ede322ef05        a46851ab1823                 "/usr/bin/networkmon…"   45 hours ago        Exited (255) About an hour ago                       k8s_azure-cnms_azure-cni-networkmonitor-cbwsf_kube-system_430c1e8b-a740-11e9-9d87-000d3a7b1138_2
c11992613ffb        7740a148dcf0                 "/hyperkube kube-pro…"   45 hours ago        Exited (255) About an hour ago                       k8s_kube-proxy_kube-proxy-bb7fl_kube-system_41905e19-a740-11e9-9d87-000d3a7b1138_2
a0159765f1a7        k8s.gcr.io/pause-amd64:3.1   "/pause"                 45 hours ago        Exited (255) About an hour ago                       k8s_POD_azure-cni-networkmonitor-cbwsf_kube-system_430c1e8b-a740-11e9-9d87-000d3a7b1138_2
468bfb1dcba8        f46a6a71e92f                 "/ip-masq-agent"         45 hours ago        Exited (255) About an hour ago                       k8s_azure-ip-masq-agent_azure-ip-masq-agent-52g9g_kube-system_416fa303-a740-11e9-9d87-000d3a7b1138_2
926985d29fc4        k8s.gcr.io/pause-amd64:3.1   "/pause"                 45 hours ago        Exited (255) About an hour ago                       k8s_POD_kube-proxy-bb7fl_kube-system_41905e19-a740-11e9-9d87-000d3a7b1138_2
16ad1dcd0c09        ac5f7ee9ae7e                 "/tiller"                45 hours ago        Exited (255) About an hour ago                       k8s_tiller_tiller-deploy-74b7fb5bb9-4c4mj_kube-system_419c5182-a740-11e9-9d87-000d3a7b1138_2
978520f0ab33        k8s.gcr.io/pause-amd64:3.1   "/pause"                 45 hours ago        Exited (255) About an hour ago                       k8s_POD_blobfuse-flexvol-installer-pp79k_kube-system_41610b73-a740-11e9-9d87-000d3a7b1138_2
3484c82cbde9        5217f644174c                 "/bin/install_kv_fle…"   45 hours ago        Exited (255) About an hour ago                       k8s_keyvault-flexvolume_keyvault-flexvolume-v456f_kube-system_417259ad-a740-11e9-9d87-000d3a7b1138_2
847f46f973d2        7987f0908caf                 "/coredns -conf /etc…"   45 hours ago        Exited (255) About an hour ago                       k8s_coredns_coredns-5b6f59676b-9gfdk_kube-system_41666468-a740-11e9-9d87-000d3a7b1138_2
357c0bc135f0        k8s.gcr.io/pause-amd64:3.1   "/pause"                 45 hours ago        Exited (255) About an hour ago                       k8s_POD_azure-ip-masq-agent-52g9g_kube-system_416fa303-a740-11e9-9d87-000d3a7b1138_2
470d4638b984        k8s.gcr.io/pause-amd64:3.1   "/pause"                 45 hours ago        Exited (255) About an hour ago                       k8s_POD_tiller-deploy-74b7fb5bb9-4c4mj_kube-system_419c5182-a740-11e9-9d87-000d3a7b1138_2
49901e94fec3        k8s.gcr.io/pause-amd64:3.1   "/pause"                 45 hours ago        Exited (255) About an hour ago                       k8s_POD_coredns-5b6f59676b-9gfdk_kube-system_41666468-a740-11e9-9d87-000d3a7b1138_2
2ab8a85728a5        k8s.gcr.io/pause-amd64:3.1   "/pause"                 45 hours ago        Exited (255) About an hour ago                       k8s_POD_keyvault-flexvolume-v456f_kube-system_417259ad-a740-11e9-9d87-000d3a7b1138_2

From the agent node "user@k8s-agentpool1-89566682-vmss00000Y:/var/log$ cat warn":

Jul 17 17:23:31 k8s-agentpool1-89566682-vmss00000Y HV_FCOPY: open /dev/vmbus/hv_fcopy failed; error: 2 No such file or directory
Jul 17 17:23:31 k8s-agentpool1-89566682-vmss00000Y systemd[1]: hv-fcopy-daemon.service: Failed with result 'exit-code'.
Jul 17 17:23:31 k8s-agentpool1-89566682-vmss00000Y iscsid: iSCSI daemon with pid=1540 started!
Jul 17 17:23:39 k8s-agentpool1-89566682-vmss00000Y kernel: [   36.726057] mlx4_core 0001:00:02.0: Detected virtual function - running in slave mode
Jul 17 17:23:39 k8s-agentpool1-89566682-vmss00000Y kernel: [   36.726084] mlx4_core 0001:00:02.0: Sending reset
Jul 17 17:23:39 k8s-agentpool1-89566682-vmss00000Y kernel: [   36.726169] mlx4_core 0001:00:02.0: Sending vhcr0
Jul 17 17:23:39 k8s-agentpool1-89566682-vmss00000Y kernel: [   36.727790] mlx4_core 0001:00:02.0: HCA minimum page size:512
Jul 17 17:23:39 k8s-agentpool1-89566682-vmss00000Y kernel: [   36.728494] mlx4_core 0001:00:02.0: Timestamping is not supported in slave mode
Jul 17 17:23:39 k8s-agentpool1-89566682-vmss00000Y kernel: [   36.761029] ib_query_pkey failed (-1) for mlx4_0 (index 0)
Jul 17 17:23:39 k8s-agentpool1-89566682-vmss00000Y kernel: [   36.761860] mlx4_core 0001:00:02.0: mlx4_ib: multi-function enabled
Jul 17 17:23:39 k8s-agentpool1-89566682-vmss00000Y kernel: [   36.761861] mlx4_core 0001:00:02.0: mlx4_ib: operating in qp1 tunnel mode
Jul 17 17:23:40 k8s-agentpool1-89566682-vmss00000Y kernel: [   36.895622] mlx4_en: 0001:00:02.0: Port 1: Using 8 TX rings
Jul 17 17:23:40 k8s-agentpool1-89566682-vmss00000Y kernel: [   36.895623] mlx4_en: 0001:00:02.0: Port 1: Using 8 RX rings
Jul 17 17:23:40 k8s-agentpool1-89566682-vmss00000Y kernel: [   36.895754] mlx4_en: 0001:00:02.0: Port 1: Initializing port
Jul 17 17:23:45 k8s-agentpool1-89566682-vmss00000Y kernel: [   42.153340] kauditd_printk_skb: 3 callbacks suppressed
Jul 17 17:23:49 k8s-agentpool1-89566682-vmss00000Y systemd[1]: kubelet.service: Failed with result 'exit-code'.
Jul 17 17:23:50 k8s-agentpool1-89566682-vmss00000Y systemd[1]: kubelet.service: Failed with result 'exit-code'.
Jul 17 17:23:51 k8s-agentpool1-89566682-vmss00000Y systemd[1]: kubelet.service: Failed with result 'exit-code'.
Jul 17 17:23:51 k8s-agentpool1-89566682-vmss00000Y systemd[1]: kubelet.service: Failed with result 'exit-code'.
Jul 17 17:23:52 k8s-agentpool1-89566682-vmss00000Y systemd[1]: kubelet.service: Failed with result 'exit-code'.
Jul 17 17:23:53 k8s-agentpool1-89566682-vmss00000Y systemd[1]: kubelet.service: Failed with result 'exit-code'.
Jul 17 17:23:53 k8s-agentpool1-89566682-vmss00000Y systemd[1]: kubelet.service: Start request repeated too quickly.
Jul 17 17:23:53 k8s-agentpool1-89566682-vmss00000Y systemd[1]: Failed to start Kubelet.
Jul 17 17:23:53 k8s-agentpool1-89566682-vmss00000Y systemd[1]: kubelet.service: Failed with result 'start-limit-hit'.
Jul 17 17:24:30 k8s-agentpool1-89566682-vmss00000Y systemd-udevd[4322]: Could not generate persistent MAC address for veth3141f35: No such file or directory
Jul 17 17:24:30 k8s-agentpool1-89566682-vmss00000Y systemd-udevd[4321]: Could not generate persistent MAC address for veth218f3bd: No such file or directory
Jul 17 17:24:49 k8s-agentpool1-89566682-vmss00000Y rpc.statd[4781]: Flags: TI-RPC
Jul 17 17:39:01 k8s-agentpool1-89566682-vmss00000Y systemd-tmpfiles[10856]: [/usr/lib/tmpfiles.d/var.conf:14] Duplicate line for path "/var/log", ignoring.

Also I was able to grab the logs for the following before this node was deleted by the auto-scaler: azure-cnimonitor, azure-vnet, docker-journalctl

azure-cnimonitor-k8s-agentpool1-89566682-vmss00000Y.log azure-vnet-k8s-agentpool1-89566682-vmss00000Y.log docker-journalctl-k8s-agentpool1-89566682-vmss00000Y.log

PacoGuy avatar Jul 17 '19 19:07 PacoGuy

what is the output of kubectl get pods -n kube-system ?

mo-saeed avatar Jul 17 '19 19:07 mo-saeed

@PacoGuy can you try changing your kubeletConfig to the following:

  "kubeletConfig": {
    "--rotate-certificates": "false",
    "--max-pods": "40",
    "--eviction-hard": "memory.available<750Mi,nodefs.available<10%,nodefs.inodesFree<5%"
  },

devigned avatar Jul 17 '19 21:07 devigned