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

[OS-Kubespray] Set up security group for openstack instances #353

Closed
wants to merge 4 commits into from

Conversation

katyafervent
Copy link
Contributor

No description provided.

@katyafervent katyafervent force-pushed the resolve-ports branch 3 times, most recently from d0d0183 to 9891969 Compare August 10, 2018 08:15
@katyafervent katyafervent force-pushed the resolve-ports branch 4 times, most recently from ab23fd4 to a711bde Compare August 31, 2018 13:56
@@ -807,7 +810,45 @@ def _get_userdata(self):
}
return "#cloud-config\n" + yaml.dump(userdata)

def _boot_servers(self, *, name, servers_range, image, flavor, network,
def _set_up_security_groups(self):
master_sg = self.c.get_security_group("kqueen_master")

Choose a reason for hiding this comment

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

I suggest defining "kqueen_master" as a variable. At least you use it twice, and maybe you'll need to configure it someday

port_range_min="179",
port_range_max="179")

slave_sg = self.c.get_security_group("kqueen_slave")

Choose a reason for hiding this comment

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

kqueen_slave can be a variable

@@ -20,6 +20,9 @@
logger = logging.getLogger("kqueen_api")
config = current_config()

MASTER_SECURITY_GR = "kqueen_master"
COMMON_SECURITY_GR = "kqueen_common"
Copy link
Contributor

Choose a reason for hiding this comment

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

what is it? why its hardcoded? if it permanent change, we should document it and provide possibility of change

Copy link
Contributor

Choose a reason for hiding this comment

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

imo we should provide an option on UI , smth like 'create personal SC' otherwise it should use 'default'
its just one of useful ideas, need to talk about it with u

Copy link
Contributor Author

Choose a reason for hiding this comment

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

without specific SG, openstack provisioner will not work

Copy link
Contributor

Choose a reason for hiding this comment

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

so need to document it as 'pre-step' or provide kqueen-OPS for that

@@ -807,7 +813,40 @@ def _get_userdata(self):
}
return "#cloud-config\n" + yaml.dump(userdata)

def _boot_servers(self, *, name, servers_range, image, flavor, network,
def _set_up_security_groups(self):
master_sg = self.c.get_security_group(MASTER_SECURITY_GR)
Copy link
Contributor

Choose a reason for hiding this comment

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

imo all getters should be in one place in init method like any previous engines

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in init method data, collected from user is evaluated

def _set_up_security_groups(self):
master_sg = self.c.get_security_group(MASTER_SECURITY_GR)
if not master_sg:
master_sg = self.c.create_security_group(name=MASTER_SECURITY_GR,
Copy link
Contributor

Choose a reason for hiding this comment

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

imo we need a try/catch here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

error catching is made in the above level (_run_provisioning function)


common_sg = self.c.get_security_group(COMMON_SECURITY_GR)
if not common_sg:
common_sg = self.c.create_security_group(name=COMMON_SECURITY_GR,
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

self.c.create_security_group_rule(common_sg.id, protocol="tcp",
port_range_min="30000",
port_range_max="32767")
return master_sg, common_sg
Copy link
Contributor

Choose a reason for hiding this comment

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

there is no 'deprovision' step for SC

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you will not be able to delete sg if other cluster are using it. I think it will increase deletion time witch is so big now, but sg is not occupied space so fr me it is ok to leave it

@@ -20,6 +20,9 @@
logger = logging.getLogger("kqueen_api")
config = current_config()

MASTER_SECURITY_GR = "kqueen_master"
COMMON_SECURITY_GR = "kqueen_common"
Copy link
Contributor

Choose a reason for hiding this comment

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

so need to document it as 'pre-step' or provide kqueen-OPS for that

@katyafervent katyafervent force-pushed the resolve-ports branch 8 times, most recently from fbbbd03 to 35674ce Compare September 5, 2018 10:55
@katyafervent katyafervent force-pushed the resolve-ports branch 2 times, most recently from bd91885 to 9b716d8 Compare September 5, 2018 13:26
Ekaterina Chernova added 2 commits September 5, 2018 16:37
@katyafervent katyafervent force-pushed the resolve-ports branch 2 times, most recently from 51a6e97 to 50f784a Compare September 5, 2018 17:47
@naumvd95
Copy link
Contributor

@katyafervent what we should do with that PR? if we delay it, pls set additional labels

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