aptakube icon indicating copy to clipboard operation
aptakube copied to clipboard

CPU and Memory current Usage per deployment is missing

Open doronshai opened this issue 1 year ago • 5 comments

What problem are you trying to solve? Do you a suggestion on how to solve it?

When using workloads > deployment view, there are columns about CPU and Memory Usage which are empty. This is an important metrics that need to be presented

doronshai avatar Sep 17 '24 07:09 doronshai

Hey @doronshai we use Kubernetes Metrics API to populate that column, so your cluster needs to host a compatible implementation.

The most popular ones are metrics-server and prometheus-adapter (if you’re already using Prometheus)

goenning avatar Sep 17 '24 07:09 goenning

@goenning I installed the prometheus-adapter and enabled the external metrics, but no usage for node, deployment or pod is showing up.

❯ : kubectl get apiservice v1beta1.external.metrics.k8s.io -o yaml
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
  annotations:
    meta.helm.sh/release-name: prometheus-adapter
    meta.helm.sh/release-namespace: grafana
  creationTimestamp: "2024-12-10T09:34:12Z"
  labels:
    app.kubernetes.io/component: metrics
    app.kubernetes.io/instance: prometheus-adapter
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: prometheus-adapter
    app.kubernetes.io/part-of: prometheus-adapter
    app.kubernetes.io/version: v0.12.0
    helm.sh/chart: prometheus-adapter-4.11.0
  name: v1beta1.external.metrics.k8s.io
  resourceVersion: "2067275"
  uid: 7f6490a4-a0aa-451e-a98d-8d0951104c80
spec:
  group: external.metrics.k8s.io
  groupPriorityMinimum: 100
  insecureSkipTLSVerify: true
  service:
    name: prometheus-adapter
    namespace: grafana
    port: 443
  version: v1beta1
  versionPriority: 100
status:
  conditions:
  - lastTransitionTime: "2024-12-10T09:35:02Z"
    message: all checks passed
    reason: Passed
    status: "True"
    type: Available

washanhanzi avatar Dec 10 '24 09:12 washanhanzi

Does kubectl top nodes or kubectl top pods return anything?

goenning avatar Dec 10 '24 09:12 goenning

Does kubectl top nodes or kubectl top pods return anything?

no, error: Metrics API not available. I don't know what to do next.

washanhanzi avatar Dec 10 '24 10:12 washanhanzi

Does kubectl top nodes or kubectl top pods return anything?

Ok, i made it work. The resource metrics must be enabled in prometheus adapter.

washanhanzi avatar Dec 10 '24 10:12 washanhanzi