Documentation ¶
Index ¶
- Constants
- func Bootstrap(conf *operv1.Network, client cnoclient.Client) (*bootstrap.BootstrapResult, error)
- func DeprecatedCanonicalize(conf *operv1.NetworkSpec)
- func FillDefaults(conf, previous *operv1.NetworkSpec, hostMTU int)
- func GetDefaultMTU() (int, error)
- func GetIPsecMode(conf *operv1.OVNKubernetesConfig) operv1.IPsecMode
- func GetInternalSubnets(conf *operv1.OVNKubernetesConfig) (v4Subnet, v6Subnet string)
- func GetMasqueradeSubnet(conf *operv1.OVNKubernetesConfig) (v4Subnet, v6Subnet string)
- func GetTransitSwitchSubnets(conf *operv1.OVNKubernetesConfig) (v4Subnet, v6Subnet string)
- func IsChangeSafe(prev, next *operv1.NetworkSpec, infraStatus *bootstrap.InfraStatus) error
- func IsIPsecLegacyAPI(conf *operv1.OVNKubernetesConfig) bool
- func MergeClusterConfig(operConf *operv1.NetworkSpec, clusterConf configv1.NetworkSpec)
- func NeedMTUProbe(prev, next *operv1.NetworkSpec) bool
- func Render(operConf *operv1.NetworkSpec, clusterConf *configv1.NetworkSpec, ...) ([]*uns.Unstructured, bool, error)
- func StatusFromOperatorConfig(operConf *operv1.NetworkSpec, oldStatus *configv1.NetworkStatus) *configv1.NetworkStatus
- func Validate(conf *operv1.NetworkSpec) error
- func ValidateClusterConfig(clusterConfig *configv1.Network, client cnoclient.Client) error
- func ValidateLiveMigration(clusterConfig *configv1.Network, infraRes *bootstrap.InfraStatus, ...) error
Constants ¶
const ( MinMTUIPv4 uint32 = 576 // RFC 791 MinMTUIPv6 uint32 = 1280 // RFC 8200 MaxMTU uint32 = 65536 )
const ( SystemCNIConfDir = "/etc/kubernetes/cni/net.d" MultusCNIConfDir = "/var/run/multus/cni/net.d" CNIBinDir = "/var/lib/cni/bin" MultusSocketParentDir = "/run/multus" )
const ( OVSFlowsConfigMapName = "ovs-flows-config" OVSFlowsConfigNamespace = names.APPLIED_NAMESPACE )
const CLUSTER_CONFIG_NAME = "cluster-config-v1"
const CLUSTER_CONFIG_NAMESPACE = "kube-system"
const NetworkNodeIdentityNamespace = "openshift-network-node-identity"
const NetworkNodeIdentityWebhookPort = "9743"
const OVN_CERT_CN = "ovn"
const OVN_EGRESSIP_HEALTHCHECK_PORT = "9107"
gRPC healthcheck port. See: https://github.com/openshift/enhancements/pull/1209
const OVN_LOCAL_GW_MODE = "local"
const OVN_LOG_PATTERN_CONSOLE = "%D{%Y-%m-%dT%H:%M:%S.###Z}|%05N|%c%T|%p|%m"
const OVN_NODE_IDENTITY_CERT_DURATION = "24h"
const OVN_NODE_MODE_DPU = "dpu"
const OVN_NODE_MODE_DPU_HOST = "dpu-host"
const OVN_NODE_MODE_FULL = "full"
const OVN_NODE_MODE_SMART_NIC = "smart-nic"
const OVN_NODE_SELECTOR_DEFAULT_DPU = "network.operator.openshift.io/dpu"
const OVN_NODE_SELECTOR_DEFAULT_DPU_HOST = "network.operator.openshift.io/dpu-host"
const OVN_NODE_SELECTOR_DEFAULT_SMART_NIC = "network.operator.openshift.io/smart-nic"
const OVN_SHARED_GW_MODE = "shared"
Variables ¶
This section is empty.
Functions ¶
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 ¶
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 ¶
ValidateClusterConfig ensures the cluster config is valid.
func ValidateLiveMigration ¶
Types ¶
This section is empty.