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

OpenStack: allow to specify additional networks and security groups for masters and workers #3291

Merged
merged 4 commits into from Apr 8, 2020

Conversation

Fedosin
Copy link
Contributor

@Fedosin Fedosin commented Mar 13, 2020

In some cases we may need to provide access to additional networks and security groups. An example of this need would be to mount RWX volumes from OpenStack Manila, when shares are in another network (OSP default).
Since we plan to use Manila as the primary backend for the image registry, it is essential that we have this feature in IPI.

This PR adds two new parameters to OpenStack's MachinePool:

  • additionalNetworkIDs (optional list of strings): IDs of additional networks for machines.
  • additionalSecurityGroupIDs (optional list of strings): IDs of additional security groups for machines.

@Fedosin
Copy link
Contributor Author

Fedosin commented Mar 16, 2020

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 16, 2020
@Fedosin Fedosin changed the title POC: OpenStack: allow to specify additional subnets and sg for workers OpenStack: allow to specify additional networks and security groups for masters and workers Mar 16, 2020
@Fedosin Fedosin force-pushed the secondary_vnics branch 4 times, most recently from 7e241f8 to 0023428 Compare March 17, 2020 00:13
@abhinavdahiya
Copy link
Contributor

if this get's merged, it would be very nice to have an enhancement created to document what user stories / use case this is solving.

for other cloud platforms we don't allow these additional sets unless they are necessary for successful installation... because otherwise we are increasing the surface area of configuration at install-time, which needs to be tested, and which goes against the OpenShift 4 goals.

if this is to just ease process of users, i would recommend we look into controller driven OLM operator like component to achieve this as a day-2 configuration.

@Fedosin
Copy link
Contributor Author

Fedosin commented Mar 17, 2020

@abhinavdahiya yeah, documentation is coming. most likely when you read this message, it's already available.

We need this change to enable OpenStack Manila (shared filesystem) integration in IPI. This is not a hard requirement, but in OSP we create an additional network for shared volumes, and we have to add workers to this network to allow mounting.
This is also important for IPI, because we plan to use Manila as a backend for the image registry (RWX PVC), and without this PR we can't do it properly.

@Fedosin
Copy link
Contributor Author

Fedosin commented Mar 17, 2020

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 17, 2020
@Fedosin
Copy link
Contributor Author

Fedosin commented Mar 17, 2020

/retest

@Fedosin
Copy link
Contributor Author

Fedosin commented Mar 17, 2020

/test e2e-aws

@Fedosin
Copy link
Contributor Author

Fedosin commented Mar 20, 2020

/hold

blocked by openshift/cluster-api-provider-openstack#86

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 20, 2020
@Fedosin
Copy link
Contributor Author

Fedosin commented Mar 23, 2020

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 23, 2020
@Fedosin
Copy link
Contributor Author

Fedosin commented Mar 23, 2020

/test e2e-openstack

1 similar comment
@Fedosin
Copy link
Contributor Author

Fedosin commented Mar 23, 2020

/test e2e-openstack

@Fedosin
Copy link
Contributor Author

Fedosin commented Apr 3, 2020

/test e2e-openstack

4 similar comments
@Fedosin
Copy link
Contributor Author

Fedosin commented Apr 4, 2020

/test e2e-openstack

@Fedosin
Copy link
Contributor Author

Fedosin commented Apr 5, 2020

/test e2e-openstack

@Fedosin
Copy link
Contributor Author

Fedosin commented Apr 6, 2020

/test e2e-openstack

@Fedosin
Copy link
Contributor Author

Fedosin commented Apr 6, 2020

/test e2e-openstack

Comment on lines +89 to +100
networks := []openstackprovider.NetworkParam{
{
Subnets: []openstackprovider.SubnetParam{
{
Filter: openstackprovider.SubnetFilter{
Name: fmt.Sprintf("%s-nodes", clusterID),
Tags: fmt.Sprintf("%s=%s", "openshiftClusterID", clusterID),
},
},
},
},
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
networks := []openstackprovider.NetworkParam{
{
Subnets: []openstackprovider.SubnetParam{
{
Filter: openstackprovider.SubnetFilter{
Name: fmt.Sprintf("%s-nodes", clusterID),
Tags: fmt.Sprintf("%s=%s", "openshiftClusterID", clusterID),
},
},
},
},
}
networks := []openstackprovider.NetworkParam{{
Subnets: []openstackprovider.SubnetParam{{
Filter: openstackprovider.SubnetFilter{
Name: fmt.Sprintf("%s-nodes", clusterID),
Tags: fmt.Sprintf("%s=%s", "openshiftClusterID", clusterID),
},
}},
}}

@abhinavdahiya
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, mandre

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 6, 2020
@Fedosin
Copy link
Contributor Author

Fedosin commented Apr 6, 2020

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 6, 2020
@@ -20,5 +21,35 @@ func ValidateMachinePool(p *openstack.MachinePool, fldPath *field.Path) field.Er
}
}

allErrs = append(allErrs, validateUUIDV4s(p.AdditionalNetworkIDs, fldPath.Child("additionalNetworkIDs"))...)

Choose a reason for hiding this comment

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

Should we be using the valid values fetcher here to validate that these networks and security groups actually exist in openstack?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be done as a part of our Validation epic

@@ -390,6 +390,7 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error {
clusterID.InfraID,
caCert,
bootstrapIgn,
installConfig.Config.ControlPlane.Platform.OpenStack,

Choose a reason for hiding this comment

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

You dont have to do this in this patch, but could we just pass the install config here, or make a new struct to pass tfvars? The number of arguments to this function is becoming ludicrous :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know... Abhinav asked the same question #3291 (comment)
But I think we don't have other options, because we need to differenciate between primary and additional objects, and the only way is to read them from the machine pool :(

@iamemilio
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 8, 2020
@Fedosin
Copy link
Contributor Author

Fedosin commented Apr 8, 2020

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 8, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci-robot
Copy link
Contributor

@Fedosin: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-aws-scaleup-rhel7 c1329de link /test e2e-aws-scaleup-rhel7
ci/prow/e2e-libvirt c1329de link /test e2e-libvirt

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit e11c2b8 into openshift:master Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants