Skip to content

Commit

Permalink
feat(): feature gw redundancy (#167)
Browse files Browse the repository at this point in the history
feat(AM-XXXX): feature slicegw-redundancy
  • Loading branch information
Rahul-D78 authored Jan 30, 2023
1 parent f5766f6 commit fafb1e2
Show file tree
Hide file tree
Showing 127 changed files with 8,110 additions and 1,696 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/end-to-end-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
with:
image-ref: worker-operator:${{ steps.vars.outputs.sha_commit }}
format: 'table'
<<<<<<< HEAD
=======
output: 'scan.txt'

- name: check files
Expand Down Expand Up @@ -70,6 +72,7 @@ jobs:
with:
name: trivy-scan
path: scan.txt
>>>>>>> f5766f60844b82934c9b1e5717ff85641eab6adb

- name: build kind clusters
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/start-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ IstioDChartOptions:
Password: ${chartpassword}
Namespace: "istio-system"
TestSuitesEnabled:
EmptySuite: false
EmptySuite: true
HubSuite: false
WorkerSuite: true
IstioSuite: false
Expand Down
41 changes: 30 additions & 11 deletions api/v1beta1/slicegateway_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ type SliceGatewayConfig struct {
// Host Type : server or client
SliceGatewayHostType string `json:"sliceGatewayHostType,omitempty"`
// Node port
SliceGatewayNodePort int `json:"sliceGatewayNodePort,omitempty"`
// Remote Node IP
SliceGatewayRemoteNodeIP string `json:"sliceGatewayRemoteNodeIp,omitempty"`
SliceGatewayNodePorts []int `json:"sliceGatewayNodePorts,omitempty"`
// Remote Node IPs
SliceGatewayRemoteNodeIPs []string `json:"sliceGatewayRemoteNodeIps,omitempty"`
// Remote Node Port
SliceGatewayRemoteNodePort int `json:"sliceGatewayRemoteNodePort,omitempty"`
SliceGatewayRemoteNodePorts []int `json:"sliceGatewayRemoteNodePorts,omitempty"`
// Remote Node Subnet
SliceGatewayRemoteSubnet string `json:"sliceGatewayRemoteSubnet,omitempty"`
// Remote VPN IP
Expand All @@ -73,20 +73,20 @@ type SliceGatewayStatus struct {
Config SliceGatewayConfig `json:"config,omitempty"`
// ConfigUpdatedOn is the time when Config updated from backend
ConfigUpdatedOn int64 `json:"configUpdatedOn,omitempty"`
// PodName is the name of the gateway pod running in cluster
// Deprecated PodName is the name of the gateway pod running in cluster
PodName string `json:"podName,omitempty"`
// PodNames is the list of names of the gateway pods running in cluster
PodNames []string `json:"podNames,omitempty"`
// PodStatus shows whether gateway pod is healthy
PodStatus string `json:"podStatus,omitempty"`
// PodIP is the Ip of the gateway pod running in cluster
PodIP string `json:"podIp,omitempty"`
// LocalIP is the gateway tunnel ip
LocalIP string `json:"localIp,omitempty"`
// PodIPs is the list of Ip of the gateway pods running in cluster
PodIPs []string `json:"podIps,omitempty"`
// PeerIP is the gateway tunnel peer ip
PeerIP string `json:"peerIp,omitempty"`
// LocalNsmIP is the IP on the nsm interface to Slice Router
LocalNsmIP string `json:"localNsmIp,omitempty"`
// ConnectionContextUpdated is the time when context updated in pod
ConnectionContextUpdatedOn int64 `json:"connectionContextUpdatedOn,omitempty"`
//gatewayPodStatus is a list that consists of status of individual gatewaypods
GatewayPodStatus []*GwPodInfo `json:"gatewayPodStatus,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down Expand Up @@ -115,6 +115,25 @@ type SliceGatewayList struct {
Items []SliceGateway `json:"items"`
}

type GwPodInfo struct {
PodName string `json:"podName,omitempty"`
PeerPodName string `json:"peerPodName,omitempty"`
PodIP string `json:"podIP,omitempty"`
LocalNsmIP string `json:"localNsmIP,omitempty"`
TunnelStatus TunnelStatus `json:"tunnelStatus,omitempty"`
RouteRemoved int32 `json:"routeRemoved,omitempty"`
}
type TunnelStatus struct {
IntfName string `json:"IntfName,omitempty"`
LocalIP string `json:"LocalIP,omitempty"`
RemoteIP string `json:"RemoteIP,omitempty"`
Latency uint64 `json:"Latency,omitempty"`
TxRate uint64 `json:"TxRate,omitempty"`
RxRate uint64 `json:"RxRate,omitempty"`
PacketLoss uint64 `json:"PacketLoss,omitempty"`
Status int32 `json:"Status,omitempty"`
}

func init() {
SchemeBuilder.Register(&SliceGateway{}, &SliceGatewayList{})
}
71 changes: 69 additions & 2 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

86 changes: 69 additions & 17 deletions config/crd/bases/networking.kubeslice.io_slicegateways.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,27 @@ spec:
sliceGatewayName:
description: Slice Gateway Name
type: string
sliceGatewayNodePort:
sliceGatewayNodePorts:
description: Node port
type: integer
items:
type: integer
type: array
sliceGatewayRemoteClusterId:
description: Remote Cluster ID
type: string
sliceGatewayRemoteGatewayId:
description: Remote Gateway ID
type: string
sliceGatewayRemoteNodeIp:
description: Remote Node IP
type: string
sliceGatewayRemoteNodePort:
sliceGatewayRemoteNodeIps:
description: Remote Node IPs
items:
type: string
type: array
sliceGatewayRemoteNodePorts:
description: Remote Node Port
type: integer
items:
type: integer
type: array
sliceGatewayRemoteSubnet:
description: Remote Node Subnet
type: string
Expand Down Expand Up @@ -122,21 +128,67 @@ spec:
in pod
format: int64
type: integer
localIp:
description: LocalIP is the gateway tunnel ip
type: string
localNsmIp:
description: LocalNsmIP is the IP on the nsm interface to Slice Router
type: string
gatewayPodStatus:
description: gatewayPodStatus is a list that consists of status of
individual gatewaypods
items:
properties:
localNsmIP:
type: string
peerPodName:
type: string
podIP:
type: string
podName:
type: string
routeRemoved:
format: int32
type: integer
tunnelStatus:
properties:
IntfName:
type: string
Latency:
format: int64
type: integer
LocalIP:
type: string
PacketLoss:
format: int64
type: integer
RemoteIP:
type: string
RxRate:
format: int64
type: integer
Status:
format: int32
type: integer
TxRate:
format: int64
type: integer
type: object
type: object
type: array
peerIp:
description: PeerIP is the gateway tunnel peer ip
type: string
podIp:
description: PodIP is the Ip of the gateway pod running in cluster
type: string
podIps:
description: PodIPs is the list of Ip of the gateway pods running
in cluster
items:
type: string
type: array
podName:
description: PodName is the name of the gateway pod running in cluster
description: Deprecated PodName is the name of the gateway pod running
in cluster
type: string
podNames:
description: PodNames is the list of names of the gateway pods running
in cluster
items:
type: string
type: array
podStatus:
description: PodStatus shows whether gateway pod is healthy
type: string
Expand Down
1 change: 1 addition & 0 deletions controllers/slice/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ func (r *SliceReconciler) handleSliceDeletion(slice *kubeslicev1beta1.Slice, ctx
log.Error(err, "Failed to send slice deletetion event to netop")
}
if err := r.cleanupSliceResources(ctx, slice); err != nil {
log.Error(err, "error while deleting slice")
return true, ctrl.Result{}, err
}
controllerutil.RemoveFinalizer(slice, sliceFinalizer)
Expand Down
Loading

0 comments on commit fafb1e2

Please sign in to comment.