containers-roadmap icon indicating copy to clipboard operation
containers-roadmap copied to clipboard

[EKS][Windows] Pod stuck in ContainerCreating status

Open pnandigam opened this issue 7 years ago • 3 comments

  1. deployed an IIS webserver to a windows Node.

  2. Triggered a Scale up event (increasing the replica set to 10) to test cluster autoscaler.

  3. A new Windows node got spun up and scaling up worked.

  4. Triggered scale down event (Decreased replicaset to 1)

  5. The pods were terminated and only one pod was left. The 2nd windows node was terminated after sometime.

  6. Executed "kubectl get pods --all-namespaces" and noticed that the pod on the windows node was in error state default windows-server-iis-7dcfc7c79b-zg57p 0/1 ContainerCreating 0 1h

  7. I checked everything per this issue https://github.com/aws/containers-roadmap/issues/227

  • configmap is ok
  • kube-proxy service is running
  • Get-HNSPolicyList returned data and did not show any errors

pnandigam avatar May 30 '19 23:05 pnandigam

Can you send us pod logs as well as describe the pod and send us the information?

  1. kubectl describe pod <>
  2. kubectl logs pod <>

somujay avatar Jun 05 '19 15:06 somujay

@somujay AWS support responded to my issue and the following is what they had to say. That solution has fixed the issue

From the supplied vpc-resource-controller log, the below is of interest:

============================================= Log Snippet Start ============================================= ... I0530 22:01:07.232304 1 watcher.go:247] Pod watcher processing deleted pod windows-server-iis-7dcfc7c79b-b6zf5 on node ip-10-60-21-137.ec2.internal. I0530 22:01:07.232412 1 manager.go:279] Node manager freed resource vpc.amazonaws.com/PrivateIPv4Address 10.60.24.20 on node ip-10-60-21-137.ec2.internal for pod windows-server-iis-7dcfc7c79b-b6zf5, pool &{Capacity:9 InUse:map[10.60.25.199:windows-server-iis-7dcfc7c79b-vm9jw 10.60.24.193:windows-server-iis-7dcfc7c79b-crr57 10.60.17.76:windows-server-iis-7dcfc7c79b-67x2g 10.60.21.137:node] Warm:[10.60.26.201 10.60.25.164 10.60.20.183 10.60.24.35 10.60.24.20] Pending:0}. I0530 22:01:07.273343 1 reconciler.go:102] Reconciler worker 2 starting processing node ip-10-60-21-137.ec2.internal. I0530 22:01:07.273360 1 reconciler.go:123] Reconciler checking resource vpc.amazonaws.com/ENI warmpool size 0 desired 0 on node ip-10-60-21-137.ec2.internal. I0530 22:01:07.273366 1 reconciler.go:123] Reconciler checking resource vpc.amazonaws.com/PrivateIPv4Address warmpool size 5 desired 3 on node ip-10-60-21-137.ec2.internal. I0530 22:01:07.273372 1 reconciler.go:169] Reconciler deleting resource vpc.amazonaws.com/PrivateIPv4Address 10.60.26.201 on node ip-10-60-21-137.ec2.internal. I0530 22:01:07.273394 1 eniwrapper.go:213] Unassigning private IPv4 addresses [10.60.26.201] from eni-01d96ae7fcbed846c. I0530 22:01:07.326085 1 eniwrapper.go:232] Unable to unassign private IPv4 addresses on eni-01d96ae7fcbed846c yet (attempt 1/10): UnauthorizedOperation: You are not authorized to perform this operation. status code: 403, request id: d24fc01a-b980-42b6-b888-74536f5fb6fd I0530 22:01:17.380878 1 eniwrapper.go:232] Unable to unassign private IPv4 addresses on eni-01d96ae7fcbed846c yet (attempt 2/10): UnauthorizedOperation: You are not authorized to perform this operation. status code: 403, request id: 5fcdecf6-70ac-4aa8-a19f-e2bc2efb0838 ... ============================================= Log Snippet End =============================================

From the logs it is evident that permission(s) are missing resulting in HTTP 403 error, which does not allow IPV4 address to be unassigned from the ENI. vpc-resource-controller runs of the linux node and thus it would suggest the NodeInstanceRole (arn:aws:iam::237461392503:role/win-eks-linux-node-role) has missing permissions and upon comparing with the NodeInstanceRole created by CloudFormation here [1], the following permission seems to be missing.

============================================= EKS Windows Unassign Private IP Policy Start ============================================= { "Version": "2012-10-17", "Statement": [ { "Action": "ec2:UnassignPrivateIpAddresses", "Resource": "*", "Effect": "Allow" } ] } ============================================= EKS Windows Unassign Private IP Policy End =============================================

pnandigam avatar Jun 06 '19 20:06 pnandigam

@pnandigam The windows quick start template explicitly performs this step.

vsiddharth avatar Jun 06 '19 21:06 vsiddharth