network

package
v0.0.0-...-1cd8678 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2024 License: Apache-2.0 Imports: 54 Imported by: 2

Documentation

Index

Constants

View Source
const (
	MinMTUIPv4 uint32 = 576  // RFC 791
	MinMTUIPv6 uint32 = 1280 // RFC 8200
	MaxMTU     uint32 = 65536
)
View Source
const (
	SystemCNIConfDir      = "/etc/kubernetes/cni/net.d"
	MultusCNIConfDir      = "/var/run/multus/cni/net.d"
	CNIBinDir             = "/var/lib/cni/bin"
	MultusSocketParentDir = "/run/multus"
)
View Source
const (
	OVSFlowsConfigMapName   = "ovs-flows-config"
	OVSFlowsConfigNamespace = names.APPLIED_NAMESPACE
)
View Source
const CLUSTER_CONFIG_NAME = "cluster-config-v1"
View Source
const CLUSTER_CONFIG_NAMESPACE = "kube-system"
View Source
const NetworkNodeIdentityNamespace = "openshift-network-node-identity"
View Source
const NetworkNodeIdentityWebhookPort = "9743"
View Source
const OVN_CERT_CN = "ovn"
View Source
const OVN_EGRESSIP_HEALTHCHECK_PORT = "9107"

gRPC healthcheck port. See: https://github.com/openshift/enhancements/pull/1209

View Source
const OVN_LOCAL_GW_MODE = "local"
View Source
const OVN_LOG_PATTERN_CONSOLE = "%D{%Y-%m-%dT%H:%M:%S.###Z}|%05N|%c%T|%p|%m"
View Source
const OVN_NODE_IDENTITY_CERT_DURATION = "24h"
View Source
const OVN_NODE_MODE_DPU = "dpu"
View Source
const OVN_NODE_MODE_DPU_HOST = "dpu-host"
View Source
const OVN_NODE_MODE_FULL = "full"
View Source
const OVN_NODE_MODE_SMART_NIC = "smart-nic"
View Source
const OVN_NODE_SELECTOR_DEFAULT_DPU = "network.operator.openshift.io/dpu"
View Source
const OVN_NODE_SELECTOR_DEFAULT_DPU_HOST = "network.operator.openshift.io/dpu-host"
View Source
const OVN_NODE_SELECTOR_DEFAULT_SMART_NIC = "network.operator.openshift.io/smart-nic"
View Source
const OVN_SHARED_GW_MODE = "shared"

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap(conf *operv1.Network, client cnoclient.Client) (*bootstrap.BootstrapResult, error)

Bootstrap creates resources required by SDN on the cloud.

func DeprecatedCanonicalize

func DeprecatedCanonicalize(conf *operv1.NetworkSpec)

DeprecatedCanonicalize converts configuration to a canonical form for backward compatibility.

*** DO NOT ADD ANY NEW CANONICALIZATION TO THIS FUNCTION! ***

Altering the user-provided configuration from CNO causes problems when other components need to look at the configuration before CNO starts. Users should just write the configuration in the correct form to begin with.

However, we cannot remove any of the existing canonicalizations because this might break existing clusters.

func FillDefaults

func FillDefaults(conf, previous *operv1.NetworkSpec, hostMTU int)

FillDefaults computes any default values and applies them to the configuration This is a mutating operation. It should be called after Validate.

Defaults are carried forward from previous if it is provided. This is so we can change defaults as we move forward, but won't disrupt existing clusters.

We may need to know the MTU of nodes in the cluster, so we can compute the correct underlay MTU (for OVN-K and OSDN).

func GetDefaultMTU

func GetDefaultMTU() (int, error)

GetDefaultMTU gets the mtu of the default route.

func GetIPsecMode

func GetIPsecMode(conf *operv1.OVNKubernetesConfig) operv1.IPsecMode

GetIPsecMode return the ipsec mode accounting for upgrade scenarios Find the IPsec mode from Ipsec.config Ipsec.config == nil (bw compatibility) || ipsecConfig == Off ==> ipsec is disabled ipsecConfig.mode == "" (bw compatibility) || ipsec.Config == Full ==> ipsec is enabled for NS and EW ipsecConfig.mode == External ==> ipsec is enabled for NS only

func GetInternalSubnets

func GetInternalSubnets(conf *operv1.OVNKubernetesConfig) (v4Subnet, v6Subnet string)

GetInternalSubnets returns internal subnet values for both IP families It returns default values if conf is nil or the subnets are not configured

func GetMasqueradeSubnet

func GetMasqueradeSubnet(conf *operv1.OVNKubernetesConfig) (v4Subnet, v6Subnet string)

GetMasqueradeSubnet returns masquerade subnet values for both IP families It returns default values if conf is nil or the subnets are not configured

func GetTransitSwitchSubnets

func GetTransitSwitchSubnets(conf *operv1.OVNKubernetesConfig) (v4Subnet, v6Subnet string)

GetTransitSwitchSubnets returns transit switch subnet values for both IP families It returns default values if conf is nil or the subnets are not configured

func IsChangeSafe

func IsChangeSafe(prev, next *operv1.NetworkSpec, infraStatus *bootstrap.InfraStatus) error

IsChangeSafe checks to see if the change between prev and next are allowed FillDefaults and Validate should have been called, but beware that prev may be from an older version.

func IsIPsecLegacyAPI

func IsIPsecLegacyAPI(conf *operv1.OVNKubernetesConfig) bool

IsIPsecLegacyAPI returns true if the old (pre 4.15) IPsec API is used, and false otherwise.

func MergeClusterConfig

func MergeClusterConfig(operConf *operv1.NetworkSpec, clusterConf configv1.NetworkSpec)

MergeClusterConfig merges the cluster configuration into the real CRD configuration.

func NeedMTUProbe

func NeedMTUProbe(prev, next *operv1.NetworkSpec) bool

NeedMTUProbe returns true if we need to probe the cluster's MTU. We need this if we don't have an MTU configured, either directly, or previously to "carry forward". If not, we'll have to probe it.

func Render

func Render(operConf *operv1.NetworkSpec, clusterConf *configv1.NetworkSpec, manifestDir string, client cnoclient.Client, featureGates featuregates.FeatureGate, bootstrapResult *bootstrap.BootstrapResult) ([]*uns.Unstructured, bool, error)

func StatusFromOperatorConfig

func StatusFromOperatorConfig(operConf *operv1.NetworkSpec, oldStatus *configv1.NetworkStatus) *configv1.NetworkStatus

StatusFromOperatorConfig generates the cluster NetworkStatus from the currently applied operator configuration.

func Validate

func Validate(conf *operv1.NetworkSpec) error

Validate checks that the supplied configuration is reasonable. This should be called after Canonicalize

func ValidateClusterConfig

func ValidateClusterConfig(clusterConfig *configv1.Network, client cnoclient.Client) error

ValidateClusterConfig ensures the cluster config is valid.

func ValidateLiveMigration

func ValidateLiveMigration(clusterConfig *configv1.Network, infraRes *bootstrap.InfraStatus, client cnoclient.Client) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL