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 extend memory in nodeResourceManager #541

Merged
merged 1 commit into from
Sep 15, 2022

Conversation

chenkaiyue
Copy link
Contributor

@chenkaiyue chenkaiyue commented Sep 1, 2022

  1. Add extend memory in nodeResourceManager
  2. Don't exit when there is no node tsp
  3. Collect memory info for pod and container
  4. Fix cadvisor can't get container info error

@chenkaiyue
Copy link
Contributor Author

image

if err != nil {
return agent, err
}
tspName, _ := agent.CreateNodeResourceTsp()
Copy link
Contributor

Choose a reason for hiding this comment

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

why ignore the error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we can't creat node tsp, the program should go on, there is local data after all.

@@ -212,14 +219,19 @@ func (o *NodeResourceManager) BuildNodeStatus(node *v1.Node) map[string]int64 {
var nextRecommendation float64
switch resourceName {
case v1.ResourceCPU:
if reserveCpuPercent != nil {
if *reserveCpuPercent != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

nil check for reserveCpuPercent, or the program will crash with nil error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The construction process of reserveCpuPercent make reserveCpuPercent will not be nil.

pkg/resource/node_resource_manager.go Show resolved Hide resolved
pkg/resource/node_resource_manager.go Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2022

🎉 Successfully Build Images.
Now Support ARM Platforms.
Comment Post Time: 2022-09-06 13:35
Git Version: 20e5bd8

Docker Registry

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

Image Pull Command
crane-agent:pr-541-20e5bd8 docker pull gocrane/crane-agent:pr-541-20e5bd8
dashboard:pr-541-20e5bd8 docker pull gocrane/dashboard:pr-541-20e5bd8
metric-adapter:pr-541-20e5bd8 docker pull gocrane/metric-adapter:pr-541-20e5bd8
craned:pr-541-20e5bd8 docker pull gocrane/craned:pr-541-20e5bd8

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

Coding Registry

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

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

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

Ghcr Registry

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

Image Pull Command
crane-agent:pr-541-20e5bd8 docker pull ghcr.io/gocrane/crane/crane-agent:pr-541-20e5bd8
dashboard:pr-541-20e5bd8 docker pull ghcr.io/gocrane/crane/dashboard:pr-541-20e5bd8
metric-adapter:pr-541-20e5bd8 docker pull ghcr.io/gocrane/crane/metric-adapter:pr-541-20e5bd8
craned:pr-541-20e5bd8 docker pull ghcr.io/gocrane/crane/craned:pr-541-20e5bd8

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

@chenkaiyue chenkaiyue force-pushed the extend-memory branch 3 times, most recently from 0489097 to f662738 Compare September 2, 2022 09:02
…and container;Fix cadvisor can't get container info err
Copy link
Contributor

@mfanjie mfanjie left a comment

Choose a reason for hiding this comment

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

LGTM

@mfanjie mfanjie merged commit 8241d66 into gocrane:main Sep 15, 2022
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.

None yet

2 participants