Skip to content

Commit

Permalink
feat: support api send and query.
Browse files Browse the repository at this point in the history
  • Loading branch information
IRONICBo committed Jun 3, 2024
1 parent 63576b7 commit fc9b23c
Show file tree
Hide file tree
Showing 23 changed files with 196 additions and 213 deletions.
20 changes: 12 additions & 8 deletions build/charts/antrea/templates/agent/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ metadata:
labels:
app: antrea
rules:
- apiGroups:
- stats.antrea.io
resources:
- networkpolicystats
- antreaclusternetworkpolicystats
- antreanetworkpolicystats
- nodeiplatencystats
verbs:
- get
- list
- create
- update
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -82,14 +94,6 @@ rules:
- nodestatssummaries
verbs:
- create
- apiGroups:
- controlplane.antrea.io
resources:
- nodeiplatencystats
verbs:
- create
- get
- list
- apiGroups:
- controlplane.antrea.io
resources:
Expand Down
4 changes: 3 additions & 1 deletion build/charts/antrea/templates/antctl/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ rules:
- networkpolicystats
- antreaclusternetworkpolicystats
- antreanetworkpolicystats
- nodeiplatencystat
- nodeiplatencystats
verbs:
- get
- list
- create
- update
- apiGroups:
- system.antrea.io
resources:
Expand Down
2 changes: 1 addition & 1 deletion build/images/Dockerfile.build.agent.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -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 env -w GOPROXY=https://goproxy.cn,direct;go mod download
go mod download

COPY . /antrea

Expand Down
2 changes: 1 addition & 1 deletion build/images/Dockerfile.build.agent.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -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 env -w GOPROXY=https://goproxy.cn,direct;go mod download
go mod download

COPY . /antrea

Expand Down
2 changes: 1 addition & 1 deletion build/images/Dockerfile.build.controller.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -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 env -w GOPROXY=https://goproxy.cn,direct;go mod download
go mod download

COPY . /antrea

Expand Down
2 changes: 1 addition & 1 deletion build/images/Dockerfile.build.controller.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -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 env -w GOPROXY=https://goproxy.cn,direct;go mod download
go mod download

COPY . /antrea

Expand Down
24 changes: 15 additions & 9 deletions build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4144,6 +4144,18 @@ metadata:
labels:
app: antrea
rules:
- apiGroups:
- stats.antrea.io
resources:
- networkpolicystats
- antreaclusternetworkpolicystats
- antreanetworkpolicystats
- nodeiplatencystats
verbs:
- get
- list
- create
- update
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -4221,14 +4233,6 @@ rules:
- nodestatssummaries
verbs:
- create
- apiGroups:
- controlplane.antrea.io
resources:
- nodeiplatencystats
verbs:
- create
- get
- list
- apiGroups:
- controlplane.antrea.io
resources:
Expand Down Expand Up @@ -4405,10 +4409,12 @@ rules:
- networkpolicystats
- antreaclusternetworkpolicystats
- antreanetworkpolicystats
- nodeiplatencystat
- nodeiplatencystats
verbs:
- get
- list
- create
- update
- apiGroups:
- system.antrea.io
resources:
Expand Down
24 changes: 15 additions & 9 deletions build/yamls/antrea-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4144,6 +4144,18 @@ metadata:
labels:
app: antrea
rules:
- apiGroups:
- stats.antrea.io
resources:
- networkpolicystats
- antreaclusternetworkpolicystats
- antreanetworkpolicystats
- nodeiplatencystats
verbs:
- get
- list
- create
- update
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -4221,14 +4233,6 @@ rules:
- nodestatssummaries
verbs:
- create
- apiGroups:
- controlplane.antrea.io
resources:
- nodeiplatencystats
verbs:
- create
- get
- list
- apiGroups:
- controlplane.antrea.io
resources:
Expand Down Expand Up @@ -4405,10 +4409,12 @@ rules:
- networkpolicystats
- antreaclusternetworkpolicystats
- antreanetworkpolicystats
- nodeiplatencystat
- nodeiplatencystats
verbs:
- get
- list
- create
- update
- apiGroups:
- system.antrea.io
resources:
Expand Down
24 changes: 15 additions & 9 deletions build/yamls/antrea-gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4144,6 +4144,18 @@ metadata:
labels:
app: antrea
rules:
- apiGroups:
- stats.antrea.io
resources:
- networkpolicystats
- antreaclusternetworkpolicystats
- antreanetworkpolicystats
- nodeiplatencystats
verbs:
- get
- list
- create
- update
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -4221,14 +4233,6 @@ rules:
- nodestatssummaries
verbs:
- create
- apiGroups:
- controlplane.antrea.io
resources:
- nodeiplatencystats
verbs:
- create
- get
- list
- apiGroups:
- controlplane.antrea.io
resources:
Expand Down Expand Up @@ -4405,10 +4409,12 @@ rules:
- networkpolicystats
- antreaclusternetworkpolicystats
- antreanetworkpolicystats
- nodeiplatencystat
- nodeiplatencystats
verbs:
- get
- list
- create
- update
- apiGroups:
- system.antrea.io
resources:
Expand Down
24 changes: 15 additions & 9 deletions build/yamls/antrea-ipsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4157,6 +4157,18 @@ metadata:
labels:
app: antrea
rules:
- apiGroups:
- stats.antrea.io
resources:
- networkpolicystats
- antreaclusternetworkpolicystats
- antreanetworkpolicystats
- nodeiplatencystats
verbs:
- get
- list
- create
- update
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -4234,14 +4246,6 @@ rules:
- nodestatssummaries
verbs:
- create
- apiGroups:
- controlplane.antrea.io
resources:
- nodeiplatencystats
verbs:
- create
- get
- list
- apiGroups:
- controlplane.antrea.io
resources:
Expand Down Expand Up @@ -4418,10 +4422,12 @@ rules:
- networkpolicystats
- antreaclusternetworkpolicystats
- antreanetworkpolicystats
- nodeiplatencystat
- nodeiplatencystats
verbs:
- get
- list
- create
- update
- apiGroups:
- system.antrea.io
resources:
Expand Down
24 changes: 15 additions & 9 deletions build/yamls/antrea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4144,6 +4144,18 @@ metadata:
labels:
app: antrea
rules:
- apiGroups:
- stats.antrea.io
resources:
- networkpolicystats
- antreaclusternetworkpolicystats
- antreanetworkpolicystats
- nodeiplatencystats
verbs:
- get
- list
- create
- update
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -4221,14 +4233,6 @@ rules:
- nodestatssummaries
verbs:
- create
- apiGroups:
- controlplane.antrea.io
resources:
- nodeiplatencystats
verbs:
- create
- get
- list
- apiGroups:
- controlplane.antrea.io
resources:
Expand Down Expand Up @@ -4405,10 +4409,12 @@ rules:
- networkpolicystats
- antreaclusternetworkpolicystats
- antreanetworkpolicystats
- nodeiplatencystat
- nodeiplatencystats
verbs:
- get
- list
- create
- update
- apiGroups:
- system.antrea.io
resources:
Expand Down
20 changes: 10 additions & 10 deletions cmd/antrea-agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion multicluster/build/images/Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -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 env -w GOPROXY=https://goproxy.cn,direct;go mod download
go mod download

COPY . /antrea

Expand Down
Loading

0 comments on commit fc9b23c

Please sign in to comment.