I am facing this issue with istio 1.6.5 in aws EKS 1.16, istiod has this annotation
autoscaling.alpha.kubernetes.io/conditions: '[{"type":"AbleToScale","status":"True","lastTransitionTime":"2020-07-18T02:12:37Z","reason":"SucceededGetScale","message":"the
HPA controller was able to get the target''s current scale"},{"type":"ScalingActive","status":"False","lastTransitionTime":"2020-07-18T02:12:37Z","reason":"FailedGetResourceMetric","message":"the
HPA was unable to compute the replica count: unable to get metrics for resource
cpu: unable to fetch metrics from resource metrics API: the server could not
find the requested resource (get pods.metrics.k8s.io)"}]'
What am I doing wrong?
Here are the steps to reproduce:
istioctl version
client version: 1.6.5
control plane version: 1.6.5
data plane version: 1.6.5 (2 proxies)
istioctl profile dump default > istio-operator-1.6.5.yaml
Update the above yaml file with
metadata:
namespace: istio-system
name: istiocontrolplane
kubectl create ns istio-system
kubectl apply -f istio-operator-1.6.5.yaml
kubectl -n istio-system get hpa istiod -o yaml
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
annotations:
autoscaling.alpha.kubernetes.io/conditions: '[{"type":"AbleToScale","status":"True","lastTransitionTime":"2020-07-18T02:12:37Z","reason":"SucceededGetScale","message":"the
HPA controller was able to get the target''s current scale"},{"type":"ScalingActive","status":"False","lastTransitionTime":"2020-07-18T02:12:37Z","reason":"FailedGetResourceMetric","message":"the
HPA was unable to compute the replica count: unable to get metrics for resource
cpu: unable to fetch metrics from resource metrics API: the server could not
find the requested resource (get pods.metrics.k8s.io)"}]'
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"autoscaling/v2beta1","kind":"HorizontalPodAutoscaler","metadata":{"annotations":{},"labels":{"app":"istiod","install.operator.istio.io/owning-resource":"istiocontrolplane","install.operator.istio.io/owning-resource-namespace":"istio-system","istio.io/rev":"default","operator.istio.io/component":"Pilot","operator.istio.io/managed":"Reconcile","operator.istio.io/version":"1.6.5","release":"istio"},"name":"istiod","namespace":"istio-system"},"spec":{"maxReplicas":5,"metrics":[{"resource":{"name":"cpu","targetAverageUtilization":80},"type":"Resource"}],"minReplicas":1,"scaleTargetRef":{"apiVersion":"apps/v1","kind":"Deployment","name":"istiod"}}}
creationTimestamp: "2020-07-18T02:12:22Z"
labels:
app: istiod
install.operator.istio.io/owning-resource: istiocontrolplane
install.operator.istio.io/owning-resource-namespace: istio-system
istio.io/rev: default
operator.istio.io/component: Pilot
operator.istio.io/managed: Reconcile
operator.istio.io/version: 1.6.5
release: istio
name: istiod
namespace: istio-system
resourceVersion: "9707089"
selfLink: /apis/autoscaling/v1/namespaces/istio-system/horizontalpodautoscalers/istiod
uid: 2520f398-fba6-4107-8939-cdfd0b376f61
spec:
maxReplicas: 5
minReplicas: 1
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: istiod
targetCPUUtilizationPercentage: 80
status:
currentReplicas: 1
desiredReplicas: 0
in the above hpa currentReplicas: 1 while desiredReplicas:0