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

add metric kind for prometheus builder #724

Merged
merged 1 commit into from
Mar 28, 2023
Merged

Conversation

whitebear009
Copy link
Contributor

@whitebear009 whitebear009 commented Mar 24, 2023

What type of PR is this?

optimize

What this PR does / why we need it:

add metric kind for prometheus builder, otherwise in the GetPodNameReg method, the switch will not be entered.

func GetPodNameReg(resourceName string, resourceType string) string {
	switch resourceType {
	case "ReplicaSet":
		return fmt.Sprintf("^%s-%s", resourceName, PostRegMatchesPodReplicaset)
	case "Deployment":
		return fmt.Sprintf("^%s-%s", resourceName, PostRegMatchesPodDeployment)
	case "StatefulSet":
		return fmt.Sprintf("^%s-%s", resourceName, PostRegMatchesPodStatefulset)
	}
	return fmt.Sprintf("^%s-%s", resourceName, `.*`)

}

Special notes for your reviewer:

@whitebear009
Copy link
Contributor Author

@qmhu PTAL,thanks

@github-actions
Copy link
Contributor

🎉 Successfully Build Images.
Now Support ARM Platforms.
Comment Post Time: 2023-03-24 18:28
Git Version: b023ebc

Docker Registry

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

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

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-724-b023ebc \
                   --set metricAdapter.image.repository=gocrane/metric-adapter \
                   --set metricAdapter.image.tag=pr-724-b023ebc \
                   --set craneAgent.image.repository=gocrane/crane-agent \
                   --set craneAgent.image.tag=pr-724-b023ebc \
                   --set cranedDashboard.image.repository=gocrane/dashboard \
                   --set cranedDashboard.image.tag=pr-724-b023ebc crane/crane

Coding Registry

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

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

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-724-b023ebc \
                   --set metricAdapter.image.repository=finops-docker.pkg.coding.net/gocrane/crane/metric-adapter \
                   --set metricAdapter.image.tag=pr-724-b023ebc \
                   --set craneAgent.image.repository=finops-docker.pkg.coding.net/gocrane/crane/crane-agent \
                   --set craneAgent.image.tag=pr-724-b023ebc \
                   --set cranedDashboard.image.repository=finops-docker.pkg.coding.net/gocrane/crane/dashboard \
                   --set cranedDashboard.image.tag=pr-724-b023ebc crane/crane

Ghcr Registry

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

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

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-724-b023ebc \
                   --set metricAdapter.image.repository=ghcr.io/gocrane/crane/metric-adapter \
                   --set metricAdapter.image.tag=pr-724-b023ebc \
                   --set craneAgent.image.repository=ghcr.io/gocrane/crane/crane-agent \
                   --set craneAgent.image.tag=pr-724-b023ebc \
                   --set cranedDashboard.image.repository=ghcr.io/gocrane/crane/dashboard \
                   --set cranedDashboard.image.tag=pr-724-b023ebc crane/crane

Copy link
Member

@qmhu qmhu left a comment

Choose a reason for hiding this comment

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

Please take a look @saikey0379

@qmhu qmhu merged commit 61f0df4 into gocrane:main Mar 28, 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.

3 participants