Skip to content

Commit

Permalink
Add egress status of api and Update codegen of egress status
Browse files Browse the repository at this point in the history
  • Loading branch information
wenqiq committed Jun 3, 2021
1 parent 913963c commit 0bbc99f
Show file tree
Hide file tree
Showing 16 changed files with 231 additions and 59 deletions.
14 changes: 14 additions & 0 deletions build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,10 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- description: The Owner Node of egress IP
jsonPath: .status.nodeName
name: Status
type: string
name: v1alpha2
schema:
openAPIV3Schema:
Expand Down Expand Up @@ -1414,11 +1418,18 @@ spec:
- appliedTo
- egressIP
type: object
status:
properties:
nodeName:
type: string
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -3199,10 +3210,13 @@ rules:
- crd.antrea.io
resources:
- egresses
- egresses/status
verbs:
- get
- watch
- list
- update
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
14 changes: 14 additions & 0 deletions build/yamls/antrea-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,10 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- description: The Owner Node of egress IP
jsonPath: .status.nodeName
name: Status
type: string
name: v1alpha2
schema:
openAPIV3Schema:
Expand Down Expand Up @@ -1414,11 +1418,18 @@ spec:
- appliedTo
- egressIP
type: object
status:
properties:
nodeName:
type: string
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -3199,10 +3210,13 @@ rules:
- crd.antrea.io
resources:
- egresses
- egresses/status
verbs:
- get
- watch
- list
- update
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
14 changes: 14 additions & 0 deletions build/yamls/antrea-gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,10 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- description: The Owner Node of egress IP
jsonPath: .status.nodeName
name: Status
type: string
name: v1alpha2
schema:
openAPIV3Schema:
Expand Down Expand Up @@ -1414,11 +1418,18 @@ spec:
- appliedTo
- egressIP
type: object
status:
properties:
nodeName:
type: string
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -3199,10 +3210,13 @@ rules:
- crd.antrea.io
resources:
- egresses
- egresses/status
verbs:
- get
- watch
- list
- update
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
14 changes: 14 additions & 0 deletions build/yamls/antrea-ipsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,10 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- description: The Owner Node of egress IP
jsonPath: .status.nodeName
name: Status
type: string
name: v1alpha2
schema:
openAPIV3Schema:
Expand Down Expand Up @@ -1414,11 +1418,18 @@ spec:
- appliedTo
- egressIP
type: object
status:
properties:
nodeName:
type: string
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -3199,10 +3210,13 @@ rules:
- crd.antrea.io
resources:
- egresses
- egresses/status
verbs:
- get
- watch
- list
- update
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
14 changes: 14 additions & 0 deletions build/yamls/antrea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,10 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- description: The Owner Node of egress IP
jsonPath: .status.nodeName
name: Status
type: string
name: v1alpha2
schema:
openAPIV3Schema:
Expand Down Expand Up @@ -1414,11 +1418,18 @@ spec:
- appliedTo
- egressIP
type: object
status:
properties:
nodeName:
type: string
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down Expand Up @@ -3199,10 +3210,13 @@ rules:
- crd.antrea.io
resources:
- egresses
- egresses/status
verbs:
- get
- watch
- list
- update
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
3 changes: 3 additions & 0 deletions build/yamls/base/agent-rbac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,13 @@ rules:
- crd.antrea.io
resources:
- egresses
- egresses/status
verbs:
- get
- watch
- list
- update
- patch
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
11 changes: 11 additions & 0 deletions build/yamls/base/crds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ spec:
enum:
- Auto
- None
status:
type: object
properties:
nodeName:
type: string
additionalPrinterColumns:
- description: Specifies the SNAT IP address for the selected workloads.
jsonPath: .spec.egressIP
Expand All @@ -88,6 +93,12 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- description: The Owner Node of egress IP
jsonPath: .status.nodeName
name: Status
type: string
subresources:
status: {}
scope: Cluster
names:
plural: egresses
Expand Down
13 changes: 9 additions & 4 deletions cmd/antrea-agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,17 @@ func run(o *Options) error {

var egressController *egress.EgressController
if features.DefaultFeatureGate.Enabled(features.Egress) {
gossipCluster, err := memberlist.NewGossipCluster(o.config.GossipClusterPort, nodeInformer, nodeConfig)
if err != nil {
return fmt.Errorf("initializing egress node memberlist cluster error: %v", err)
// turn on the egress auto failover switch, to-do
nodeAutoFailoverSupport := true
var gossipCluster *memberlist.GossipCluster
if nodeAutoFailoverSupport {
gossipCluster, err = memberlist.NewGossipCluster(o.config.GossipClusterPort, nodeInformer, nodeConfig)
if err != nil {
return fmt.Errorf("initializing egress node memberlist cluster error: %v", err)
}
}
egressController = egress.NewEgressController(ofClient, egressInformer, antreaClientProvider, ifaceStore,
routeClient, nodeConfig.Name, gossipCluster)
routeClient, nodeConfig.Name, gossipCluster, crdClient, nodeAutoFailoverSupport)
}

isChaining := false
Expand Down
Loading

0 comments on commit 0bbc99f

Please sign in to comment.