Skip to content

Commit

Permalink
Add optional router id to openstack cloud config
Browse files Browse the repository at this point in the history
Needed not by MC itself but by Metakube seed-cm, which uses this
structure to generate the seed user cluster cloud config secret
  • Loading branch information
multi-io committed May 3, 2023
1 parent 6625c3e commit b9555aa
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions pkg/cloudprovider/provider/openstack/types/cloudconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (
"github.com/kubermatic/machine-controller/pkg/ini"
)

// use-octavia is enabled by default in CCM since v1.17.0, and disabled by
// default with the in-tree cloud provider.
// https://v1-18.docs.kubernetes.io/docs/concepts/cluster-administration/cloud-providers/#load-balancer
// use-octavia is enabled by default in CCM since v1.17.0, and disabled by
// default with the in-tree cloud provider.
// https://v1-18.docs.kubernetes.io/docs/concepts/cluster-administration/cloud-providers/#load-balancer
const (
cloudConfigTpl = `[Global]
auth-url = {{ .Global.AuthURL | iniEscape }}
Expand Down Expand Up @@ -77,6 +77,11 @@ bs-version = {{ default "auto" .BlockStorage.BSVersion | iniEscape }}
{{- if .BlockStorage.NodeVolumeAttachLimit }}
node-volume-attach-limit = {{ .BlockStorage.NodeVolumeAttachLimit }}
{{- end }}
{{- if .Route.RouterID }}
[Router]
router-id = {{ .Route.RouterID }}
{{- end }}
`
)

Expand All @@ -103,6 +108,11 @@ type BlockStorageOpts struct {
NodeVolumeAttachLimit uint `gcfg:"node-volume-attach-limit"`
}

// RouterOpts is used for Neutron routes
type RouterOpts struct {
RouterID string `gcfg:"router-id"`
}

type GlobalOpts struct {
AuthURL string `gcfg:"auth-url"`
Username string
Expand All @@ -127,6 +137,7 @@ type CloudConfig struct {
Global GlobalOpts
LoadBalancer LoadBalancerOpts
BlockStorage BlockStorageOpts
Route RouterOpts
Version string
}

Expand Down

0 comments on commit b9555aa

Please sign in to comment.