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: Custom API and Ingress vip addresses #3366

Merged
merged 1 commit into from Apr 8, 2020

Conversation

iamemilio
Copy link

@iamemilio iamemilio commented Mar 27, 2020

Customers may want to plumb the networking that enables external access to the cluster in a number of ways. To make their job easier, this feature allows them to select fixed IP addresses that they can reach the API and apps ingress at in their OpenShift cluster. This allows them to use/reuse pre-existing routing and external access schemes more easily. This adds an additional optional set of values to the openstack platform section of the install config as follows:

platform:
  openstack:
    cloud: ...
    apiVIP: "10.0.0.35"
    ingressVIP: "10.0.0.19"

Note that the default values have not changed. APIVIP still defaults to the 5 on the machineNetwork, and IngressVIP still defaults to the 7.

@iamemilio
Copy link
Author

/cc @Fedosin

@iamemilio
Copy link
Author

/label platform/openstack

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 30, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 30, 2020
@jstuever
Copy link
Contributor

/cc @adduarte
/uncc @jstuever

@openshift-ci-robot openshift-ci-robot requested review from adduarte and removed request for jstuever March 30, 2020 23:34
@iamemilio
Copy link
Author

/retest

@@ -43,4 +43,14 @@ type Platform struct {
// the default OS image for cluster nodes, or an existing Glance image name.
// +optional
ClusterOSImage string `json:"clusterOSImage,omitempty"`

// apiVIP is the static IP on the nodes subnet that the api port for openshift will be assigned
Copy link
Contributor

Choose a reason for hiding this comment

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

APIVIP is the static IP...

// +optional
APIVIP string `json:"apiVIP,omitempty"`

// ingressVIP is the static IP on the nodes subnet that the apps port for openshift will be assigned
Copy link
Contributor

Choose a reason for hiding this comment

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

IngressVIP is the static IP...


if p.IngressVIP != "" {
if err := validate.IP(p.IngressVIP); err != nil {
allErrs = append(allErrs, field.Invalid(fldPath.Child("IngressVIP"), p.IngressVIP, err.Error()))
Copy link
Contributor

Choose a reason for hiding this comment

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

fldPath.Child("ingressVIP")

}

if !n.MachineNetwork[0].CIDR.Contains(net.ParseIP(p.IngressVIP)) {
allErrs = append(allErrs, field.Invalid(fldPath.Child("IngressVIP"), p.IngressVIP, "IP is not in the nodesNetwork"))
Copy link
Contributor

Choose a reason for hiding this comment

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

fldPath.Child("ingressVIP")

@iamemilio
Copy link
Author

/hold race condition for ports

@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 31, 2020
@iamemilio
Copy link
Author

/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 1, 2020
@iamemilio
Copy link
Author

/retest

@Fedosin
Copy link
Contributor

Fedosin commented Apr 3, 2020

/lgtm

@@ -43,4 +43,14 @@ type Platform struct {
// the default OS image for cluster nodes, or an existing Glance image name.
// +optional
ClusterOSImage string `json:"clusterOSImage,omitempty"`

// APIVIP is the static IP on the nodes subnet that the api port for openshift will be assigned
// Default: will be set to the 5 on the machinesNetwork CIDR
Copy link
Contributor

Choose a reason for hiding this comment

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

machinesNetwork -> machineNetwork

also it seems like we pick the 5th host in the first network range of the list.

allErrs = append(allErrs, field.Invalid(fldPath.Child("apiVIP"), p.APIVIP, err.Error()))
}
if !n.MachineNetwork[0].CIDR.Contains(net.ParseIP(p.APIVIP)) {
allErrs = append(allErrs, field.Invalid(fldPath.Child("apiVIP"), p.APIVIP, "IP is not in the machineNetwork"))
Copy link
Contributor

Choose a reason for hiding this comment

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

machineNetwork[0]

Comment on lines 70 to 74
if err := validate.IP(p.APIVIP); err != nil {
allErrs = append(allErrs, field.Invalid(fldPath.Child("apiVIP"), p.APIVIP, err.Error()))
}
if !n.MachineNetwork[0].CIDR.Contains(net.ParseIP(p.APIVIP)) {
allErrs = append(allErrs, field.Invalid(fldPath.Child("apiVIP"), p.APIVIP, "IP is not in the machineNetwork"))
Copy link
Contributor

Choose a reason for hiding this comment

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

the 2 step check is same for API and ingress VIP, so maybe use one function for both..

Comment on lines 28 to 32
MachineNetwork: []types.MachineNetworkEntry{
{
CIDR: *ipnet.MustParseCIDR("10.0.0.0/16"),
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
MachineNetwork: []types.MachineNetworkEntry{
{
CIDR: *ipnet.MustParseCIDR("10.0.0.0/16"),
},
},
MachineNetwork: []types.MachineNetworkEntry{{
CIDR: *ipnet.MustParseCIDR("10.0.0.0/16"),
}},

name: "invalid network custom ingress vip",
platform: func() *openstack.Platform {
p := validPlatform()
p.IngressVIP = "banana"
Copy link
Contributor

Choose a reason for hiding this comment

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

🤣

@abhinavdahiya
Copy link
Contributor

few nits, but i'll leave them upto openstack-approvers

/approve

/hold just to give people some time to fix the nits, please free to remove.

@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 8, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya

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 8, 2020
co-authored-by: Fedosin mfedosin@redhat.com
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 8, 2020
@Fedosin
Copy link
Contributor

Fedosin commented Apr 8, 2020

/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

Fedosin commented Apr 8, 2020

/retest

@iamemilio
Copy link
Author

/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.

9 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-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-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

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

Test name Commit Details Rerun command
ci/prow/e2e-aws-scaleup-rhel7 ecf8a2c link /test e2e-aws-scaleup-rhel7
ci/prow/e2e-libvirt ecf8a2c 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 5e597cc into openshift:master Apr 8, 2020
@@ -23,7 +23,9 @@ Beyond the [platform-agnostic `install-config.yaml` properties](../customization
* `octaviaSupport` (optional string): Whether OpenStack supports Octavia (`1` for true or `0` for false)
* `region` (deprecated string): The OpenStack region where the cluster will be created. Currently this value is not used by the installer.
* `trunkSupport` (optional string): Whether OpenStack ports can be trunked (`1` for true or `0` for false)
* `clusterOSImage` (optional string): Either a URL with `http(s)` or `file` scheme to override the default OS image for cluster nodes or an existing Glance image name.
* `clusterOSimage` (optional string): Either a URL with `http(s)` or `file` scheme to override the default OS image for cluster nodes or an existing Glance image name.
Copy link
Member

Choose a reason for hiding this comment

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

This needs to match the Go JSON serialization. Fixed via #3439.

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. platform/openstack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants