Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix previous helm chart issue for installation #726

Conversation

johnzheng1975
Copy link
Contributor

@johnzheng1975 johnzheng1975 commented Jun 11, 2024

One-line summary

Current chart is old and not work, I change the code based on the latest version, latest installation files under /docs.
I test and it works well.

Pls review, thanks.

Issue : #727

Description

A few sentences describing the overall goals of the pull request's
commits.

Note:
Current helm charts does not work ./docs/helm
You can install it successfully, but never work.
If you run cd docs; kubectl apply -f ., it can work.

If you view current helm charts,

  • The version is old.
  • The values are not expected.
  • Even some status inside template .
    It may not professional enough for such a good product.

BTW, feel free to modify if necessary.

Types of Changes

What types of changes does your code introduce? Keep the ones that apply:

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Configuration change
  • Refactor/improvements
  • Documentation / non-code

Tasks

List of tasks you will do to complete the PR

  • Created Task 1
  • Created Task 2
  • To-do Task 3

Review

List of tasks the reviewer must do to review the PR

  • Tests
  • Documentation
  • CHANGELOG

Deployment Notes

These should highlight any db migrations, feature toggles, etc.

…<john.zheng@hp.com>

Signed-off-by: John Zheng <john.zheng@hp.com>
@johnzheng1975
Copy link
Contributor Author

I test with below, and works well.

  1. Install with below
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
  namespace: flux-system
  name: kube-metrics-adapter
spec:
  interval: 5m # The interval at which to reconcile the Helm release
  url: https://github.com/johnzheng1975/kube-metrics-adapter.git
  ref:
    tag: v0.2.2
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
  namespace: infra
  name: kube-metrics-adapter
spec:
  interval: 5m # The interval at which to reconcile the Helm release
  releaseName: kube-metrics-adapter
  targetNamespace: infra
  chart:
    spec:
      chart: ./docs/helm
      sourceRef:
        kind: GitRepository
        name: kube-metrics-adapter
        namespace: flux-system
  values:
    prometheus:
      server: "http://prometheus-server.infra.svc.cluster.local:9090"

Step 2: Create hpa

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: aiservice
  namespace: zone-dev
  annotations:
    metric-config.external.dcgm-fi-dev-gpu-util.prometheus/prometheus-server: http://prometheus-server.infra.svc
    metric-config.external.dcgm-fi-dev-gpu-util.prometheus/query: |
     avg(
       avg_over_time(
         DCGM_FI_DEV_GPU_UTIL{
           app="nvidia-dcgm-exporter",
           container="service",
           exported_namespace="zone-dev",
           pod=~"aiservice-.*",
           service="nvidia-dcgm-exporter"
         }[1m]
       )
     )
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: aiservice
  minReplicas: 1
  maxReplicas: 5
  metrics:
  - type: External
    external:
      metric:
        name: dcgm-fi-dev-gpu-util
        selector:
          matchLabels:
            type: prometheus
      target:
        type: AverageValue
        averageValue: "50"

Step 3: It is useful as below.
image

@szuecs
Copy link
Member

szuecs commented Jun 11, 2024

👍

1 similar comment
@mikkeloscar
Copy link
Contributor

👍

@mikkeloscar mikkeloscar merged commit 61d5880 into zalando-incubator:master Jun 12, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants