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 per environment labels for resources #121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

oscr
Copy link
Contributor

@oscr oscr commented Oct 16, 2022

Related to issues #103 and #106.

There are some suggestions how per environment labels could be added using different strategies.

Would any of these be acceptable for you?

Environment detection with name

Output from kosmoo

kos_server_status{env="",env_detected="test-2",id="5e9d2601-4afc-426a-a48b-d58dd6b84747",name="foo-test-2",status="SUSPENDED"} 0

The environments would need to be passed to kosmoo in some form to ensure it knows what to look for. If nothing is passed then it doesn't need to look. This should be pretty straight forward update.

Environment with OpenStack metadata label added:

I added a metadata label to the server "env": "kosmooTest"

Output from kosmoo

kos_server_status{env="kosmooTest",env_detected="",id="1dcf777d-e637-473d-ac41-58a3943d5527",name="foo",status="ACTIVE"} 1

Need to verify this is possible with cinder. But otherwise works pretty much as expected.

Environment with Kube labels

Similar to above. Should be possible and simpler for certain resources.

@oscr oscr changed the title Add per environment labels to nova volumes Add per environment labels for resources Oct 16, 2022

// We could also use the naming to detect env.
environmentFromName := ""
if strings.Contains(srv.Name, "test-2") {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't get this test-2 string. What do you want to do with this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry so this was a long time ago and (one of) my first pr so it's pretty unclear what the idea is or if it's useful. If I recall correctly the things was we may have multiple clusters for different purposes and the environment is in the name. E g foo-test-1 or foo-test-2. The idea was to provide kosmoo with a list of environments to look for [test-1, test-2] and then check if the name contains one of environments and if so use it.

@oscr oscr marked this pull request as ready for review November 21, 2023 09:16
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.

2 participants