Documentation
¶
Index ¶
- Constants
- Variables
- func BuildNodeToGroupMap(c rtclient.Client) (map[string]string, error)
- func GetComMatrixHeadersByFormat(format string) (string, error)
- func GetNodeRole(node *corev1.Node) (string, error)
- func IsSupportedTopology(topology configv1.TopologyMode) bool
- func ParsePortRangeHyphen(s string) (int, int, error)
- func ParsePortRangeSpace(s string) (int, int, error)
- func SupportedTopologiesList() []configv1.TopologyMode
- type ComDetails
- type ComMatrix
- func (m *ComMatrix) Contains(cd ComDetails) bool
- func (m *ComMatrix) SeparateMatrixByGroup() map[string]ComMatrix
- func (m *ComMatrix) SortAndRemoveDuplicates()
- func (m *ComMatrix) String() string
- func (m *ComMatrix) ToCSV() ([]byte, error)
- func (m *ComMatrix) ToJSON() ([]byte, error)
- func (m *ComMatrix) ToNFTables() ([]byte, error)
- func (m *ComMatrix) ToYAML() ([]byte, error)
- func (m *ComMatrix) WriteMatrixToFileByType(utilsHelpers utils.UtilsInterface, fileNamePrefix, format string, ...) error
- type ContainerInfo
- type DynamicRange
Constants ¶
const ( FormatJSON = "json" FormatYAML = "yaml" FormatCSV = "csv" FormatNFT = "nft" )
Variables ¶
var BaremetalStaticEntriesMaster = []ComDetails{ { Direction: "Ingress", Protocol: "TCP", Port: 53, NodeGroup: "master", Service: "dns-default", Namespace: "openshift-dns", Pod: "dnf-default", Container: "dns", Optional: false, }, { Direction: "Ingress", Protocol: "UDP", Port: 53, NodeGroup: "master", Service: "dns-default", Namespace: "openshift-dns", Pod: "dnf-default", Container: "dns", Optional: false, }, { Direction: "Ingress", Protocol: "TCP", Port: 9444, NodeGroup: "master", Service: "", Namespace: "openshift-kni-infra", Pod: "haproxy", Container: "haproxy", Optional: false, }, { Direction: "Ingress", Protocol: "TCP", Port: 9445, NodeGroup: "master", Service: "", Namespace: "openshift-kni-infra", Pod: "haproxy", Container: "haproxy", Optional: false, }, { Direction: "Ingress", Protocol: "TCP", Port: 9454, NodeGroup: "master", Service: "", Namespace: "openshift-kni-infra", Pod: "haproxy", Container: "haproxy", Optional: false, }, { Direction: "Ingress", Protocol: "TCP", Port: 18080, NodeGroup: "master", Service: "", Namespace: "openshift-kni-infra", Pod: "coredns", Container: "coredns", Optional: false, }, }
var BaremetalStaticEntriesWorker = []ComDetails{ { Direction: "Ingress", Protocol: "TCP", Port: 53, NodeGroup: "worker", Service: "dns-default", Namespace: "openshift-dns", Pod: "dnf-default", Container: "dns", Optional: false, }, { Direction: "Ingress", Protocol: "UDP", Port: 53, NodeGroup: "worker", Service: "dns-default", Namespace: "openshift-dns", Pod: "dnf-default", Container: "dns", Optional: false, }, { Direction: "Ingress", Protocol: "TCP", Port: 18080, NodeGroup: "worker", Service: "", Namespace: "openshift-kni-infra", Pod: "coredns", Container: "coredns", Optional: false, }, }
var GeneralIPv6StaticEntriesMaster = []ComDetails{ { Direction: "Ingress", Protocol: "UDP", Port: 546, NodeGroup: "master", Service: "NetworkManager", Namespace: "", Pod: "", Container: "", Optional: false, }, }
var GeneralIPv6StaticEntriesWorker = []ComDetails{ { Direction: "Ingress", Protocol: "UDP", Port: 546, NodeGroup: "worker", Service: "NetworkManager", Namespace: "", Pod: "", Container: "", Optional: false, }, }
General IPv6-only static entries that should be applied when the cluster supports IPv6.
var GeneralStaticEntriesMaster = []ComDetails{ { Direction: "Ingress", Protocol: "TCP", Port: 8080, NodeGroup: "master", Service: "", Namespace: "openshift-network-operator", Pod: "network-operator", Container: "network-operator", Optional: false, }, { Direction: "Ingress", Protocol: "TCP", Port: 10256, NodeGroup: "master", Service: "ovnkube", Namespace: "openshift-ovn-kubernetes", Pod: "ovnkube", Container: "ovnkube-controller", Optional: false, }, { Direction: "Ingress", Protocol: "TCP", Port: 10250, NodeGroup: "master", Service: "kubelet", Namespace: "Host system service", Pod: "", Container: "", Optional: false, }, { Direction: "Ingress", Protocol: "TCP", Port: 9107, NodeGroup: "master", Service: "egressip-node-healthcheck", Namespace: "openshift-ovn-kubernetes", Pod: "ovnkube-node", Container: "ovnkube-controller", Optional: false, }, { Direction: "Ingress", Protocol: "TCP", Port: 111, NodeGroup: "master", Service: "rpcbind", Namespace: "Host system service", Pod: "", Container: "", Optional: true, }, { Direction: "Ingress", Protocol: "UDP", Port: 111, NodeGroup: "master", Service: "rpcbind", Namespace: "Host system service", Pod: "", Container: "", Optional: true, }, { Direction: "Ingress", Protocol: "TCP", Port: 22, NodeGroup: "master", Service: "sshd", Namespace: "Host system service", Pod: "", Container: "", Optional: true, }, }
var GeneralStaticEntriesWorker = []ComDetails{ { Direction: "Ingress", Protocol: "TCP", Port: 22, NodeGroup: "worker", Service: "sshd", Namespace: "Host system service", Pod: "", Container: "", Optional: true, }, { Direction: "Ingress", Protocol: "TCP", Port: 10250, NodeGroup: "worker", Service: "kubelet", Namespace: "Host system service", Pod: "", Container: "", Optional: false, }, { Direction: "Ingress", Protocol: "TCP", Port: 9107, NodeGroup: "worker", Service: "egressip-node-healthcheck", Namespace: "openshift-ovn-kubernetes", Pod: "ovnkube-node", Container: "ovnkube-controller", Optional: false, }, { Direction: "Ingress", Protocol: "TCP", Port: 111, NodeGroup: "worker", Service: "rpcbind", Namespace: "Host system service", Pod: "", Container: "", Optional: true, }, { Direction: "Ingress", Protocol: "UDP", Port: 111, NodeGroup: "worker", Service: "rpcbind", Namespace: "Host system service", Pod: "", Container: "", Optional: true, }, { Direction: "Ingress", Protocol: "TCP", Port: 10256, NodeGroup: "worker", Service: "ovnkube", Namespace: "openshift-ovn-kubernetes", Pod: "ovnkube", Container: "ovnkube-controller", Optional: false, }, }
var KubeletNodePortDefaultDynamicRange = []DynamicRange{ { Direction: "Ingress", Protocol: "TCP", MinPort: 30000, MaxPort: 32767, Description: "Kubelet node ports", Optional: false, }, { Direction: "Ingress", Protocol: "UDP", MinPort: 30000, MaxPort: 32767, Description: "Kubelet node ports", Optional: false, }, }
var LinuxDynamicPrivateDefaultDynamicRange = []DynamicRange{ { Direction: "Ingress", Protocol: "TCP", MinPort: 32768, MaxPort: 60999, Description: "Linux dynamic/private ports", Optional: true, }, { Direction: "Ingress", Protocol: "UDP", MinPort: 32768, MaxPort: 60999, Description: "Linux dynamic/private ports", Optional: true, }, }
var StandardStaticEntries = []ComDetails{ { Direction: "Ingress", Protocol: "UDP", Port: 6081, NodeGroup: "worker", Service: "ovn-kubernetes geneve", Namespace: "openshift-ovn-kubernetes", Pod: "", Container: "", Optional: false, }, { Direction: "Ingress", Protocol: "UDP", Port: 6081, NodeGroup: "master", Service: "ovn-kubernetes geneve", Namespace: "openshift-ovn-kubernetes", Pod: "", Container: "", Optional: false, }, }
var SupportedPlatforms = []configv1.PlatformType{ configv1.AWSPlatformType, configv1.BareMetalPlatformType, configv1.NonePlatformType, }
Functions ¶
func BuildNodeToGroupMap ¶ added in v0.0.5
BuildNodeToGroupMap builds a node->group map for clusters without MCP: - Prefer HyperShift NodePool label when present. - Otherwise fall back to Kubernetes node role derived from labels.
func IsSupportedTopology ¶ added in v0.0.5
func IsSupportedTopology(topology configv1.TopologyMode) bool
IsSupportedTopology returns true if the given topology is supported by commatrix.
func ParsePortRangeHyphen ¶ added in v0.0.5
parsePortRangeHyphen parses strings like "MIN-MAX" (hyphen-separated) into numeric bounds.
func ParsePortRangeSpace ¶ added in v0.0.5
parsePortRangeSpace parses strings like "MIN MAX" (space-separated) into numeric bounds.
func SupportedTopologiesList ¶ added in v0.0.5
func SupportedTopologiesList() []configv1.TopologyMode
SupportedTopologiesList returns the list of supported topologies.
Types ¶
type ComDetails ¶
type ComDetails struct {
Direction string `json:"direction" yaml:"direction" csv:"Direction"`
Protocol string `json:"protocol" yaml:"protocol" csv:"Protocol"`
Port int `json:"port" yaml:"port" csv:"Port"`
Namespace string `json:"namespace" yaml:"namespace" csv:"Namespace"`
Service string `json:"service" yaml:"service" csv:"Service"`
Pod string `json:"pod" yaml:"pod" csv:"Pod"`
Container string `json:"container" yaml:"container" csv:"Container"`
NodeGroup string `json:"nodeGroup" yaml:"nodeGroup" csv:"NodeGroup"`
Optional bool `json:"optional" yaml:"optional" csv:"Optional"`
}
func (ComDetails) Equals ¶
func (cd ComDetails) Equals(other ComDetails) bool
func (ComDetails) String ¶
func (cd ComDetails) String() string
type ComMatrix ¶
type ComMatrix struct {
Ports []ComDetails
DynamicRanges []DynamicRange
}
func ParseToComMatrix ¶ added in v0.0.5
ParseToComMatrix parses input content in one of the supported formats (json, yaml, csv) and returns a ComMatrix that includes both ComDetails (Ports) and DynamicRanges.
func (*ComMatrix) Contains ¶
func (m *ComMatrix) Contains(cd ComDetails) bool
func (*ComMatrix) SeparateMatrixByGroup ¶ added in v0.0.5
SeparateMatrixByGroup groups matrix entries by their group name (stored in NodeGroup).
func (*ComMatrix) SortAndRemoveDuplicates ¶
func (m *ComMatrix) SortAndRemoveDuplicates()
SortAndRemoveDuplicates removes duplicates in the matrix and sort it.
func (*ComMatrix) ToNFTables ¶
func (*ComMatrix) WriteMatrixToFileByType ¶
type ContainerInfo ¶
type DynamicRange ¶ added in v0.0.5
type DynamicRange struct {
Direction string `json:"direction" yaml:"direction" csv:"Direction"`
Protocol string `json:"protocol" yaml:"protocol" csv:"Protocol"`
MinPort int `json:"minPort" yaml:"minPort" csv:"MinPort"`
MaxPort int `json:"maxPort" yaml:"maxPort" csv:"MaxPort"`
Description string `json:"description" yaml:"description" csv:"Description"`
Optional bool `json:"optional" yaml:"optional" csv:"Optional"`
}
func (*DynamicRange) PortRangeString ¶ added in v0.0.5
func (dr *DynamicRange) PortRangeString() string