0
respostas

HPA com falha ao ler a utilização da CPU (Windows 10)

Dois problemas na verdade: 1 - Ao descrever o HPA havia o erro:

Warning FailedComputeMetricsReplicas 2m52s (x13 over 14m) horizontal-pod-autoscaler invalid metrics (1 invalid out of 1), first error is: failed to get cpu utilization: missing request for cpu Warning FailedGetResourceMetric 112s (x14 over 14m) horizontal-pod-autoscaler missing request for cpu

2- Após apagar o portal noticias deployment, percebi que os PODs eram criados mas não iniciados. Ficam com status running mas não estão executando (Ready 0) .

$ kubectl get pods

NAME                                                                         READY   STATUS    RESTARTS   AGE
db-noticias-deployment-6cd68d9d78-xk5w7              1/1     Running   4          7d
portal-noticias-deployment-5989d485c-b65dn           0/1     Running   0          7m44s
portal-noticias-deployment-5989d485c-bl7k2           0/1     Running   0          7m44s
portal-noticias-deployment-5989d485c-f6dsh           0/1     Running   0          7m44s
sistema-noticias-statefulset-0                                   1/1     Running   1          24h

$ kubectl describe pod portal-noticias-deployment-5989d485c-b65dn Name: portal-noticias-deployment-5989d485c-b65dn Namespace: default Priority: 0 Node: docker-desktop/192.168.65.4 Start Time: Tue, 27 Apr 2021 08:28:24 -0300 Labels: app=portal-noticias pod-template-hash=5989d485c Annotations: Status: Running IP: 10.1.0.205 IPs: IP: 10.1.0.205 Controlled By: ReplicaSet/portal-noticias-deployment-5989d485c Containers: portal-noticias-containers: Container ID: docker://6acaaf8ca7c8f2b1ddb235d48c114ec1f4cf17760b6b2a46264caf31258ae3d2 Image: aluracursos/portal-noticias:1 Image ID: docker-pullable://aluracursos/portal-noticias@sha256:c1f4e01ee56e948ea9b420ded272d3440b9d45afb5d7ba1c389e79487edfeec0 Port: 80/TCP Host Port: 0/TCP State: Running Started: Tue, 27 Apr 2021

$ kubectl describe deployment portal-noticias-deployment Name: portal-noticias-deployment Namespace: default CreationTimestamp: Tue, 27 Apr 2021 08:17:50 -0300 Labels: Annotations: deployment.kubernetes.io/revision: 1 Selector: app=portal-noticias Replicas: 3 desired | 3 updated | 3 total | 0 available | 3 unavailable