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 config fetcher flush the rules #830

Closed
wants to merge 1 commit into from
Closed

fix config fetcher flush the rules #830

wants to merge 1 commit into from

Conversation

aheizi
Copy link

@aheizi aheizi commented Jun 29, 2023

What type of PR is this?

fix config fetcher flush the rules when prometheus-adapter-config only configure rules and externalRules

What this PR does / why we need it:

  1. Crane will not crash if only ResourceRules are configured and others are not.
  2. Decouple the refresh of ResourceRules, CustomerRules, and ExternalRules, so that if one of them has a problem, it will not affect the others.

Which issue(s) this PR fixes:

Fixes #829

Special notes for your reviewer:

@github-actions
Copy link
Contributor

github-actions bot commented Jun 29, 2023

🎉 Successfully Build Images.
Now Support ARM Platforms.
Comment Post Time: 2023-07-03 19:04
Git Version: ad2da61

Docker Registry

Overview: https://hub.docker.com/u/gocrane

Image Pull Command
crane-agent:pr-830-ad2da61 docker pull gocrane/crane-agent:pr-830-ad2da61
dashboard:pr-830-ad2da61 docker pull gocrane/dashboard:pr-830-ad2da61
metric-adapter:pr-830-ad2da61 docker pull gocrane/metric-adapter:pr-830-ad2da61
craned:pr-830-ad2da61 docker pull gocrane/craned:pr-830-ad2da61

Quick Deploy - Helm

helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
                   --set craned.image.repository=gocrane/craned \
                   --set craned.image.tag=pr-830-ad2da61 \
                   --set metricAdapter.image.repository=gocrane/metric-adapter \
                   --set metricAdapter.image.tag=pr-830-ad2da61 \
                   --set craneAgent.image.repository=gocrane/crane-agent \
                   --set craneAgent.image.tag=pr-830-ad2da61 \
                   --set cranedDashboard.image.repository=gocrane/dashboard \
                   --set cranedDashboard.image.tag=pr-830-ad2da61 crane/crane

Coding Registry

Overview: https://finops.coding.net/public-artifacts/gocrane/crane/packages

Image Pull Command
crane-agent:pr-830-ad2da61 docker pull finops-docker.pkg.coding.net/gocrane/crane/crane-agent:pr-830-ad2da61
dashboard:pr-830-ad2da61 docker pull finops-docker.pkg.coding.net/gocrane/crane/dashboard:pr-830-ad2da61
metric-adapter:pr-830-ad2da61 docker pull finops-docker.pkg.coding.net/gocrane/crane/metric-adapter:pr-830-ad2da61
craned:pr-830-ad2da61 docker pull finops-docker.pkg.coding.net/gocrane/crane/craned:pr-830-ad2da61

Quick Deploy - Helm

helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
                   --set craned.image.repository=finops-docker.pkg.coding.net/gocrane/crane/craned \
                   --set craned.image.tag=pr-830-ad2da61 \
                   --set metricAdapter.image.repository=finops-docker.pkg.coding.net/gocrane/crane/metric-adapter \
                   --set metricAdapter.image.tag=pr-830-ad2da61 \
                   --set craneAgent.image.repository=finops-docker.pkg.coding.net/gocrane/crane/crane-agent \
                   --set craneAgent.image.tag=pr-830-ad2da61 \
                   --set cranedDashboard.image.repository=finops-docker.pkg.coding.net/gocrane/crane/dashboard \
                   --set cranedDashboard.image.tag=pr-830-ad2da61 crane/crane

Ghcr Registry

Overview: https://github.com/orgs/gocrane/packages?repo_name=crane

Image Pull Command
crane-agent:pr-830-ad2da61 docker pull ghcr.io/gocrane/crane/crane-agent:pr-830-ad2da61
dashboard:pr-830-ad2da61 docker pull ghcr.io/gocrane/crane/dashboard:pr-830-ad2da61
metric-adapter:pr-830-ad2da61 docker pull ghcr.io/gocrane/crane/metric-adapter:pr-830-ad2da61
craned:pr-830-ad2da61 docker pull ghcr.io/gocrane/crane/craned:pr-830-ad2da61

Quick Deploy - Helm

helm repo add crane https://finops-helm.pkg.coding.net/gocrane/gocrane
helm install crane -n crane-system --create-namespace \
                   --set craned.image.repository=ghcr.io/gocrane/crane/craned \
                   --set craned.image.tag=pr-830-ad2da61 \
                   --set metricAdapter.image.repository=ghcr.io/gocrane/crane/metric-adapter \
                   --set metricAdapter.image.tag=pr-830-ad2da61 \
                   --set craneAgent.image.repository=ghcr.io/gocrane/crane/crane-agent \
                   --set craneAgent.image.tag=pr-830-ad2da61 \
                   --set cranedDashboard.image.repository=ghcr.io/gocrane/crane/dashboard \
                   --set cranedDashboard.image.tag=pr-830-ad2da61 crane/crane

@qmhu qmhu requested a review from saikey0379 July 3, 2023 06:27
@@ -3,6 +3,7 @@ package prometheus_adapter
import (
"bytes"
"fmt"
"k8s.io/klog/v2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please format the imports

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@qmhu
Copy link
Member

qmhu commented Jul 3, 2023

@aheizi I just find that this issue is already fixed by #726 but i forget to merge it(merged now), so would you please rebase latest code and check if we need to optimize it? thanks.

@aheizi
Copy link
Author

aheizi commented Jul 3, 2023

ok,i think #726 has already solved my problem, thanks.

@aheizi aheizi closed this Jul 3, 2023
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.

prometheus-adapter-config only configure rules and externalRules, Crane will crash
2 participants