Skip to content

Commit

Permalink
Merge pull request #1636 from runcom/start-services-ovn-ovs
Browse files Browse the repository at this point in the history
Start openvswitch and ovsdb-server when network is ovn/ovs
  • Loading branch information
openshift-merge-robot committed Jun 16, 2020
2 parents 274e5cd + be883a8 commit 8b3e260
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/machine-config-operator/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ func runBootstrapCmd(cmd *cobra.Command, args []string) {
bootstrapOpts.additionalTrustBundleFile,
bootstrapOpts.proxyConfigFile,
bootstrapOpts.configFile,
bootstrapOpts.infraConfigFile, bootstrapOpts.networkConfigFile,
bootstrapOpts.infraConfigFile,
bootstrapOpts.networkConfigFile,
bootstrapOpts.cloudConfigFile,
bootstrapOpts.cloudProviderCAFile,
bootstrapOpts.etcdCAFile, bootstrapOpts.etcdMetricCAFile, bootstrapOpts.rootCAFile, bootstrapOpts.kubeCAFile, bootstrapOpts.pullSecretFile,
Expand Down
1 change: 1 addition & 0 deletions lib/resourcemerge/machineconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func ensureControllerConfigSpec(modified *bool, existing *mcfgv1.ControllerConfi
setStringIfSet(modified, &existing.Platform, required.Platform)
setStringIfSet(modified, &existing.EtcdDiscoveryDomain, required.EtcdDiscoveryDomain)
setStringIfSet(modified, &existing.OSImageURL, required.OSImageURL)
setStringIfSet(modified, &existing.NetworkType, required.NetworkType)

setBytesIfSet(modified, &existing.AdditionalTrustBundle, required.AdditionalTrustBundle)
setBytesIfSet(modified, &existing.EtcdCAData, required.EtcdCAData)
Expand Down
3 changes: 3 additions & 0 deletions manifests/controllerconfig.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ spec:
description: kubeletIPv6 is true to force a single-stack IPv6 kubelet
config
type: boolean
networkType:
description: networkType holds the type of network the cluster is using
type: string
osImageURL:
description: osImageURL is the location of the container image that
contains the OS update payload. Its value is taken from the data.osImageURL
Expand Down
7 changes: 7 additions & 0 deletions pkg/apis/machineconfiguration.openshift.io/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ type ControllerConfigSpec struct {

// kubeletIPv6 is true to force a single-stack IPv6 kubelet config
KubeletIPv6 bool `json:"kubeletIPv6,omitempty"`

// networkType holds the type of network the cluster is using
// XXX: this is temporary and will be dropped as soon as possible in favor of a better support
// to start network related services the proper way.
// Nobody is also changing this once the cluster is up and running the first time, so, disallow
// regeneration if this changes.
NetworkType string `json:"networkType,omitempty"`
}

// ControllerConfigStatus is the status for ControllerConfig
Expand Down
3 changes: 3 additions & 0 deletions pkg/operator/assets/bindata.go
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,9 @@ spec:
description: kubeletIPv6 is true to force a single-stack IPv6 kubelet
config
type: boolean
networkType:
description: networkType holds the type of network the cluster is using
type: string
osImageURL:
description: osImageURL is the location of the container image that
contains the OS update payload. Its value is taken from the data.osImageURL
Expand Down
1 change: 1 addition & 0 deletions pkg/operator/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func createDiscoveredControllerConfigSpec(infra *configv1.Infrastructure, networ
}

ccSpec := &mcfgv1.ControllerConfigSpec{
NetworkType: network.Spec.NetworkType,
ClusterDNSIP: dnsIP,
KubeletIPv6: ipv6,
CloudProviderConfig: "",
Expand Down
2 changes: 2 additions & 0 deletions templates/common/_base/units/openvswitch.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: "openvswitch.service"
enabled: {{if eq .NetworkType "OVNKubernetes"}}true{{else if eq .NetworkType "OpenShiftSDN"}}true{{else}}false{{end}}
2 changes: 2 additions & 0 deletions templates/common/_base/units/ovsdb-server.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: "ovsdb-server.service"
enabled: {{if eq .NetworkType "OVNKubernetes"}}true{{else if eq .NetworkType "OpenShiftSDN"}}true{{else}}false{{end}}

0 comments on commit 8b3e260

Please sign in to comment.