Skip to content

Conversation

@hidekazuna
Copy link
Contributor

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #418

Special notes for your reviewer:

  1. Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:


@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 7, 2019
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Aug 7, 2019
@hidekazuna
Copy link
Contributor Author

Currently this PR is WIP. Bacause this PR created loadbalancer, pool, listener and healthmonitor successfully, but failed to assign floating ip to vip_port_id of loadbalancer.

if err != nil {
return err
}
loadbalancerService, err := loadbalancer.NewService(osProviderClient, clientOpts, clusterProviderSpec.UseOctavia)
Copy link
Member

Choose a reason for hiding this comment

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

Can you create this services at the start of the method (where networkingService was created before)? It was intended to first create all clients, so that we don't start to do anything if one of them cannot be created (also in the other files)

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 method needs clusterProviderSpec.useOcatavia so that must after providerv1.ClusterSpecAndStatusFromProviderSpec.

Copy link
Member

Choose a reason for hiding this comment

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

Oh of course you're right

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 10, 2019
@hidekazuna
Copy link
Contributor Author

Now I created cluster successfully except for following two changes.

  1. I need to change generate-yaml.sh to use Octavia. floating-network-id should be changed for each environment.
--- a/cmd/clusterctl/examples/openstack/generate-yaml.sh
+++ b/cmd/clusterctl/examples/openstack/generate-yaml.sh
@@ -171,6 +171,14 @@ password=\"$PASSWORD\"
 region=\"$REGION\"
 tenant-id=\"$PROJECT_ID\"
 domain-name=\"$DOMAIN_NAME\"
+[LoadBalancer]
+lb-version=v2
+use-octavia=true
+floating-network-id=5f11f552-7254-47ac-bda3-e8c03b1443cd
+create-monitor=true
+monitor-delay=60s
+monitor-timeout=30s
+monitor-max-retries=5
 "
 
 if [ "$CACERT_ORIGINAL" != "null" ]; then
  1. I need to change controlPlaneEndpoint in master-user-data.sh manually. This is bug, but will be fixed in finalize multi-node control plane implementation #421 .
--- a/cmd/clusterctl/examples/openstack/provider-component/user-data/ubuntu/templates/master-user-data.sh
+++ b/cmd/clusterctl/examples/openstack/provider-component/user-data/ubuntu/templates/master-user-data.sh
@@ -196,7 +196,7 @@ apiServer:
   timeoutForControlPlane: 4m0s
 certificatesDir: /etc/kubernetes/pki
 clusterName: kubernetes
-controlPlaneEndpoint: ${MASTER}
+controlPlaneEndpoint: "10.0.0.214"
 controllerManager:
   extraArgs:
     allocate-node-cidrs: "true"

@hidekazuna hidekazuna changed the title WIP: Use Octavia Use Octavia Aug 10, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 10, 2019
@jichenjc
Copy link
Contributor

i am having similar issue to you on 2)
so let's work together to merge #421 first

@hidekazuna
Copy link
Contributor Author

i am having similar issue to you on 2)
so let's work together to merge #421 first

Yeah, I know second issue is addressed here:
https://github.com/kubernetes-sigs/cluster-api-provider-openstack/pull/421/files#diff-1643cc4766c03f37fef0ea30a352f404R18-R19

Since I have only octavia environment, I hope merging this PR first so that I would test #421 manually in my octavia environment.

@sbueringer
Copy link
Member

If it makes Octavia deployment possible for you and doesnt break anything else, why not

@jichenjc
Copy link
Contributor

/approve

works for me

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hidekazuna, jichenjc

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 10, 2019
Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

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

Just some nits. Otherwise lgtm

return errors.New("network.APIServerLoadBalancer is not yet available in clusterProviderStatus")
}

loadBalancerName := fmt.Sprintf("%s-cluster-%s-%s", networkPrefix, clusterName, kubeapiLBSuffix)
Copy link
Member

Choose a reason for hiding this comment

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

Can you add this log message again? Seems like a rebase mistake to me (concurrent change on master & file move)

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 added the log message again due to accidentally removed.

Copy link
Member

Choose a reason for hiding this comment

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

Still removed in the diff :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now really added 👍

"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/loadbalancers"
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/monitors"
"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/pools"
// "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/listeners"
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer removing the unused imports

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

)

const (
networkPrefix string = "k8s"
Copy link
Member

Choose a reason for hiding this comment

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

prefix has been changed to k8s-clusterapi here: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/pull/424/files

Please also change it 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.

I changed the prefix.

networkingClient, err := openstack.NewNetworkV2(client, gophercloud.EndpointOpts{
Region: clientOpts.RegionName,
})

Copy link
Member

Choose a reason for hiding this comment

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

please also add error handling here:

if err != nil {
    return nil, fmt.Errorf("failed to create networking service client: %v", err)
}

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 added the error handling.

@sbueringer
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 11, 2019
@k8s-ci-robot k8s-ci-robot merged commit 5d49331 into kubernetes-sigs:master Aug 11, 2019
@hidekazuna hidekazuna deleted the use_octavia branch February 17, 2020 04:35
pierreprinetti pushed a commit to shiftstack/cluster-api-provider-openstack that referenced this pull request Apr 22, 2024
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support Octavia for LB

4 participants