Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
78f97b5
add monitor mode support
Mar 15, 2022
72b72af
add monitor mode support
Mar 15, 2022
7d3897d
fix upgrade incompatable problem
Mar 16, 2022
7544871
fix er policyrule dereference error
Mar 21, 2022
fc7f016
change ct commit table design
Mar 21, 2022
c2d2047
refactor: update work mode default value etc
Mar 22, 2022
117243b
fix: tier0 policy next table
Mar 23, 2022
357e29d
ci: add ci for all pull request branch
wu-cl Mar 22, 2022
b2612f9
test: fix test cases
wu-cl Mar 23, 2022
49a2567
fix: agent roundNum greater than maximum accepted value
Apr 12, 2022
3d5610a
feat: fetch and upload ct flow related policies
wu-cl Feb 24, 2022
5c8b39f
feat: add type for flow message
wu-cl Mar 1, 2022
b2c87a4
feat(exporter): modify ct label decode policy for new enforce mode
wu-cl Mar 22, 2022
270e24e
feat: add policy type for internal policy
wu-cl Apr 13, 2022
d14ddc6
style: fix lint error
wu-cl May 16, 2022
3af4e75
refactor(tower-plugin): add more types to support everoute-analyzer
zwtop Apr 1, 2022
652e9ac
feat(plugin-tower): support sync policy enforce mode from tower
zwtop Apr 1, 2022
fbb0157
test(plugin-tower): add testing host builder
zwtop May 5, 2022
71f735a
feat: record datapath controller id into /var/run/everoute
wu-cl May 17, 2022
f423952
feat: add rpc server for everoute exporter
wu-cl May 17, 2022
6999c1e
feat(collector): clear ct commit tables for collector if existed
wu-cl Jun 16, 2022
2a4b6e8
fix: move /var/run/everoute to /var/lib/everoute
wu-cl Jun 20, 2022
dc7d842
fix(collector): retrieve bridge name not vdsID in GetChainBridge
wu-cl Jun 23, 2022
26e6445
refactor: use component type and random seq as controller ID
wu-cl Jun 27, 2022
c3f86c0
feat(agent): clear related CT flows while policy modified
wu-cl Jul 5, 2022
0f838bc
test(e2e): reduce test log
wu-cl Aug 8, 2022
ce1888f
test: fix rebase errors
wu-cl Aug 9, 2022
74ea09f
refactor(cni): move pkt_mark for flow redirect from pos '0' to pos '29'
wu-cl Aug 5, 2022
f5c7a02
ci: update glangci-lint to v1.48.0
wu-cl Aug 9, 2022
3fac17a
ci: update e2e harbor to registry.smtx.io
wu-cl Aug 10, 2022
ec597d9
feat(dp): store local ofport into pkt_mark
wu-cl Aug 5, 2022
b00aaed
test: add test cases for monitor mode
wu-cl Aug 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: ci

on:
pull_request:
branches: [ main, release-1.0 ]
branches:
- '**'

push:
branches: [ main, release-1.0 ]
Expand Down Expand Up @@ -32,7 +33,7 @@ jobs:
- uses: actions/checkout@v2
- uses: golangci/golangci-lint-action@v2
with:
version: v1.45
version: v1.48.0
only-new-issues: true
# skip cache because of flaky behaviors
skip-build-cache: true
Expand All @@ -44,7 +45,7 @@ jobs:
- uses: actions/checkout@v2

- name: install e2e environment dependency
run: sudo sh -c "apt update && apt install -y openvswitch-switch && systemctl start openvswitch-switch"
run: sudo sh -c "apt update && apt install -y openvswitch-switch=2.13.* conntrack && systemctl start openvswitch-switch"

- name: allow ssh connect to localhost
run: sudo -H sh -c "ssh-keygen -qN '' </dev/zero; cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys"
Expand All @@ -61,7 +62,7 @@ jobs:
- uses: actions/checkout@v2

- name: clean old eveorute
run: sudo skaffold run -d=harbor.smartx.com/everoute -f skaffold-clean.yaml
run: sudo skaffold run -d=registry.smtx.io/everoute -f skaffold-clean.yaml

