kubecost / features-bugs

A public repository for filing of Kubecost feature requests and bugs. Please read the issue guidelines before filing an issue here.
0 stars 0 forks source link

Request Right Sizing action created via Helm shows incorrect in UI #105

Closed oshri22004 closed 1 month ago

oshri22004 commented 4 months ago

Kubecost Helm Chart Version

2.2.5

Kubernetes Version

1.29

Kubernetes Platform

EKS

Description

I tried to create an action of "Automated Request Sizing" via values.yaml and I'm getting weird stuff...

Steps to reproduce

1. temp-values.yaml:

clusterController:
  enabled: true
  actionConfigs:
    containerRightsize:
      workloads:
        - clusterID: cluster-one
          controllerKind: deployment
      schedule:
        start: "2024-06-16T00:00:00Z"
        frequencyMinutes: 5
        recommendationQueryWindow: "48h"
        lastModified: ""
        targetUtilizationCPU: 0.6
        targetUtilizationMemory: 0.6
global:
  prometheus:
    enabled: false
    fqdn: "http://monitoring-prometheus-server.monitoring.svc:80"
  1. helm upgrade -i kubecost \                                                                                                                            
    oci://public.ecr.aws/kubecost/cost-analyzer --version 2.2.5 \
    --namespace kubecost \
    --create-namespace \
    -f temp-values.yaml \
    -f https://raw.githubusercontent.com/kubecost/cost-analyzer-helm-chart/develop/cost-analyzer/values-eks-cost-monitoring.yaml

    Expected behavior

having an action like it should be

Impact

No response

Screenshots

image

Logs

No response

Slack discussion

No response

Troubleshooting

chipzoller commented 4 months ago

By "weird stuff" are you only referring to the Schedule and Next Run values shown there? Or was there something else?

chipzoller commented 4 months ago

This may or may not be a Helm issue (ex., invalid values structure) so transferred to features-bugs. I confirmed the same behavior on 2.3.0-rc.5. An example values file looks like the below.

global:
  grafana:
    enabled: false
    proxy: false
clusterController:
  enabled: true
  actionConfigs:
    containerRightsize:
      workloads:
        - clusterID: cluster-one
          controllerKind: deployment
      #     namespace: my-namespace
      #     controllerName: my-controller
      # filterConfig:
      #   - filter: |
      #       namespace:"kyverno"+controllerKind:"deployment"
      schedule:
        start: "2024-06-17T15:04:05Z"
        frequencyMinutes: 120
        recommendationQueryWindow: "48h"
        lastModified: ''
        targetUtilizationCPU: 0.8
        targetUtilizationMemory: 0.8
oshri22004 commented 4 months ago

By "weird stuff" are you only referring to the Schedule and Next Run values shown there? Or was there something else?

Yes, I'm referring to the Schedule and Next Run values, I didn't check if it works.

oshri22004 commented 4 months ago

@chipzoller In addition to the UI, it doesn't seem to work.

oshri22004 commented 4 months ago

Is there a way I can inspect the code for debugging and contributing?

chipzoller commented 4 months ago

Thanks for the report. I've confirmed the same thing and have logged it internally.

oshri22004 commented 3 months ago

Hi @chipzoller , is there any update on the fix for this bug?

Thanks!

chipzoller commented 3 months ago

Yes, this is being fixed in 2.3.3 which should be available in a few days.

oshri22004 commented 3 months ago

Hi @chipzoller, Thank you for the fixed version! I get the next error image

ERR Kubescaler setup failed error="creating a Kubescaler: failed to update schedules upon startup: getting deployment '' in namespace '': resource name may not be empty" 

Im using this as the values:

This may or may not be a Helm issue (ex., invalid values structure) so transferred to features-bugs. I confirmed the same behavior on 2.3.0-rc.5. An example values file looks like the below.

global:
  grafana:
    enabled: false
    proxy: false
clusterController:
  enabled: true
  actionConfigs:
    containerRightsize:
      workloads:
        - clusterID: cluster-one
          controllerKind: deployment
      #     namespace: my-namespace
      #     controllerName: my-controller
      # filterConfig:
      #   - filter: |
      #       namespace:"kyverno"+controllerKind:"deployment"
      schedule:
        start: "2024-06-17T15:04:05Z"
        frequencyMinutes: 120
        recommendationQueryWindow: "48h"
        lastModified: ''
        targetUtilizationCPU: 0.8
        targetUtilizationMemory: 0.8
oshri22004 commented 3 months ago

I want the action to change the request and limit of every deployment in the cluster.

chipzoller commented 3 months ago

Thanks for the feedback. We're checking internally.

oshri22004 commented 1 month ago

Hi @chipzoller, Is there any update?

chipzoller commented 1 month ago

Yes, we've found the issue and it should be fixed in the upcoming 2.3.5.

oshri22004 commented 1 month ago

Hi @chipzoller, Thank you for the newer version and for your amazing tool! I want to know how to write in the values.yaml for Request Right Sizing action creation that will change every deployment in the cluster. Should I change something in the values file below?

This may or may not be a Helm issue (ex., invalid values structure) so transferred to features-bugs. I confirmed the same behavior on 2.3.0-rc.5. An example values file looks like the below.

global:
  grafana:
    enabled: false
    proxy: false
clusterController:
  enabled: true
  actionConfigs:
    containerRightsize:
      workloads:
        - clusterID: cluster-one
          controllerKind: deployment
      #     namespace: my-namespace
      #     controllerName: my-controller
      # filterConfig:
      #   - filter: |
      #       namespace:"kyverno"+controllerKind:"deployment"
      schedule:
        start: "2024-06-17T15:04:05Z"
        frequencyMinutes: 120
        recommendationQueryWindow: "48h"
        lastModified: ''
        targetUtilizationCPU: 0.8
        targetUtilizationMemory: 0.8
chipzoller commented 1 month ago

This now works in Kubecost v2.3.5:

clusterController:
  enabled: true
  actionConfigs:
    containerRightsize:
      filterConfig:
        - filter: |
            controllerKind:"deployment"
      schedule:
        start: "2024-09-01T00:00:00Z"
        frequencyMinutes: 120
        recommendationQueryWindow: "48h"
        targetUtilizationCPU: 0.8
        targetUtilizationMemory: 0.8

Closing since this is now resolved.