-
Notifications
You must be signed in to change notification settings - Fork 54
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
cmd/kubernetes-static: fixes and improvements #148
Commits on Jul 16, 2021
-
cmd/kubernetes-static/readme.md: remove trailing whitespace
Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 5ff0519 - Browse repository at this point
Copy the full SHA 5ff0519View commit details -
cmd/kubernetes-static/readme.md: fix documentation
Right now the binary actually expect working directory to be root of the repository. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for ce91b54 - Browse repository at this point
Copy the full SHA ce91b54View commit details -
go.mod: bump Go version to 1.16
To indicate that Go 1.16 should be used for building, so we can safely use go:embed directive for kubernetes-static. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 31fd1df - Browse repository at this point
Copy the full SHA 31fd1dfView commit details -
cmd/kubernetes-static/data: fix location of api-server metrics
Integration expects it at "api-server" while it was at "apiserver". Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 4f00c39 - Browse repository at this point
Copy the full SHA 4f00c39View commit details -
cmd/kubernetes-static/main.go: print newline at the end of execution
So when running shell do not spawn at the end of the output. That improves readability and usability, while it shouldn't interrupt any consumers, as usually trailing whitespace is properly handled. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for c4c696f - Browse repository at this point
Copy the full SHA c4c696fView commit details -
src/metric: automatically improve formatting
Using 'gci' formatter. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 2e4e7b7 - Browse repository at this point
Copy the full SHA 2e4e7b7View commit details -
cmd/kubernetes-static: use go:embed for serving static data
This way, binary is independent from host file system and it's only important during build. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 55cfd0a - Browse repository at this point
Copy the full SHA 55cfd0aView commit details -
cmd/kubernetes-static/main.go: simplify service list initialization
Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 5d61643 - Browse repository at this point
Copy the full SHA 5d61643View commit details -
cmd/kubernetes-static/main.go: simplify mock client initialization
In majority of cases there is no need to use 'new' keyword. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 46d68da - Browse repository at this point
Copy the full SHA 46d68daView commit details -
cmd/kubernetes-static/main.go: simplify returned endpoint address
There is no need to use 'localhost' explicitly. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 560845f - Browse repository at this point
Copy the full SHA 560845fView commit details -
cmd/kubernetes-static/main.go: remove unnecessary Sleep
Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 442aa2c - Browse repository at this point
Copy the full SHA 442aa2cView commit details -
cmd/kubernetes-static/main.go: improve imports naming
Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for b4fe304 - Browse repository at this point
Copy the full SHA b4fe304View commit details -
cmd/kubernetes-static: use only single source file
So it's more intuitive to use 'go run'. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for e17588a - Browse repository at this point
Copy the full SHA e17588aView commit details -
cmd/kubernetes-static/main.go: add missing Service objects
Part of #149 Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 80c445c - Browse repository at this point
Copy the full SHA 80c445cView commit details -
cmd/kubernetes-static/main.go: fix collecting API server metrics
Without this patch, following error is printed: "entity name and type are required when defining one" Part of #149 Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 7640eeb - Browse repository at this point
Copy the full SHA 7640eebView commit details -
cmd/kubernetes-static/main.go: use constants for controlplane components
So they are less likely to get out of sync with other parts of the code. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 1af8c98 - Browse repository at this point
Copy the full SHA 1af8c98View commit details -
src/definition: improve variable names a bit
Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 1043873 - Browse repository at this point
Copy the full SHA 1043873View commit details -
src/metric/definition.go: mark some metrics as optional
Those metric may not always be available due to various reasons, marking them as optional silents them from reporting as errors. If I recall correctly: - createdAt, createdKind, createdBy, deploymentName metrics won't be available for e.g. static pods. - reason, message metrics will only be available for failing pods. - cpuRequestedCores, cpuLimitCores, memoryRequestedBytes, memoryLimitBytes will only be calculated for pods with resource requests configured. - pvc* metrics will only be available for volumes backed by actual PVC, not for EmptyDir volume etc. Refs #149 Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 35c4922 - Browse repository at this point
Copy the full SHA 35c4922View commit details -
src/definition/fetch.go: improve error messages a bit
Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 496c5dc - Browse repository at this point
Copy the full SHA 496c5dcView commit details -
cmd/kubernetes-static/main.go: mock newer Kubernetes version
To at least align with version of latest test data we have. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 69d3765 - Browse repository at this point
Copy the full SHA 69d3765View commit details -
src/definition/populate.go: improve error message formatting
Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for ed5031d - Browse repository at this point
Copy the full SHA ed5031dView commit details -
src/ksm/group.go: improve errors a bit
To use standard formatting and some minimal error annotation to make error tracing easier while debugging. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 0c98004 - Browse repository at this point
Copy the full SHA 0c98004View commit details -
src/ksm/group.go: small styling improvements
Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for ab35179 - Browse repository at this point
Copy the full SHA ab35179View commit details -
src/kubelet: small styling improvements
Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 5e9d085 - Browse repository at this point
Copy the full SHA 5e9d085View commit details -
src/kubelet/metric/metric.go: simplify loop logic
Loop labels are not really needed, as they always stop the closest loop anyway. Check for nil Containers slice is also not needed, since iterating over nil slice will result in no iterations anyway. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 41f1181 - Browse repository at this point
Copy the full SHA 41f1181View commit details -
src/prometheus: small styling improvements
Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for f34fb77 - Browse repository at this point
Copy the full SHA f34fb77View commit details -
src/prometheus: improve error messages
So it's clear which is label name and metric name. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com> Co-authored-by: Roberto Santalla <roobre@roobre.es>
Configuration menu - View commit details
-
Copy full SHA for 9329da1 - Browse repository at this point
Copy the full SHA 9329da1View commit details -
src/metric/definition.go: improve error messages in toUtilization()
Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 1060f61 - Browse repository at this point
Copy the full SHA 1060f61View commit details -
src/definition: small styling and formatting improvements
Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 5aa03b2 - Browse repository at this point
Copy the full SHA 5aa03b2View commit details -
src/kubelet/metric: improvements to GetMetricsData method
It will now return a pointer to a summary, which should save some memory copying and is more standard approach for functions, which may return error in Go. Additionally, to make use of using structure pointer, GroupStatsSummary() method is also adopted to take a pointer of the summary. There are also improved error messages in GetMetricsData(), which should be more helpful while debugging. Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for 6885e7a - Browse repository at this point
Copy the full SHA 6885e7aView commit details