- name: wait clean process ready
run: kubectl wait po -n kube-system --for=condition=Ready=True -l app=everoute -l component=everoute-clean --timeout=3m
Expand All @@ -75,7 +76,7 @@ jobs:
run: kubectl delete -f hack/clean.yaml

- name: build everoute and deploy
run: sudo skaffold run -d=harbor.smartx.com/everoute
run: sudo skaffold run -d=registry.smtx.io/everoute

- name: wait everoute ready
run: bash hack/check_ready.sh
Expand All @@ -87,7 +88,7 @@ jobs:
path: "./kubernetes"

- name: apply e2e patch
run: cd kubernetes && git apply ../hack/0001-test-e2e-add-sleep-before-cannot-conntect-test.patch
run: cd kubernetes && git apply ../hack/0001-test-e2e-add-sleep-before-cannot-conntect-test.patch ../hack/0001-test-e2e-reduce-test-log.patch

- name: build e2e
run: cd kubernetes && make all WHAT=test/e2e/e2e.test && make all WHAT=vendor/github.com/onsi/ginkgo/ginkgo
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ gqlgen:

protopb:
protoc -I=. --go_out=plugins=grpc:. pkg/apis/cni/v1alpha1/cni.proto
protoc -I=. --go_out=plugins=grpc:. pkg/apis/rpc/v1alpha1/collector.proto

apidocs-gen:
$(eval PATH := $$(PATH):$(shell go env GOPATH)/bin)
Expand Down
5 changes: 3 additions & 2 deletions build/images/release/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.15 as builder
FROM golang:1.16 as builder

