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 option to get clustername from google metadata #448

Closed

Conversation

thijsdejong
Copy link
Contributor

ISSUE TYPE
  • Feature Pull Request
SUMMARY

This adds the option to get the cluster name from google metadata server. This is very useful in a multicluster setup on GCP that we use.

cloud.google.com/go v0.38.0

@timonvw
Copy link

timonvw commented Jan 15, 2021

This would be really nice for multi cluster !

@PrasadG193
Copy link
Collaborator

@thijsdejong thanks for the PR. Do we have to set clustername as google_metadata to use this feature? Do we need to update documentation for this?

@thijsdejong
Copy link
Contributor Author

thijsdejong commented Jan 17, 2021

@thijsdejong thanks for the PR. Do we have to set clustername as google_metadata to use this feature? Do we need to update documentation for this?

Hi,

You have to set clustername to +google_metadata+ to use this feature. It would be nice to add a line in the docs that mentions this. Where can I do this?

@PrasadG193
Copy link
Collaborator

@thijsdejong documentation for botkube.io is placed at https://github.com/infracloudio/botkube-docs. We use hugo to build that. Could you please update the installation and configuration guide as per the change? Please LMK if you need any help with that.

@@ -277,6 +278,15 @@ func New() (*Config, error) {
yaml.Unmarshal(b, c)
}

if c.Settings.ClusterName == "+google_metadata+" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use something like {{ google_metada }} instead? Looks more like go templating

Copy link
Contributor

Choose a reason for hiding this comment

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

Using {{}} would suggest that Go templating is actually supported. If it is not, then this only leads to confusion, I think.

Would $GOOGLE_METADATA or google-metadata:///cluster make more sense to you?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds good to me.

@pkosiec
Copy link
Member

pkosiec commented Jun 3, 2022

Hello there,

I'm not really sure if that's the proper way of implementing this 🤔 It feels to me like this is not the BotKube's responsibility. In that way, later we would need to support other cloud providers and that would be hard to maintain.

However, we could be more flexible with cluster name configuration. What @mszostok introduced in #601 could be supported in config as well. In that way the clusterName could be taken from a different place, e.g. ConfigMap.
That would support such custom scenarios - @thijsdejong you would be able to e.g. create a Job which creates such ConfigMap with cluster name. IMO simple and clean.

@mszostok @PrasadG193 @thijsdejong What do you think?

Cheers!

@pkosiec
Copy link
Member

pkosiec commented Jul 14, 2022

Alright, so let's close it and implement in the way as I mentioned above. You can follow the implementation under this issue: #643. Thanks!

@pkosiec pkosiec closed this Jul 14, 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

5 participants