-
Notifications
You must be signed in to change notification settings - Fork 1
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
CP-19492: golang based cloudzero-chart validator #1
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the change
The current python based validator does cannot be packaged as a binary and run in the prometheus container because the container is running in busybox (and later will be scratch) which does not have libc.
Since we don't want to own the image for prometheus, we need a single binary which can perform the validation checks without requiring any external libraries or application dependencies. This is where golang really shines.
This commit provides:
Type of change
Development
alfa
(or with a cross namespace setup, e.g. developer namespace for this feature, pointing at sharedalfa
resources)Code review
CP-4051: Create TEMPLATE Feature Repo
.Trying it yourself
go mod download make fmt lint test build
bin/cloudzero-agent-validator
; you can do the following:Generate a configuration file
./bin/cloudzero-agent-validator config generate -account 1234 -cluster foo -region us-east-1 > myconfig.yml
echo $CZ_API_DEV_TOKEN > credentials_file
myconfig.yml
withcredentials_file: credentials_file
configurations:
inmyconfig.yml
from:/etc/config/prometheus/configmaps/prometheus.yml
credentials_file
checks
:kube_state_metrics_reachable
node_exporter_reachable
https://api.cloudzero.com
withhttps://dev-api.cloudzero.com
The configuration should look like the following now:
Additional notes for testing.
It is possible to test against a private namespaces endpoint by setting
host
to the endpoint, such ashost: https://jau6vy3ur7.execute-api.us-east-1.amazonaws.com/jb
then use the run command to send data for a single test from the local machine:you can then look at the data in the DB - for example: