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

Bug 1948546: Allow all networking interfaces to be defined as ports #179

Merged

Conversation

iamemilio
Copy link

Rather than require users to use the networks and subnets to define a
networking interface for an instance, users should be able to just
define them using the ports api if they choose to. This removes
validation checking that a user entered at least one network and subnet,
and insteand checks that a user entered at least one network, subnet, or
port.

Fixes Bug 1948546:
The correct way to configure the OpenStack provider spec in a machineset with interfaces on networks with port security disabled is now as follows in the example below. This is because it is impossible to attach networks with port security enabled when a security group is set on the instance. It will fail with: Network requires port_security_enabled and subnet associated in order to apply security groups.

      providerSpec:
        value:
          apiVersion: openstackproviderconfig.openshift.io/v1alpha1
          cloudName: openstack
          cloudsSecret:
            name: openstack-cloud-credentials
            namespace: openshift-machine-api
          flavor: ci.m1.xlarge
          image: rhcos-4.8
          kind: OpenstackProviderSpec
          metadata:
            creationTimestamp: null
          ports:
          - allowedAddressPairs:       # node port to communicate with cluster on machine subnet
            - ipAddress: 10.0.128.7    # ingress vip port
            - ipAddress: 10.0.128.5    # api vip port
            fixedIPs:
            - subnetID: eba0e7cc-b4df-426d-ba97-16fc770cd202
            nameSuffix: nodes
            networkID: ff5ac995-84b3-4494-ab2d-2eb3accf7f15
            securityGroups:            # attach the workers security group here
            - 1f8e583d-3f80-49f6-8628-de081e26d8fb
          - fixedIPs:                  # example port on network without port security
            - subnetID: 55028db4-8979-4f18-a38c-6074c2965c08
            nameSuffix: noPortSecurity
            networkID: bf01893c-2a9c-4695-b8c1-c43129e5efdd
          primarySubnet: eba0e7cc-b4df-426d-ba97-16fc770cd202  # must set this when attaching more than one port
          serverMetadata:
            Name: emilio-ggfm6-worker
            openshiftClusterID: emilio-ggfm6
          tags:
          - openshiftClusterID=emilio-ggfm6
          trunk: false
          userDataSecret:
            name: worker-user-data

Rather than require users to use the networks and subnets to define a
networking interface for an instance, users should be able to just
define them using the ports api if they choose to. This removes
validation checking that a user entered at least one network and subnet,
and insteand checks that a user entered at least one network, subnet, or
port.
@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. label Apr 26, 2021
@openshift-ci-robot
Copy link

@iamemilio: This pull request references Bugzilla bug 1948546, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.8.0) matches configured target release for branch (4.8.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

No GitHub users were found matching the public email listed for the QA contact in Bugzilla (itbrown@redhat.com), skipping review request.

In response to this:

Bug 1948546: Allow all networking interfaces to be defined as ports

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.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Apr 26, 2021
@iamemilio
Copy link
Author

/retest

1 similar comment
@iamemilio
Copy link
Author

/retest

Copy link

@adduarte adduarte left a comment

Choose a reason for hiding this comment

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

Looks good. But we should point out that the user should only define eithe rhet networkID or the subnetID, if they define both, they will have to make sure they match.

@iamemilio
Copy link
Author

iamemilio commented Apr 28, 2021

Neutron is already going to prevent them from doing this. I don't think we are responsible for explaining very basic port creation information to users. If they make this mistake, they will figure it out pretty quickly from reading the logs. We also dont keep documentation on the OpenStack provider config for the machine api.

W0428 10:14:44.715574  545770 controller.go:317] emilio-ggfm6-worker-test-1-27twn: failed to create machine: error creating Openstack instance: Bad request with: [POST https://rhos-d.infra.prod.upshift.rdu2.redhat.com:13696/v2.0/ports], error message: {"NeutronError": {"type": "InvalidInput", "message": "Invalid input for operation: Failed to create port on network ff5ac995-84b3-4494-ab2d-2eb3accf7f15, because fixed_ips included invalid subnet eba0e7cc-b4df-426d-ba97-16fc770cd202.", "detail": ""}}

@adduarte
Copy link

This installed and ran e2e succesfully. so it looks good to me.

@adduarte
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 28, 2021
@iamemilio
Copy link
Author

/approve

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: iamemilio

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 28, 2021
@openshift-merge-robot openshift-merge-robot merged commit f17f967 into openshift:master Apr 28, 2021
@openshift-ci-robot
Copy link

@iamemilio: All pull requests linked via external trackers have merged:

Bugzilla bug 1948546 has been moved to the MODIFIED state.

In response to this:

Bug 1948546: Allow all networking interfaces to be defined as ports

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.

pierreprinetti pushed a commit to shiftstack/cluster-api-provider-openstack that referenced this pull request Apr 22, 2024
We ought to use the same yaml package used by clientconfig in order to
marshall/unmarshall Auth structs to/from yaml correctly. Using any other
yaml library will fail to load the auth data from secrets.
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. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants