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

Use separate flavors for slave and master nodes #342

Merged
merged 1 commit into from Jul 13, 2018

Conversation

katyafervent
Copy link
Contributor

No description provided.

"type": "text",
"order": 30,
"label": "Flavor",
"label": "Master flavor",
"default": config.get("KS_MASTER_FLAVOR"),
Copy link
Contributor

Choose a reason for hiding this comment

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

imo its better to set defaults directly here, for ex m1.medium for master, m1.large for slaves

Copy link
Contributor Author

Choose a reason for hiding this comment

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

decided not to use values from config at all. may be later use profile for each provisioner with predefined settings

raise ValueError("Flavor for master '%s' is not found" % self.cluster.metadata["master_flavor"])
self.meta["slave_flavor"] = self.c.get_flavor(self.cluster.metadata["slave_flavor"])
if self.meta["slave_flavor"] is None:
raise ValueError("Flavor for slave '%s' is not found" % self.cluster.metadata["master_flavor"])
Copy link
Contributor

Choose a reason for hiding this comment

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

in what case it can be None? through api calls?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, it is api server) we need to validate data on server side too

self.meta["flavor"] = self.c.get_flavor(self.cluster.metadata["flavor"])
if self.meta["flavor"] is None:
raise ValueError("Flavor '%s' is not found" % self.cluster.metadata["flavor"])
self.meta["master_flavor"] = self.c.get_flavor(self.cluster.metadata["master_flavor"])
Copy link
Contributor

Choose a reason for hiding this comment

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

btw, why some checks are not in try-catch block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they are optional

@katyafervent katyafervent force-pushed the separate-flavors-for-masters-and-slaves branch from cc6851d to dcdd984 Compare July 13, 2018 12:15
ekhomyakova
ekhomyakova previously approved these changes Jul 13, 2018
Copy link

@ekhomyakova ekhomyakova left a comment

Choose a reason for hiding this comment

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

LGFM

@ekhomyakova ekhomyakova merged commit 05c2aeb into master Jul 13, 2018
@katyafervent katyafervent deleted the separate-flavors-for-masters-and-slaves branch July 30, 2018 04: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.

None yet

3 participants