Skip to content

Kubernetes pod status doesn't reflect Fargate task status #17

@Jeffwan

Description

@Jeffwan

After I schedule two pods, pod status is changed to pending which is expected and after that, they were changed to ProviderFailed

➜ k get pods
NAME                                READY   STATUS    RESTARTS   AGE
nginx-deployment-568c9ff59d-hzj2z   0/1     Pending   0          3s
nginx-deployment-568c9ff59d-z5zdz   0/1     Pending   0          3s

➜ k get pods
NAME                                READY   STATUS           RESTARTS   AGE
nginx-deployment-568c9ff59d-hzj2z   0/1     ProviderFailed   0          7s
nginx-deployment-568c9ff59d-z5zdz   0/1     ProviderFailed   0          7s

The major reason is UpdatePod is not implemented.

aws-fargate/provider.go

Lines 129 to 132 in 3508966

func (p *FargateProvider) UpdatePod(ctx context.Context, pod *corev1.Pod) error {
log.Printf("Received UpdatePod request for %s/%s.\n", pod.Namespace, pod.Name)
return errNotImplemented
}

2021/01/24 16:28:27 Received GetPod request for default/nginx-deployment-568c9ff59d-hzj2z.
2021/01/24 16:28:27 Received GetPod request for default/nginx-deployment-568c9ff59d-z5zdz.
2021/01/24 16:28:27 Received UpdatePod request for default/nginx-deployment-568c9ff59d-hzj2z.
INFO[0074] Updated k8s pod status                        key=default/nginx-deployment-568c9ff59d-hzj2z method=createOrUpdatePod name=nginx-deployment-568c9ff59d-hzj2z namespace=default node=virtual-kubelet operatingSystem=Linux phase=Pending pod=nginx-deployment-568c9ff59d-hzj2z podPhase=Pending provider=aws reason=ProviderFailed uid=3c426899-01ed-41a0-85e0-f59071edb52f watchedNamespace= workerId=10
WARN[0074] requeuing [["default/nginx-deployment-568c9ff59d-hzj2z"]] due to failed sync  error="failed to sync pod \"default/nginx-deployment-568c9ff59d-hzj2z\" in the provider: not implemented by Fargate provider" key=default/nginx-deployment-568c9ff59d-hzj2z method=handleQueueItem node=virtual-kubelet operatingSystem=Linux provider=aws watchedNamespace= workerId=10

The status is not updated to Running even after Fargate task is ready.

image

Pod status needs to be fixed to reflect real Fargate task status.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions