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

[occm] Improve route controller reconciling to ensure the cluster's nodes can access each other #2484

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ The options in `Global` section are used for openstack-cloud-controller-manager

* `router-id`
Specifies the Neutron router ID to activate [route controller](https://kubernetes.io/docs/concepts/architecture/cloud-controller/#route-controller) to manage Kubernetes cluster routes.
`auto-config-node-security-group`
Whether or not to enable auto config node security group feature. The node security group used to ensure the node permit other nodes packets enter into.
Default: false

**NOTE: This require openstack-cloud-controller-manager's `--cluster-cidr` flag to be set.**

Expand Down
8 changes: 5 additions & 3 deletions pkg/openstack/openstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
cloudprovider "k8s.io/cloud-provider"
"k8s.io/klog/v2"

"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/client-go/informers"
coreinformers "k8s.io/client-go/informers/core/v1"
"k8s.io/client-go/kubernetes/scheme"
Expand Down Expand Up @@ -149,7 +149,8 @@ type NetworkingOpts struct {

// RouterOpts is used for Neutron routes
type RouterOpts struct {
RouterID string `gcfg:"router-id"`
RouterID string `gcfg:"router-id"`
AutoConfigSecurityGroup bool `gcfg:"auto-config-node-security-group"`
}

type ServerAttributesExt struct {
Expand Down Expand Up @@ -237,6 +238,7 @@ func ReadConfig(config io.Reader) (Config, error) {
cfg.LoadBalancer.ContainerStore = "barbican"
cfg.LoadBalancer.MaxSharedLB = 2
cfg.LoadBalancer.ProviderRequiresSerialAPICalls = false
cfg.Route.AutoConfigSecurityGroup = false

err := gcfg.FatalOnly(gcfg.ReadInto(&cfg, config))
if err != nil {
Expand Down Expand Up @@ -483,7 +485,7 @@ func (os *OpenStack) Routes() (cloudprovider.Routes, bool) {
return nil, false
}

r, err := NewRoutes(os, network, netExts["extraroute-atomic"], netExts["allowed-address-pairs"])
r, err := NewRoutes(os, network, netExts["extraroute-atomic"], netExts["allowed-address-pairs"], os.routeOpts.AutoConfigSecurityGroup)
Copy link
Contributor

Choose a reason for hiding this comment

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

the os is already passed to the NewRoutes func. There is no need to pass the os.routeOpts.AutoConfigSecurityGroup.

if err != nil {
klog.Warningf("Error initialising Routes support: %v", err)
return nil, false
Expand Down
Loading