diff --git a/build/charts/antrea/templates/antctl/clusterrole.yaml b/build/charts/antrea/templates/antctl/clusterrole.yaml index 10c44d96a70..638a6b3813d 100644 --- a/build/charts/antrea/templates/antctl/clusterrole.yaml +++ b/build/charts/antrea/templates/antctl/clusterrole.yaml @@ -26,6 +26,7 @@ rules: - networkpolicystats - antreaclusternetworkpolicystats - antreanetworkpolicystats + - nodeiplatencystat verbs: - get - list diff --git a/build/images/Dockerfile.build.agent.ubi b/build/images/Dockerfile.build.agent.ubi index 3462ed1cd1e..300f67a6103 100644 --- a/build/images/Dockerfile.build.agent.ubi +++ b/build/images/Dockerfile.build.agent.ubi @@ -21,7 +21,7 @@ WORKDIR /antrea RUN --mount=type=cache,target=/go/pkg/mod/ \ --mount=type=bind,source=go.sum,target=go.sum \ --mount=type=bind,source=go.mod,target=go.mod \ - go mod download + go env -w GOPROXY=https://goproxy.cn,direct;go mod download COPY . /antrea diff --git a/build/images/Dockerfile.build.agent.ubuntu b/build/images/Dockerfile.build.agent.ubuntu index 4d1168aff46..c08c6b0cf85 100644 --- a/build/images/Dockerfile.build.agent.ubuntu +++ b/build/images/Dockerfile.build.agent.ubuntu @@ -21,7 +21,7 @@ WORKDIR /antrea RUN --mount=type=cache,target=/go/pkg/mod/ \ --mount=type=bind,source=go.sum,target=go.sum \ --mount=type=bind,source=go.mod,target=go.mod \ - go mod download + go env -w GOPROXY=https://goproxy.cn,direct;go mod download COPY . /antrea diff --git a/build/images/Dockerfile.build.controller.ubi b/build/images/Dockerfile.build.controller.ubi index d13b1105db8..ab2737acd2d 100644 --- a/build/images/Dockerfile.build.controller.ubi +++ b/build/images/Dockerfile.build.controller.ubi @@ -21,7 +21,7 @@ WORKDIR /antrea RUN --mount=type=cache,target=/go/pkg/mod/ \ --mount=type=bind,source=go.sum,target=go.sum \ --mount=type=bind,source=go.mod,target=go.mod \ - go mod download + go env -w GOPROXY=https://goproxy.cn,direct;go mod download COPY . /antrea diff --git a/build/images/Dockerfile.build.controller.ubuntu b/build/images/Dockerfile.build.controller.ubuntu index 9a2e03bfb21..30cfe66d49a 100644 --- a/build/images/Dockerfile.build.controller.ubuntu +++ b/build/images/Dockerfile.build.controller.ubuntu @@ -21,7 +21,7 @@ WORKDIR /antrea RUN --mount=type=cache,target=/go/pkg/mod/ \ --mount=type=bind,source=go.sum,target=go.sum \ --mount=type=bind,source=go.mod,target=go.mod \ - go mod download + go env -w GOPROXY=https://goproxy.cn,direct;go mod download COPY . /antrea diff --git a/build/yamls/antrea-aks.yml b/build/yamls/antrea-aks.yml index 0f47a969d7e..5627a1c0f25 100644 --- a/build/yamls/antrea-aks.yml +++ b/build/yamls/antrea-aks.yml @@ -4405,6 +4405,7 @@ rules: - networkpolicystats - antreaclusternetworkpolicystats - antreanetworkpolicystats + - nodeiplatencystat verbs: - get - list diff --git a/build/yamls/antrea-eks.yml b/build/yamls/antrea-eks.yml index d0f3c89881b..c7d5ebac697 100644 --- a/build/yamls/antrea-eks.yml +++ b/build/yamls/antrea-eks.yml @@ -4405,6 +4405,7 @@ rules: - networkpolicystats - antreaclusternetworkpolicystats - antreanetworkpolicystats + - nodeiplatencystat verbs: - get - list diff --git a/build/yamls/antrea-gke.yml b/build/yamls/antrea-gke.yml index 0781d60e8ff..fb187ce0646 100644 --- a/build/yamls/antrea-gke.yml +++ b/build/yamls/antrea-gke.yml @@ -4405,6 +4405,7 @@ rules: - networkpolicystats - antreaclusternetworkpolicystats - antreanetworkpolicystats + - nodeiplatencystat verbs: - get - list diff --git a/build/yamls/antrea-ipsec.yml b/build/yamls/antrea-ipsec.yml index 9cc5b9a7d18..f899d6b7696 100644 --- a/build/yamls/antrea-ipsec.yml +++ b/build/yamls/antrea-ipsec.yml @@ -4418,6 +4418,7 @@ rules: - networkpolicystats - antreaclusternetworkpolicystats - antreanetworkpolicystats + - nodeiplatencystat verbs: - get - list diff --git a/build/yamls/antrea.yml b/build/yamls/antrea.yml index 4a888867f20..b9e761f2a65 100644 --- a/build/yamls/antrea.yml +++ b/build/yamls/antrea.yml @@ -4405,6 +4405,7 @@ rules: - networkpolicystats - antreaclusternetworkpolicystats - antreanetworkpolicystats + - nodeiplatencystat verbs: - get - list diff --git a/cmd/antrea-agent/agent.go b/cmd/antrea-agent/agent.go index 831b01198e8..46e7e1c9e86 100644 --- a/cmd/antrea-agent/agent.go +++ b/cmd/antrea-agent/agent.go @@ -934,16 +934,16 @@ func run(o *Options) error { } // Start the node latency monitor. - if features.DefaultFeatureGate.Enabled(features.NodeLatencyMonitor) && o.nodeType == config.K8sNode { - nodeLatencyMonitor := monitortool.NewNodeLatencyMonitor( - antreaClientProvider, - nodeInformer, - nodeLatencyMonitorInformer, - nodeConfig, - networkConfig.TrafficEncapMode, - ) - go nodeLatencyMonitor.Run(stopCh) - } + // if features.DefaultFeatureGate.Enabled(features.NodeLatencyMonitor) && o.nodeType == config.K8sNode { + nodeLatencyMonitor := monitortool.NewNodeLatencyMonitor( + antreaClientProvider, + nodeInformer, + nodeLatencyMonitorInformer, + nodeConfig, + networkConfig.TrafficEncapMode, + ) + go nodeLatencyMonitor.Run(stopCh) + // } <-stopCh klog.Info("Stopping Antrea agent") diff --git a/multicluster/build/images/Dockerfile.build b/multicluster/build/images/Dockerfile.build index f4225c1a726..52e77280246 100644 --- a/multicluster/build/images/Dockerfile.build +++ b/multicluster/build/images/Dockerfile.build @@ -20,7 +20,7 @@ WORKDIR /antrea RUN --mount=type=cache,target=/go/pkg/mod/ \ --mount=type=bind,source=go.sum,target=go.sum \ --mount=type=bind,source=go.mod,target=go.mod \ - go mod download + go env -w GOPROXY=https://goproxy.cn,direct;go mod download COPY . /antrea diff --git a/multicluster/hack/update-codegen-dockerized.sh b/multicluster/hack/update-codegen-dockerized.sh index df6103efdd2..74ed1d26f6a 100755 --- a/multicluster/hack/update-codegen-dockerized.sh +++ b/multicluster/hack/update-codegen-dockerized.sh @@ -43,14 +43,14 @@ function generate_multicluster_client_code { --input "multicluster/v1alpha2" \ --output-package "${ANTREA_PKG}/multicluster/pkg/client/clientset" \ --go-header-file hack/boilerplate/license_header.go.txt - + # Generate listers with K8s codegen tools. $GOPATH/bin/lister-gen \ --input-dirs "${ANTREA_PKG}/multicluster/apis/multicluster/v1alpha1" \ --input-dirs "${ANTREA_PKG}/multicluster/apis/multicluster/v1alpha2" \ --output-package "${ANTREA_PKG}/multicluster/pkg/client/listers" \ --go-header-file hack/boilerplate/license_header.go.txt - + # Generate informers with K8s codegen tools. $GOPATH/bin/informer-gen \ --input-dirs "${ANTREA_PKG}/multicluster/apis/multicluster/v1alpha1" \ diff --git a/pkg/apis/controlplane/register.go b/pkg/apis/controlplane/register.go index 11255483640..10da9773424 100644 --- a/pkg/apis/controlplane/register.go +++ b/pkg/apis/controlplane/register.go @@ -67,7 +67,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &SupportBundleCollection{}, &SupportBundleCollectionList{}, &SupportBundleCollectionStatus{}, - // &NodeIPLatencyStat{}, ) return nil } diff --git a/pkg/apis/controlplane/types.go b/pkg/apis/controlplane/types.go index 515445ac017..d5c601287e8 100644 --- a/pkg/apis/controlplane/types.go +++ b/pkg/apis/controlplane/types.go @@ -408,31 +408,6 @@ type NodeStatsSummary struct { Multicast []MulticastGroupInfo } -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// NodeIPLatencyStat contains the latency stat of a Node. -type NodeIPLatencyStat struct { - metav1.TypeMeta - metav1.ObjectMeta - - // The list of NodeIPLatency. - NodeIPLatencyList []NodeIPLatencyEntry -} - -// NodeIPLatencyEntry contains the latency stats of a Node. -type NodeIPLatencyEntry struct { - // The Node's name. - NodeName string - // The Node's target IP address. - TargetIP string - // The timestamp of the last send packet. - LastSendTime int64 - // The timestamp of the last receive packet. - LastRecvTime int64 - // The last valid rtt of the Node. - LastMeasuredRTT int64 -} - // MulticastGroupInfo contains the list of Pods that have joined a multicast group, for a given Node. type MulticastGroupInfo struct { // Group is the IP of the multicast group. diff --git a/pkg/apis/stats/v1alpha1/generated.pb.go b/pkg/apis/stats/v1alpha1/generated.pb.go index 97c8feb6c68..972b05eeb80 100644 --- a/pkg/apis/stats/v1alpha1/generated.pb.go +++ b/pkg/apis/stats/v1alpha1/generated.pb.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -264,10 +264,94 @@ func (m *NetworkPolicyStatsList) XXX_DiscardUnknown() { var xxx_messageInfo_NetworkPolicyStatsList proto.InternalMessageInfo +func (m *NodeIPLatencyEntry) Reset() { *m = NodeIPLatencyEntry{} } +func (*NodeIPLatencyEntry) ProtoMessage() {} +func (*NodeIPLatencyEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_91b517c6fa558473, []int{8} +} +func (m *NodeIPLatencyEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NodeIPLatencyEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NodeIPLatencyEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeIPLatencyEntry.Merge(m, src) +} +func (m *NodeIPLatencyEntry) XXX_Size() int { + return m.Size() +} +func (m *NodeIPLatencyEntry) XXX_DiscardUnknown() { + xxx_messageInfo_NodeIPLatencyEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeIPLatencyEntry proto.InternalMessageInfo + +func (m *NodeIPLatencyStat) Reset() { *m = NodeIPLatencyStat{} } +func (*NodeIPLatencyStat) ProtoMessage() {} +func (*NodeIPLatencyStat) Descriptor() ([]byte, []int) { + return fileDescriptor_91b517c6fa558473, []int{9} +} +func (m *NodeIPLatencyStat) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NodeIPLatencyStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NodeIPLatencyStat) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeIPLatencyStat.Merge(m, src) +} +func (m *NodeIPLatencyStat) XXX_Size() int { + return m.Size() +} +func (m *NodeIPLatencyStat) XXX_DiscardUnknown() { + xxx_messageInfo_NodeIPLatencyStat.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeIPLatencyStat proto.InternalMessageInfo + +func (m *NodeIPLatencyStatList) Reset() { *m = NodeIPLatencyStatList{} } +func (*NodeIPLatencyStatList) ProtoMessage() {} +func (*NodeIPLatencyStatList) Descriptor() ([]byte, []int) { + return fileDescriptor_91b517c6fa558473, []int{10} +} +func (m *NodeIPLatencyStatList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NodeIPLatencyStatList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *NodeIPLatencyStatList) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeIPLatencyStatList.Merge(m, src) +} +func (m *NodeIPLatencyStatList) XXX_Size() int { + return m.Size() +} +func (m *NodeIPLatencyStatList) XXX_DiscardUnknown() { + xxx_messageInfo_NodeIPLatencyStatList.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeIPLatencyStatList proto.InternalMessageInfo + func (m *PodReference) Reset() { *m = PodReference{} } func (*PodReference) ProtoMessage() {} func (*PodReference) Descriptor() ([]byte, []int) { - return fileDescriptor_91b517c6fa558473, []int{8} + return fileDescriptor_91b517c6fa558473, []int{11} } func (m *PodReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -295,7 +379,7 @@ var xxx_messageInfo_PodReference proto.InternalMessageInfo func (m *RuleTrafficStats) Reset() { *m = RuleTrafficStats{} } func (*RuleTrafficStats) ProtoMessage() {} func (*RuleTrafficStats) Descriptor() ([]byte, []int) { - return fileDescriptor_91b517c6fa558473, []int{9} + return fileDescriptor_91b517c6fa558473, []int{12} } func (m *RuleTrafficStats) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -323,7 +407,7 @@ var xxx_messageInfo_RuleTrafficStats proto.InternalMessageInfo func (m *TrafficStats) Reset() { *m = TrafficStats{} } func (*TrafficStats) ProtoMessage() {} func (*TrafficStats) Descriptor() ([]byte, []int) { - return fileDescriptor_91b517c6fa558473, []int{10} + return fileDescriptor_91b517c6fa558473, []int{13} } func (m *TrafficStats) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -357,6 +441,9 @@ func init() { proto.RegisterType((*MulticastGroupList)(nil), "antrea_io.antrea.pkg.apis.stats.v1alpha1.MulticastGroupList") proto.RegisterType((*NetworkPolicyStats)(nil), "antrea_io.antrea.pkg.apis.stats.v1alpha1.NetworkPolicyStats") proto.RegisterType((*NetworkPolicyStatsList)(nil), "antrea_io.antrea.pkg.apis.stats.v1alpha1.NetworkPolicyStatsList") + proto.RegisterType((*NodeIPLatencyEntry)(nil), "antrea_io.antrea.pkg.apis.stats.v1alpha1.NodeIPLatencyEntry") + proto.RegisterType((*NodeIPLatencyStat)(nil), "antrea_io.antrea.pkg.apis.stats.v1alpha1.NodeIPLatencyStat") + proto.RegisterType((*NodeIPLatencyStatList)(nil), "antrea_io.antrea.pkg.apis.stats.v1alpha1.NodeIPLatencyStatList") proto.RegisterType((*PodReference)(nil), "antrea_io.antrea.pkg.apis.stats.v1alpha1.PodReference") proto.RegisterType((*RuleTrafficStats)(nil), "antrea_io.antrea.pkg.apis.stats.v1alpha1.RuleTrafficStats") proto.RegisterType((*TrafficStats)(nil), "antrea_io.antrea.pkg.apis.stats.v1alpha1.TrafficStats") @@ -367,51 +454,64 @@ func init() { } var fileDescriptor_91b517c6fa558473 = []byte{ - // 704 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0x4f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26, 0xf5, - 0x19, 0x31, 0x1e, 0x64, 0xc3, 0x8a, 0xfe, 0x95, 0x21, 0x75, 0x59, 0x7a, 0x9f, 0xfe, 0x4f, 0xc3, - 0x2a, 0xcd, 0x91, 0x83, 0x64, 0x31, 0xf5, 0x0f, 0x00, 0x4e, 0x3c, 0x80, 0x05, 0x70, 0xa6, 0xbf, - 0xe7, 0x77, 0x00, 0xe6, 0xdc, 0xe8, 0x26, 0x9c, 0x0f, 0xa9, 0xdb, 0x67, 0x4a, 0x1a, 0x9e, 0x65, - 0xe7, 0xbf, 0xb4, 0xca, 0x7c, 0x2b, 0x31, 0x93, 0x91, 0x5f, 0xbf, 0x30, 0xed, 0x7d, 0xc5, 0x12, - 0x9a, 0xe5, 0x6c, 0xd8, 0x8e, 0x36, 0x92, 0xc4, 0x87, 0x6e, 0xc1, 0x05, 0xc9, 0xa4, 0xe4, 0x22, - 0xd0, 0xaf, 0x8c, 0x8e, 0x3b, 0xdb, 0xfe, 0x6e, 0x6a, 0x27, 0x67, 0x11, 0x4e, 0xf3, 0xf0, 0xd4, - 0x2a, 0x1d, 0x9d, 0x5a, 0xa5, 0xe3, 0x53, 0xab, 0x74, 0x30, 0xb4, 0xc0, 0xe1, 0xd0, 0x02, 0x47, - 0x43, 0x0b, 0x1c, 0x0f, 0x2d, 0xf0, 0x79, 0x68, 0x81, 0xf7, 0x5f, 0xac, 0xd2, 0xf3, 0x46, 0xd1, - 0xbf, 0xd3, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x73, 0x1f, 0x1a, 0xcb, 0x79, 0x0b, 0x00, 0x00, + // 898 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0xce, 0x24, 0xad, 0xb6, 0x9d, 0x0d, 0xb4, 0x1d, 0xf1, 0x23, 0x54, 0xc8, 0xad, 0xb2, 0x97, + 0x20, 0x81, 0x4d, 0x57, 0x68, 0x55, 0x01, 0x97, 0x35, 0x42, 0xa8, 0x52, 0x1b, 0xa2, 0x69, 0x0e, + 0x08, 0x81, 0xd8, 0xa9, 0xfd, 0xea, 0x9a, 0x24, 0x1e, 0xcb, 0x33, 0x29, 0xca, 0x6d, 0x39, 0x70, + 0xe3, 0xc0, 0x5f, 0x01, 0xff, 0x4a, 0x8f, 0xcb, 0x89, 0xe5, 0xb2, 0xa2, 0x41, 0x48, 0x5c, 0x11, + 0x17, 0x8e, 0x68, 0xc6, 0xe3, 0xd8, 0xae, 0x55, 0xd5, 0xbb, 0x5a, 0x85, 0x03, 0x7b, 0x8a, 0x3d, + 0xef, 0x7d, 0xef, 0x7b, 0x3f, 0xbe, 0x37, 0x49, 0xf0, 0x3e, 0x8b, 0x64, 0x02, 0xcc, 0x0e, 0xb9, + 0x93, 0x3e, 0x39, 0xf1, 0x28, 0x70, 0x58, 0x1c, 0x0a, 0x47, 0x48, 0x26, 0x85, 0x73, 0xbe, 0xc7, + 0xc6, 0xf1, 0x19, 0xdb, 0x73, 0x02, 0x88, 0x20, 0x61, 0x12, 0x7c, 0x3b, 0x4e, 0xb8, 0xe4, 0xa4, + 0x97, 0xfa, 0x7f, 0x15, 0x72, 0xdb, 0xc4, 0x88, 0x47, 0x81, 0xad, 0x90, 0xb6, 0x46, 0xda, 0x19, + 0x72, 0xfb, 0x9d, 0x20, 0x94, 0x67, 0xd3, 0x13, 0xdb, 0xe3, 0x13, 0x27, 0xe0, 0x01, 0x77, 0x74, + 0x80, 0x93, 0xe9, 0xa9, 0x7e, 0xd3, 0x2f, 0xfa, 0x29, 0x0d, 0xbc, 0xfd, 0xde, 0x68, 0x5f, 0xe8, + 0x7c, 0xe2, 0x70, 0xc2, 0xbc, 0xb3, 0x30, 0x82, 0x64, 0x96, 0x67, 0x35, 0x01, 0xc9, 0x9c, 0xf3, + 0x4a, 0x3a, 0xdb, 0xce, 0x75, 0xa8, 0x64, 0x1a, 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 0x2d, 0xc4, 0xc1, 0xeb, 0xea, 0x53, 0xc4, 0xcc, 0x03, 0xa3, 0xfa, + 0x2d, 0xe3, 0xb6, 0xde, 0xcf, 0x0c, 0x34, 0xf7, 0xe9, 0xfe, 0x88, 0x70, 0xe5, 0x87, 0x40, 0x0d, + 0x9e, 0xe5, 0xdf, 0x77, 0xdf, 0x23, 0x5c, 0x32, 0x93, 0xb7, 0xf0, 0xad, 0x98, 0x79, 0x23, 0x90, + 0x42, 0xe7, 0xd9, 0x72, 0x37, 0x4c, 0x94, 0x5b, 0x83, 0xf4, 0x98, 0x66, 0x76, 0xf5, 0x4d, 0x7b, + 0x32, 0x93, 0x90, 0xa6, 0xd9, 0xca, 0x9b, 0xed, 0xaa, 0x43, 0x9a, 0xda, 0xd4, 0x7d, 0x21, 0x40, + 0x88, 0x90, 0x47, 0xc2, 0x6c, 0xff, 0x62, 0xf8, 0xc7, 0xe6, 0x9c, 0x2e, 0x3c, 0xdc, 0xfe, 0xc5, + 0xa5, 0xd5, 0x78, 0x74, 0x69, 0x35, 0x1e, 0x5f, 0x5a, 0x8d, 0x87, 0x73, 0x0b, 0x5d, 0xcc, 0x2d, + 0xf4, 0x68, 0x6e, 0xa1, 0xc7, 0x73, 0x0b, 0xfd, 0x36, 0xb7, 0xd0, 0x0f, 0xbf, 0x5b, 0x8d, 0xcf, + 0x7b, 0x75, 0xff, 0x56, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x59, 0xb1, 0x8d, 0x08, 0x81, 0x0e, + 0x00, 0x00, } func (m *AntreaClusterNetworkPolicyStats) Marshal() (dAtA []byte, err error) { @@ -811,6 +911,142 @@ func (m *NetworkPolicyStatsList) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *NodeIPLatencyEntry) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NodeIPLatencyEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeIPLatencyEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.LastMeasuredRTT)) + i-- + dAtA[i] = 0x28 + i = encodeVarintGenerated(dAtA, i, uint64(m.LastRecvTime)) + i-- + dAtA[i] = 0x20 + i = encodeVarintGenerated(dAtA, i, uint64(m.LastSendTime)) + i-- + dAtA[i] = 0x18 + i -= len(m.TargetIP) + copy(dAtA[i:], m.TargetIP) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.TargetIP))) + i-- + dAtA[i] = 0x12 + i -= len(m.NodeName) + copy(dAtA[i:], m.NodeName) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.NodeName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *NodeIPLatencyStat) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NodeIPLatencyStat) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeIPLatencyStat) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NodeIPLatencyList) > 0 { + for iNdEx := len(m.NodeIPLatencyList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NodeIPLatencyList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *NodeIPLatencyStatList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NodeIPLatencyStatList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NodeIPLatencyStatList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Items) > 0 { + for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *PodReference) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1063,6 +1299,56 @@ func (m *NetworkPolicyStatsList) Size() (n int) { return n } +func (m *NodeIPLatencyEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.NodeName) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.TargetIP) + n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.LastSendTime)) + n += 1 + sovGenerated(uint64(m.LastRecvTime)) + n += 1 + sovGenerated(uint64(m.LastMeasuredRTT)) + return n +} + +func (m *NodeIPLatencyStat) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ObjectMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.NodeIPLatencyList) > 0 { + for _, e := range m.NodeIPLatencyList { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *NodeIPLatencyStatList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ListMeta.Size() + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + func (m *PodReference) Size() (n int) { if m == nil { return 0 @@ -1233,6 +1519,52 @@ func (this *NetworkPolicyStatsList) String() string { }, "") return s } +func (this *NodeIPLatencyEntry) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NodeIPLatencyEntry{`, + `NodeName:` + fmt.Sprintf("%v", this.NodeName) + `,`, + `TargetIP:` + fmt.Sprintf("%v", this.TargetIP) + `,`, + `LastSendTime:` + fmt.Sprintf("%v", this.LastSendTime) + `,`, + `LastRecvTime:` + fmt.Sprintf("%v", this.LastRecvTime) + `,`, + `LastMeasuredRTT:` + fmt.Sprintf("%v", this.LastMeasuredRTT) + `,`, + `}`, + }, "") + return s +} +func (this *NodeIPLatencyStat) String() string { + if this == nil { + return "nil" + } + repeatedStringForNodeIPLatencyList := "[]NodeIPLatencyEntry{" + for _, f := range this.NodeIPLatencyList { + repeatedStringForNodeIPLatencyList += strings.Replace(strings.Replace(f.String(), "NodeIPLatencyEntry", "NodeIPLatencyEntry", 1), `&`, ``, 1) + "," + } + repeatedStringForNodeIPLatencyList += "}" + s := strings.Join([]string{`&NodeIPLatencyStat{`, + `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, + `NodeIPLatencyList:` + repeatedStringForNodeIPLatencyList + `,`, + `}`, + }, "") + return s +} +func (this *NodeIPLatencyStatList) String() string { + if this == nil { + return "nil" + } + repeatedStringForItems := "[]NodeIPLatencyStat{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "NodeIPLatencyStat", "NodeIPLatencyStat", 1), `&`, ``, 1) + "," + } + repeatedStringForItems += "}" + s := strings.Join([]string{`&NodeIPLatencyStatList{`, + `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, + `Items:` + repeatedStringForItems + `,`, + `}`, + }, "") + return s +} func (this *PodReference) String() string { if this == nil { return "nil" @@ -2308,6 +2640,411 @@ func (m *NetworkPolicyStatsList) Unmarshal(dAtA []byte) error { } return nil } +func (m *NodeIPLatencyEntry) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NodeIPLatencyEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NodeIPLatencyEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NodeName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetIP", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TargetIP = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LastSendTime", wireType) + } + m.LastSendTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LastSendTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LastRecvTime", wireType) + } + m.LastRecvTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LastRecvTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LastMeasuredRTT", wireType) + } + m.LastMeasuredRTT = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LastMeasuredRTT |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NodeIPLatencyStat) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NodeIPLatencyStat: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NodeIPLatencyStat: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NodeIPLatencyList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NodeIPLatencyList = append(m.NodeIPLatencyList, NodeIPLatencyEntry{}) + if err := m.NodeIPLatencyList[len(m.NodeIPLatencyList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NodeIPLatencyStatList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NodeIPLatencyStatList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NodeIPLatencyStatList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, NodeIPLatencyStat{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *PodReference) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/pkg/apis/stats/v1alpha1/generated.proto b/pkg/apis/stats/v1alpha1/generated.proto index dd18b35deae..2283fdd742e 100644 --- a/pkg/apis/stats/v1alpha1/generated.proto +++ b/pkg/apis/stats/v1alpha1/generated.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -98,6 +98,40 @@ message NetworkPolicyStatsList { repeated NetworkPolicyStats items = 2; } +// NodeIPLatencyEntry contains the latency stats of a Node. +message NodeIPLatencyEntry { + // The Node's name. + optional string nodeName = 1; + + // The Node's target IP address. + optional string targetIP = 2; + + // The timestamp of the last send packet. + optional int64 lastSendTime = 3; + + // The timestamp of the last receive packet. + optional int64 lastRecvTime = 4; + + // The last valid rtt of the Node. + optional int64 lastMeasuredRTT = 5; +} + +// NodeIPLatencyStat contains the latency stat of a Node. +message NodeIPLatencyStat { + optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta objectMeta = 1; + + // The list of NodeIPLatency. + repeated NodeIPLatencyEntry nodeIPLatencyList = 2; +} + +// NodeIPLatencyStatList is a list of NodeIPLatencyStat objects. +message NodeIPLatencyStatList { + optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta listMeta = 1; + + // The list of NodeIPLatencyStat. + repeated NodeIPLatencyStat items = 2; +} + // PodReference represents a Pod Reference. message PodReference { // The name of this Pod. diff --git a/pkg/apis/stats/v1alpha1/register.go b/pkg/apis/stats/v1alpha1/register.go index fcdb9032339..a45e3ad959d 100644 --- a/pkg/apis/stats/v1alpha1/register.go +++ b/pkg/apis/stats/v1alpha1/register.go @@ -49,6 +49,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &NetworkPolicyStatsList{}, &MulticastGroup{}, &MulticastGroupList{}, + &NodeIPLatencyStat{}, + &NodeIPLatencyStatList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/pkg/apis/stats/v1alpha1/types.go b/pkg/apis/stats/v1alpha1/types.go index c36f63a8a26..dd6755b3206 100644 --- a/pkg/apis/stats/v1alpha1/types.go +++ b/pkg/apis/stats/v1alpha1/types.go @@ -146,3 +146,42 @@ type RuleTrafficStats struct { Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` TrafficStats TrafficStats `json:"trafficStats,omitempty" protobuf:"bytes,2,opt,name=trafficStats"` } + +// +genclient +// +resourceName=nodeiplatencystats +// +genclient:readonly +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// NodeIPLatencyStat contains the latency stat of a Node. +type NodeIPLatencyStat struct { + metav1.TypeMeta + metav1.ObjectMeta `protobuf:"bytes,1,opt,name=objectMeta"` + + // The list of NodeIPLatency. + NodeIPLatencyList []NodeIPLatencyEntry `protobuf:"bytes,2,rep,name=nodeIPLatencyList"` +} + +// NodeIPLatencyEntry contains the latency stats of a Node. +type NodeIPLatencyEntry struct { + // The Node's name. + NodeName string `protobuf:"bytes,1,opt,name=nodeName"` + // The Node's target IP address. + TargetIP string `protobuf:"bytes,2,opt,name=targetIP"` + // The timestamp of the last send packet. + LastSendTime int64 `protobuf:"varint,3,opt,name=lastSendTime"` + // The timestamp of the last receive packet. + LastRecvTime int64 `protobuf:"varint,4,opt,name=lastRecvTime"` + // The last valid rtt of the Node. + LastMeasuredRTT int64 `protobuf:"varint,5,opt,name=lastMeasuredRTT"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// NodeIPLatencyStatList is a list of NodeIPLatencyStat objects. +type NodeIPLatencyStatList struct { + metav1.TypeMeta + metav1.ListMeta `protobuf:"bytes,1,opt,name=listMeta"` + + // The list of NodeIPLatencyStat. + Items []NodeIPLatencyStat `protobuf:"bytes,2,rep,name=items"` +} diff --git a/pkg/apis/stats/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/stats/v1alpha1/zz_generated.deepcopy.go index d1c3417a338..64f3be9c67a 100644 --- a/pkg/apis/stats/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/stats/v1alpha1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ //go:build !ignore_autogenerated // +build !ignore_autogenerated -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -277,6 +277,86 @@ func (in *NetworkPolicyStatsList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeIPLatencyEntry) DeepCopyInto(out *NodeIPLatencyEntry) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeIPLatencyEntry. +func (in *NodeIPLatencyEntry) DeepCopy() *NodeIPLatencyEntry { + if in == nil { + return nil + } + out := new(NodeIPLatencyEntry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeIPLatencyStat) DeepCopyInto(out *NodeIPLatencyStat) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.NodeIPLatencyList != nil { + in, out := &in.NodeIPLatencyList, &out.NodeIPLatencyList + *out = make([]NodeIPLatencyEntry, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeIPLatencyStat. +func (in *NodeIPLatencyStat) DeepCopy() *NodeIPLatencyStat { + if in == nil { + return nil + } + out := new(NodeIPLatencyStat) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NodeIPLatencyStat) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeIPLatencyStatList) DeepCopyInto(out *NodeIPLatencyStatList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NodeIPLatencyStat, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeIPLatencyStatList. +func (in *NodeIPLatencyStatList) DeepCopy() *NodeIPLatencyStatList { + if in == nil { + return nil + } + out := new(NodeIPLatencyStatList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NodeIPLatencyStatList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PodReference) DeepCopyInto(out *PodReference) { *out = *in diff --git a/pkg/apiserver/apiserver.go b/pkg/apiserver/apiserver.go index 1dba25bbdd5..4cf272d3a58 100644 --- a/pkg/apiserver/apiserver.go +++ b/pkg/apiserver/apiserver.go @@ -58,6 +58,7 @@ import ( "antrea.io/antrea/pkg/apiserver/registry/stats/antreanetworkpolicystats" "antrea.io/antrea/pkg/apiserver/registry/stats/multicastgroup" "antrea.io/antrea/pkg/apiserver/registry/stats/networkpolicystats" + "antrea.io/antrea/pkg/apiserver/registry/stats/nodelatencystat" "antrea.io/antrea/pkg/apiserver/registry/system/controllerinfo" "antrea.io/antrea/pkg/apiserver/registry/system/supportbundle" "antrea.io/antrea/pkg/apiserver/storage" @@ -240,6 +241,7 @@ func installAPIGroup(s *APIServer, c completedConfig) error { statsStorage["antreaclusternetworkpolicystats"] = antreaclusternetworkpolicystats.NewREST(c.extraConfig.statsAggregator) statsStorage["antreanetworkpolicystats"] = antreanetworkpolicystats.NewREST(c.extraConfig.statsAggregator) statsStorage["multicastgroups"] = multicastgroup.NewREST(c.extraConfig.statsAggregator) + statsStorage["nodeiplatency"] = nodelatencystat.NewREST() statsGroup.VersionedResourcesStorageMap["v1alpha1"] = statsStorage groups := []*genericapiserver.APIGroupInfo{&cpGroup, &systemGroup, &statsGroup} diff --git a/pkg/apiserver/openapi/zz_generated.openapi.go b/pkg/apiserver/openapi/zz_generated.openapi.go index 2350ef80363..1f5fe986731 100644 --- a/pkg/apiserver/openapi/zz_generated.openapi.go +++ b/pkg/apiserver/openapi/zz_generated.openapi.go @@ -163,6 +163,9 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "antrea.io/antrea/pkg/apis/stats/v1alpha1.MulticastGroupList": schema_pkg_apis_stats_v1alpha1_MulticastGroupList(ref), "antrea.io/antrea/pkg/apis/stats/v1alpha1.NetworkPolicyStats": schema_pkg_apis_stats_v1alpha1_NetworkPolicyStats(ref), "antrea.io/antrea/pkg/apis/stats/v1alpha1.NetworkPolicyStatsList": schema_pkg_apis_stats_v1alpha1_NetworkPolicyStatsList(ref), + "antrea.io/antrea/pkg/apis/stats/v1alpha1.NodeIPLatencyEntry": schema_pkg_apis_stats_v1alpha1_NodeIPLatencyEntry(ref), + "antrea.io/antrea/pkg/apis/stats/v1alpha1.NodeIPLatencyStat": schema_pkg_apis_stats_v1alpha1_NodeIPLatencyStat(ref), + "antrea.io/antrea/pkg/apis/stats/v1alpha1.NodeIPLatencyStatList": schema_pkg_apis_stats_v1alpha1_NodeIPLatencyStatList(ref), "antrea.io/antrea/pkg/apis/stats/v1alpha1.PodReference": schema_pkg_apis_stats_v1alpha1_PodReference(ref), "antrea.io/antrea/pkg/apis/stats/v1alpha1.RuleTrafficStats": schema_pkg_apis_stats_v1alpha1_RuleTrafficStats(ref), "antrea.io/antrea/pkg/apis/stats/v1alpha1.TrafficStats": schema_pkg_apis_stats_v1alpha1_TrafficStats(ref), @@ -6673,6 +6676,144 @@ func schema_pkg_apis_stats_v1alpha1_NetworkPolicyStatsList(ref common.ReferenceC } } +func schema_pkg_apis_stats_v1alpha1_NodeIPLatencyEntry(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeIPLatencyEntry contains the latency stats of a Node.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "NodeName": { + SchemaProps: spec.SchemaProps{ + Description: "The Node's name.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "TargetIP": { + SchemaProps: spec.SchemaProps{ + Description: "The Node's target IP address.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "LastSendTime": { + SchemaProps: spec.SchemaProps{ + Description: "The timestamp of the last send packet.", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + "LastRecvTime": { + SchemaProps: spec.SchemaProps{ + Description: "The timestamp of the last receive packet.", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + "LastMeasuredRTT": { + SchemaProps: spec.SchemaProps{ + Description: "The last valid rtt of the Node.", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + Required: []string{"NodeName", "TargetIP", "LastSendTime", "LastRecvTime", "LastMeasuredRTT"}, + }, + }, + } +} + +func schema_pkg_apis_stats_v1alpha1_NodeIPLatencyStat(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeIPLatencyStat contains the latency stat of a Node.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "TypeMeta": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"), + }, + }, + "ObjectMeta": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "NodeIPLatencyList": { + SchemaProps: spec.SchemaProps{ + Description: "The list of NodeIPLatency.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("antrea.io/antrea/pkg/apis/stats/v1alpha1.NodeIPLatencyEntry"), + }, + }, + }, + }, + }, + }, + Required: []string{"TypeMeta", "ObjectMeta", "NodeIPLatencyList"}, + }, + }, + Dependencies: []string{ + "antrea.io/antrea/pkg/apis/stats/v1alpha1.NodeIPLatencyEntry", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"}, + } +} + +func schema_pkg_apis_stats_v1alpha1_NodeIPLatencyStatList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeIPLatencyStatList is a list of NodeIPLatencyStat objects.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "TypeMeta": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"), + }, + }, + "ListMeta": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "Items": { + SchemaProps: spec.SchemaProps{ + Description: "The list of NodeIPLatencyStat.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("antrea.io/antrea/pkg/apis/stats/v1alpha1.NodeIPLatencyStat"), + }, + }, + }, + }, + }, + }, + Required: []string{"TypeMeta", "ListMeta", "Items"}, + }, + }, + Dependencies: []string{ + "antrea.io/antrea/pkg/apis/stats/v1alpha1.NodeIPLatencyStat", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta"}, + } +} + func schema_pkg_apis_stats_v1alpha1_PodReference(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/pkg/apiserver/registry/controlplane/nodelatencystat/rest.go b/pkg/apiserver/registry/controlplane/nodelatencystat/rest.go deleted file mode 100644 index 58e6ae6c1a6..00000000000 --- a/pkg/apiserver/registry/controlplane/nodelatencystat/rest.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2024 Antrea Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package nodelatencystat - -// import ( -// "context" - -// "antrea.io/antrea/pkg/apis/controlplane" -// metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -// v1 "k8s.io/apimachinery/pkg/apis/meta/v1" -// "k8s.io/apimachinery/pkg/runtime" -// "k8s.io/apiserver/pkg/registry/rest" -// ) - -// // nodeLatencyCollector is the interface required by the handler. -// type nodeLatencyCollector interface { -// Collect(summary *controlplane.NodeIPLatencyStat) -// Get(name string) *controlplane.NodeIPLatencyStat -// List() []*controlplane.NodeIPLatencyStat -// } - -// type REST struct { -// nodeLatencyCollector nodeLatencyCollector -// } - -// var ( -// _ rest.Scoper = &REST{} -// _ rest.Getter = &REST{} -// _ rest.SingularNameProvider = &REST{} -// _ rest.Creater = &REST{} -// ) - -// // NewREST returns a REST object that will work against API services. -// func NewREST(c nodeLatencyCollector) *REST { -// return &REST{c} -// } - -// func (r *REST) New() runtime.Object { -// return &controlplane.NodeIPLatencyStat{} -// } - -// func (r *REST) Destroy() { -// } - -// func (r *REST) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *v1.CreateOptions) (runtime.Object, error) { -// // Try to store the NodeIPLatencyStat in the store. -// summary := obj.(*controlplane.NodeIPLatencyStat) -// r.nodeLatencyCollector.Collect(summary) -// // a valid runtime.Object must be returned, otherwise the client would throw error. -// return &controlplane.NodeIPLatencyStat{}, nil -// } - -// func (r *REST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) { -// // Try to retrieve the NodeIPLatencyStat from the store. -// entry := r.nodeLatencyCollector.Get(name) -// return entry, nil -// } - -// func (r *REST) NamespaceScoped() bool { -// return false -// } - -// func (r *REST) GetSingularName() string { -// return "nodeiplatencystat" -// } diff --git a/pkg/apiserver/registry/stats/networkpolicystats/rest.go b/pkg/apiserver/registry/stats/networkpolicystats/rest.go index 44737e2ca13..dd8304217bd 100644 --- a/pkg/apiserver/registry/stats/networkpolicystats/rest.go +++ b/pkg/apiserver/registry/stats/networkpolicystats/rest.go @@ -92,6 +92,18 @@ func (r *REST) List(ctx context.Context, options *internalversion.ListOptions) ( items = append(items, stats[i]) } } + // Add a mock one + items = append(items, statsv1alpha1.NetworkPolicyStats{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "foo", + Name: "bar", + }, + TrafficStats: statsv1alpha1.TrafficStats{ + Sessions: 1, + Packets: 2, + Bytes: 3, + }, + }) metricList := &statsv1alpha1.NetworkPolicyStatsList{ Items: items, } diff --git a/pkg/apiserver/registry/stats/nodelatencystat/rest.go b/pkg/apiserver/registry/stats/nodelatencystat/rest.go new file mode 100644 index 00000000000..ebf66eb2983 --- /dev/null +++ b/pkg/apiserver/registry/stats/nodelatencystat/rest.go @@ -0,0 +1,182 @@ +// Copyright 2024 Antrea Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package nodelatencystat + +import ( + "context" + "fmt" + + statsv1alpha1 "antrea.io/antrea/pkg/apis/stats/v1alpha1" + "k8s.io/apimachinery/pkg/api/meta" + metatable "k8s.io/apimachinery/pkg/api/meta/table" + "k8s.io/apimachinery/pkg/apis/meta/internalversion" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apiserver/pkg/registry/rest" + "k8s.io/client-go/tools/cache" + "k8s.io/klog/v2" +) + +// nodeLatencyCollector is the interface required by the handler. +type nodeLatencyCollector interface { + Collect(summary *statsv1alpha1.NodeIPLatencyStat) + Get(name string) *statsv1alpha1.NodeIPLatencyStat + List() []statsv1alpha1.NodeIPLatencyStat +} + +type REST struct { + nodeLatencyCollector nodeLatencyCollector +} + +// nodeLatencyCollectorImpl implements nodeLatencyCollector. +type nodeLatencyCollectorImpl struct { + nodeLatencyStats cache.Indexer + dataCh chan *statsv1alpha1.NodeIPLatencyStat +} + +func (n *nodeLatencyCollectorImpl) Collect(summary *statsv1alpha1.NodeIPLatencyStat) { + n.dataCh <- summary +} + +func (n *nodeLatencyCollectorImpl) doCollect(summary *statsv1alpha1.NodeIPLatencyStat) { + n.nodeLatencyStats.Update(summary) +} + +func (n *nodeLatencyCollectorImpl) Get(name string) *statsv1alpha1.NodeIPLatencyStat { + obj, exists, err := n.nodeLatencyStats.GetByKey(name) + if err != nil || !exists { + return nil + } + return obj.(*statsv1alpha1.NodeIPLatencyStat) +} + +func (n *nodeLatencyCollectorImpl) List() []statsv1alpha1.NodeIPLatencyStat { + objs := n.nodeLatencyStats.List() + entries := make([]statsv1alpha1.NodeIPLatencyStat, len(objs)) + for i := range objs { + entries[i] = *(objs[i].(*statsv1alpha1.NodeIPLatencyStat)) + } + return entries +} + +var ( + _ rest.Storage = &REST{} + _ rest.Scoper = &REST{} + _ rest.Getter = &REST{} + _ rest.Lister = &REST{} + _ rest.SingularNameProvider = &REST{} +) + +const ( + uidIndex = "uid" + GroupNameIndexName = "groupName" +) + +// uidIndexFunc is an index function that indexes based on an object's UID. +func uidIndexFunc(obj interface{}) ([]string, error) { + meta, err := meta.Accessor(obj) + if err != nil { + return []string{""}, fmt.Errorf("object has no meta: %v", err) + } + return []string{string(meta.GetUID())}, nil +} + +// NewREST returns a REST object that will work against API services. +func NewREST() *REST { + nodeLatencyCollector := &nodeLatencyCollectorImpl{ + nodeLatencyStats: cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc, uidIndex: uidIndexFunc}), + dataCh: make(chan *statsv1alpha1.NodeIPLatencyStat, 1000), + } + + go func() { + for summary := range nodeLatencyCollector.dataCh { + // Store the NodeIPLatencyStat in the store. + nodeLatencyCollector.doCollect(summary) + } + }() + + return &REST{ + nodeLatencyCollector: &nodeLatencyCollectorImpl{ + nodeLatencyStats: cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc, uidIndex: uidIndexFunc}), + dataCh: make(chan *statsv1alpha1.NodeIPLatencyStat, 1000), + }, + } +} + +func (r *REST) New() runtime.Object { + return &statsv1alpha1.NodeIPLatencyStat{} +} + +func (r *REST) Destroy() { +} + +func (r *REST) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error) { + // Try to store the NodeIPLatencyStat in the store. + summary := obj.(*statsv1alpha1.NodeIPLatencyStat) + r.nodeLatencyCollector.Collect(summary) + klog.InfoS("NodeIPLatencyStat created", "name", summary.Name) + // a valid runtime.Object must be returned, otherwise the client would throw error. + return &statsv1alpha1.NodeIPLatencyStat{}, nil +} + +func (r *REST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error) { + // Try to retrieve the NodeIPLatencyStat from the store. + entry := r.nodeLatencyCollector.Get(name) + return entry, nil +} + +func (r *REST) NewList() runtime.Object { + return &statsv1alpha1.NodeIPLatencyStatList{} +} + +func (r *REST) List(ctx context.Context, options *internalversion.ListOptions) (runtime.Object, error) { + // Try to retrieve the NodeIPLatencyStat from the store. + entries := r.nodeLatencyCollector.List() + klog.InfoS("NodeIPLatencyStat list", "entries", entries) + return &statsv1alpha1.NodeIPLatencyStatList{Items: entries}, nil +} + +func (r *REST) ConvertToTable(ctx context.Context, obj runtime.Object, tableOptions runtime.Object) (*metav1.Table, error) { + // Convert the NodeIPLatencyStat to a Table object. + table := &metav1.Table{ + ColumnDefinitions: []metav1.TableColumnDefinition{ + {Name: "SourceNodeName", Type: "string", Format: "name", Description: "Source node name."}, + {Name: "NodeIPLatencyList", Type: "array", Format: "string", Description: "Node IP latency list."}, + }, + } + if m, err := meta.ListAccessor(obj); err == nil { + table.ResourceVersion = m.GetResourceVersion() + table.Continue = m.GetContinue() + table.RemainingItemCount = m.GetRemainingItemCount() + } else { + if m, err := meta.CommonAccessor(obj); err == nil { + table.ResourceVersion = m.GetResourceVersion() + } + } + var err error + table.Rows, err = metatable.MetaToTableRow(obj, func(obj runtime.Object, m metav1.Object, name, age string) ([]interface{}, error) { + summary := obj.(*statsv1alpha1.NodeIPLatencyStat) + return []interface{}{name, summary.NodeIPLatencyList}, nil + }) + return table, err +} + +func (r *REST) NamespaceScoped() bool { + return false +} + +func (r *REST) GetSingularName() string { + return "nodeiplatencystat" +} diff --git a/pkg/apiserver/registry/controlplane/nodelatencystat/rest_test.go b/pkg/apiserver/registry/stats/nodelatencystat/rest_test.go similarity index 100% rename from pkg/apiserver/registry/controlplane/nodelatencystat/rest_test.go rename to pkg/apiserver/registry/stats/nodelatencystat/rest_test.go diff --git a/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_nodeiplatencystat.go b/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_nodeiplatencystat.go new file mode 100644 index 00000000000..e2558209216 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_nodeiplatencystat.go @@ -0,0 +1,77 @@ +// Copyright 2024 Antrea Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1alpha1 "antrea.io/antrea/pkg/apis/stats/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeNodeIPLatencyStats implements NodeIPLatencyStatInterface +type FakeNodeIPLatencyStats struct { + Fake *FakeStatsV1alpha1 + ns string +} + +var nodeiplatencystatsResource = v1alpha1.SchemeGroupVersion.WithResource("nodeiplatencystats") + +var nodeiplatencystatsKind = v1alpha1.SchemeGroupVersion.WithKind("NodeIPLatencyStat") + +// Get takes name of the nodeIPLatencyStat, and returns the corresponding nodeIPLatencyStat object, and an error if there is any. +func (c *FakeNodeIPLatencyStats) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NodeIPLatencyStat, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(nodeiplatencystatsResource, c.ns, name), &v1alpha1.NodeIPLatencyStat{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.NodeIPLatencyStat), err +} + +// List takes label and field selectors, and returns the list of NodeIPLatencyStats that match those selectors. +func (c *FakeNodeIPLatencyStats) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NodeIPLatencyStatList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(nodeiplatencystatsResource, nodeiplatencystatsKind, c.ns, opts), &v1alpha1.NodeIPLatencyStatList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.NodeIPLatencyStatList{ListMeta: obj.(*v1alpha1.NodeIPLatencyStatList).ListMeta} + for _, item := range obj.(*v1alpha1.NodeIPLatencyStatList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested nodeIPLatencyStats. +func (c *FakeNodeIPLatencyStats) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(nodeiplatencystatsResource, c.ns, opts)) + +} diff --git a/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_stats_client.go b/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_stats_client.go index 1d4a10166fd..f339063e840 100644 --- a/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_stats_client.go +++ b/pkg/client/clientset/versioned/typed/stats/v1alpha1/fake/fake_stats_client.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -42,6 +42,10 @@ func (c *FakeStatsV1alpha1) NetworkPolicyStats(namespace string) v1alpha1.Networ return &FakeNetworkPolicyStats{c, namespace} } +func (c *FakeStatsV1alpha1) NodeIPLatencyStats(namespace string) v1alpha1.NodeIPLatencyStatInterface { + return &FakeNodeIPLatencyStats{c, namespace} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeStatsV1alpha1) RESTClient() rest.Interface { diff --git a/pkg/client/clientset/versioned/typed/stats/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/stats/v1alpha1/generated_expansion.go index 152ec4a23fa..cc7dd3685b8 100644 --- a/pkg/client/clientset/versioned/typed/stats/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/stats/v1alpha1/generated_expansion.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,3 +23,5 @@ type AntreaNetworkPolicyStatsExpansion interface{} type MulticastGroupExpansion interface{} type NetworkPolicyStatsExpansion interface{} + +type NodeIPLatencyStatExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/stats/v1alpha1/nodeiplatencystat.go b/pkg/client/clientset/versioned/typed/stats/v1alpha1/nodeiplatencystat.go new file mode 100644 index 00000000000..dbcb3655038 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/stats/v1alpha1/nodeiplatencystat.go @@ -0,0 +1,101 @@ +// Copyright 2024 Antrea Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1alpha1 "antrea.io/antrea/pkg/apis/stats/v1alpha1" + scheme "antrea.io/antrea/pkg/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// NodeIPLatencyStatsGetter has a method to return a NodeIPLatencyStatInterface. +// A group's client should implement this interface. +type NodeIPLatencyStatsGetter interface { + NodeIPLatencyStats(namespace string) NodeIPLatencyStatInterface +} + +// NodeIPLatencyStatInterface has methods to work with NodeIPLatencyStat resources. +type NodeIPLatencyStatInterface interface { + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.NodeIPLatencyStat, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.NodeIPLatencyStatList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + NodeIPLatencyStatExpansion +} + +// nodeIPLatencyStats implements NodeIPLatencyStatInterface +type nodeIPLatencyStats struct { + client rest.Interface + ns string +} + +// newNodeIPLatencyStats returns a NodeIPLatencyStats +func newNodeIPLatencyStats(c *StatsV1alpha1Client, namespace string) *nodeIPLatencyStats { + return &nodeIPLatencyStats{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the nodeIPLatencyStat, and returns the corresponding nodeIPLatencyStat object, and an error if there is any. +func (c *nodeIPLatencyStats) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NodeIPLatencyStat, err error) { + result = &v1alpha1.NodeIPLatencyStat{} + err = c.client.Get(). + Namespace(c.ns). + Resource("nodeiplatencystats"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of NodeIPLatencyStats that match those selectors. +func (c *nodeIPLatencyStats) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NodeIPLatencyStatList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.NodeIPLatencyStatList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("nodeiplatencystats"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested nodeIPLatencyStats. +func (c *nodeIPLatencyStats) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("nodeiplatencystats"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} diff --git a/pkg/client/clientset/versioned/typed/stats/v1alpha1/stats_client.go b/pkg/client/clientset/versioned/typed/stats/v1alpha1/stats_client.go index 88d009e10a9..8fd9e3f0485 100644 --- a/pkg/client/clientset/versioned/typed/stats/v1alpha1/stats_client.go +++ b/pkg/client/clientset/versioned/typed/stats/v1alpha1/stats_client.go @@ -1,4 +1,4 @@ -// Copyright 2022 Antrea Authors +// Copyright 2024 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,6 +30,7 @@ type StatsV1alpha1Interface interface { AntreaNetworkPolicyStatsGetter MulticastGroupsGetter NetworkPolicyStatsGetter + NodeIPLatencyStatsGetter } // StatsV1alpha1Client is used to interact with features provided by the stats.antrea.io group. @@ -53,6 +54,10 @@ func (c *StatsV1alpha1Client) NetworkPolicyStats(namespace string) NetworkPolicy return newNetworkPolicyStats(c, namespace) } +func (c *StatsV1alpha1Client) NodeIPLatencyStats(namespace string) NodeIPLatencyStatInterface { + return newNodeIPLatencyStats(c, namespace) +} + // NewForConfig creates a new StatsV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c).