# Download deps
RUN mkdir -p $GOPATH/src/everoute
Expand Down Expand Up @@ -27,7 +27,8 @@ RUN chmod 755 /opt/everoute/bin/*
FROM ubuntu:20.04

#RUN apk update && apk add openvswitch
RUN apt update && apt install -y openvswitch-switch=2.13.* iptables iproute2 tcpdump && rm -rf /var/lib/apt/lists/*
RUN apt update && apt install -y openvswitch-switch=2.13.* iptables \
conntrack iproute2 tcpdump && rm -rf /var/lib/apt/lists/*

# Automatically detect iptables mode (legacy or nf_tables) from baseOS
RUN ln -s -f /opt/everoute/bin/iptables-wrapper /etc/alternatives/iptables
Expand Down
4 changes: 4 additions & 0 deletions cmd/everoute-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/everoute/everoute/pkg/agent/controller/policy"
"github.com/everoute/everoute/pkg/agent/datapath"
"github.com/everoute/everoute/pkg/agent/proxy"
"github.com/everoute/everoute/pkg/agent/rpcserver"
clientsetscheme "github.com/everoute/everoute/pkg/client/clientset_generated/clientset/scheme"
"github.com/everoute/everoute/pkg/constants"
"github.com/everoute/everoute/pkg/monitor"
Expand Down Expand Up @@ -132,6 +133,9 @@ func main() {
agentmonitor := monitor.NewAgentMonitor(k8sClient, ovsdbMonitor, ofPortIPAddrMoniotorChan)
go agentmonitor.Run(stopChan)

rpcServer := rpcserver.Initialize(datapathManager)
go rpcServer.Run(stopChan)

<-stopChan
}

Expand Down
3 changes: 1 addition & 2 deletions deploy/crds/security.everoute.io_globalpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ spec:
- Drop
type: string
globalPolicyEnforcementMode:
default: work
description: GlobalPolicy enforcement mode
type: string
required:
- globalPolicyEnforcementMode
type: object
type: object
served: true
Expand Down
51 changes: 0 additions & 51 deletions deploy/crds/security.everoute.io_policyenforcementmodes.yaml

This file was deleted.

1 change: 1 addition & 0 deletions deploy/crds/security.everoute.io_securitypolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,7 @@ spec:
type: string
type: array
securityPolicyEnforcementMode:
default: work
description: 'Work mode specify the policy enforcement state: monitor
or work'
type: string
Expand Down
9 changes: 1 addition & 8 deletions deploy/everoute-agent/agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ spec:
serviceAccountName: everoute-agent
containers:
- name: init-agent
command: [ "init_agent" ]
command: ["init_agent"]
image: everoute/release
imagePullPolicy: IfNotPresent
lifecycle:
Expand All @@ -70,8 +70,6 @@ spec:
mountPath: /var/lib/everoute/
- name: cni-bin
mountPath: /opt/cni/bin/
- name: everoute-run
mountPath: /var/run/everoute/
- name: cni-conf
mountPath: /etc/cni/net.d
- name: everoute-config
Expand Down Expand Up @@ -121,8 +119,6 @@ spec:
volumeMounts:
- name: everoute-agent
mountPath: /var/lib/everoute/
- name: everoute-run
mountPath: /var/run/everoute/
- name: everoute-config
mountPath: /var/lib/everoute/agentconfig.yaml
subPath: agentconfig.yaml
Expand Down Expand Up @@ -165,9 +161,6 @@ spec:
- hostPath:
path: /opt/cni/bin/
name: cni-bin
- name: everoute-run
hostPath:
path: /var/run/everoute
- hostPath:
path: /etc/cni/net.d
name: cni-conf
Expand Down
1 change: 0 additions & 1 deletion deploy/everoute-agent/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ rules:
resources:
- securitypolicies
- globalpolicies
- policyenforcementmodes
verbs:
- get
- list
Expand Down
1 change: 0 additions & 1 deletion deploy/everoute-controller/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ rules:
- endpoints
- endpoints/status
- globalpolicies
- policyenforcementmodes
verbs:
- patch
- create
Expand Down
66 changes: 3 additions & 63 deletions deploy/everoute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -720,10 +720,9 @@ spec:
- Drop
type: string
globalPolicyEnforcementMode:
default: work
description: GlobalPolicy enforcement mode
type: string
required:
- globalPolicyEnforcementMode
type: object
type: object
served: true
Expand All @@ -736,57 +735,6 @@ status:
conditions: []
storedVersions: []

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: policyenforcementmodes.security.everoute.io
spec:
group: security.everoute.io
names:
kind: PolicyEnforcementMode
listKind: PolicyEnforcementModeList
plural: policyenforcementmodes
singular: policyenforcementmode
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: Specification of the desired behavior for this SecurityPolicy.
properties:
defaultEnforcementMode:
type: string
enforcementMode:
type: string
type: object
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -1699,6 +1647,7 @@ spec:
type: string
type: array
securityPolicyEnforcementMode:
default: work
description: 'Work mode specify the policy enforcement state: monitor
or work'
type: string
Expand Down Expand Up @@ -1784,7 +1733,7 @@ spec:
serviceAccountName: everoute-agent
containers:
- name: init-agent
command: [ "init_agent" ]
command: ["init_agent"]
image: everoute/release
imagePullPolicy: IfNotPresent
lifecycle:
Expand All @@ -1798,8 +1747,6 @@ spec:
mountPath: /var/lib/everoute/
- name: cni-bin
mountPath: /opt/cni/bin/
- name: everoute-run
mountPath: /var/run/everoute/
- name: cni-conf
mountPath: /etc/cni/net.d
- name: everoute-config
Expand Down Expand Up @@ -1849,8 +1796,6 @@ spec:
volumeMounts:
- name: everoute-agent
mountPath: /var/lib/everoute/
- name: everoute-run
mountPath: /var/run/everoute/
- name: everoute-config
mountPath: /var/lib/everoute/agentconfig.yaml
subPath: agentconfig.yaml
Expand Down Expand Up @@ -1893,9 +1838,6 @@ spec:
- hostPath:
path: /opt/cni/bin/
name: cni-bin
- name: everoute-run
hostPath:
path: /var/run/everoute
- hostPath:
path: /etc/cni/net.d
name: cni-conf
Expand Down Expand Up @@ -1958,7 +1900,6 @@ rules:
resources:
- securitypolicies
- globalpolicies
- policyenforcementmodes
verbs:
- get
- list
Expand Down Expand Up @@ -2118,7 +2059,6 @@ rules:
- endpoints
- endpoints/status
- globalpolicies
- policyenforcementmodes
verbs:
- patch
- create
Expand Down
Loading