Documentation
¶
Index ¶
- Constants
- Variables
- func GetDepNameFromPodName(sliceGwID, podName string) string
- func GetDeployments(ctx context.Context, c client.Client, sliceName, sliceGwName string) (*appsv1.DeploymentList, error)
- func GetNsmIPsForGwDeployment(ctx context.Context, c client.Client, sliceGwName, depName string) ([]string, error)
- func GetPeerGwPodName(gwPodName string, sliceGw *kubeslicev1beta1.SliceGateway) (string, error)
- func GetPodForGwDeployment(ctx context.Context, c client.Client, depName string) (*corev1.Pod, error)
- func GetRemoteDepName(remoteGwID, localDepName string) string
- func UpdateGWPodStatus(gwPodStatus []*kubeslicev1beta1.GwPodInfo, podName string) []*kubeslicev1beta1.GwPodInfo
- func ValidateGatewayPodReadiness(sliceGw *kubeslicev1beta1.SliceGateway, podName string) error
- type HubClientProvider
- type NetOpPod
- type SliceGwReconciler
- func (r *SliceGwReconciler) FindSliceRouterService(ctx context.Context, c client.Client, sliceName string) (bool, error)
- func (r *SliceGwReconciler) GetGwPodInfo(ctx context.Context, sliceGw *kubeslicev1beta1.SliceGateway) ([]*kubeslicev1beta1.GwPodInfo, error)
- func (r *SliceGwReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *SliceGwReconciler) ReconcileGatewayDeployments(ctx context.Context, sliceGw *kubeslicev1beta1.SliceGateway) (ctrl.Result, error, bool)
- func (r *SliceGwReconciler) ReconcileGatewayServices(ctx context.Context, sliceGw *kubeslicev1beta1.SliceGateway) (ctrl.Result, error, bool)
- func (r *SliceGwReconciler) ReconcileGwPodPlacement(ctx context.Context, sliceGw *kubeslicev1beta1.SliceGateway) error
- func (r *SliceGwReconciler) ReconcileGwPodStatus(ctx context.Context, slicegateway *kubeslicev1beta1.SliceGateway) (ctrl.Result, error, bool)
- func (r *SliceGwReconciler) ReconcileIntermediateGatewayDeployments(ctx context.Context, sliceGw *kubeslicev1beta1.SliceGateway) (ctrl.Result, error, bool)
- func (r *SliceGwReconciler) SendConnectionContextAndQosToGwPod(ctx context.Context, slice *kubeslicev1beta1.Slice, ...) (ctrl.Result, error, bool)
- func (r *SliceGwReconciler) SendConnectionContextToSliceRouter(ctx context.Context, slicegateway *kubeslicev1beta1.SliceGateway) (ctrl.Result, error, bool)
- func (r *SliceGwReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *SliceGwReconciler) SyncNetOpConnectionContextAndQos(ctx context.Context, slice *kubeslicev1beta1.Slice, ...) error
- type WorkerGWSidecarClientProvider
- type WorkerNetOpClientProvider
- type WorkerRecyclerClientProvider
- type WorkerRouterClientProvider
Constants ¶
const ( DEFAULT_SIDECAR_IMG = "nexus.dev.aveshalabs.io/kubeslice/gw-sidecar:1.0.0" DEFAULT_SIDECAR_PULLPOLICY = corev1.PullAlways )
Variables ¶
var DefaultMinAvailablePodsInPDB = intstr.FromInt(1)
Default minAvailable value in PodDisruptionBudget
Functions ¶
func GetDepNameFromPodName ¶ added in v1.1.5
func GetDeployments ¶ added in v1.1.5
func GetNsmIPsForGwDeployment ¶ added in v1.1.5
func GetPeerGwPodName ¶ added in v1.1.5
func GetPeerGwPodName(gwPodName string, sliceGw *kubeslicev1beta1.SliceGateway) (string, error)
func GetPodForGwDeployment ¶ added in v1.1.5
func GetRemoteDepName ¶ added in v1.1.5
func UpdateGWPodStatus ¶
func UpdateGWPodStatus(gwPodStatus []*kubeslicev1beta1.GwPodInfo, podName string) []*kubeslicev1beta1.GwPodInfo
func ValidateGatewayPodReadiness ¶
func ValidateGatewayPodReadiness(sliceGw *kubeslicev1beta1.SliceGateway, podName string) error
ValidateGatewayPodReadiness checks if a gateway pod is ready for FSM trigger. This includes validating: 1. Pod exists in gateway status 2. Tunnel is UP and operational 3. TUN interface is created and configured 4. Peer pod information is available
Returns an error with specific message patterns that callers can check to determine if the error is transient (should retry).
Types ¶
type HubClientProvider ¶
type HubClientProvider interface {
UpdateNodePortForSliceGwServer(ctx context.Context, sliceGwNodePort []int, sliceGwName string) error
GetClusterNodeIP(ctx context.Context, clusterName, namespace string) ([]string, error)
CreateWorkerSliceGwRecycler(ctx context.Context, gwRecyclerName, clientID, serverID, sliceGwServer, sliceGwClient, slice string) error
GetVPNKeyRotation(ctx context.Context, rotationName string) (*hubv1alpha1.VpnKeyRotation, error)
ListWorkerSliceGwRecycler(ctx context.Context, sliceGWName string) ([]spokev1alpha1.WorkerSliceGwRecycler, error)
DeleteWorkerSliceGwRecycler(ctx context.Context, recyclerName string) error
UpdateLBIPsForSliceGwServer(ctx context.Context, lbIPs []string, sliceGwName string) error
}
type NetOpPod ¶
NetOpPod contains details of NetOp Pod running in the cluster
func GetNetOpPods ¶
func GetNetOpPods(ctx context.Context, namespace string, listFn func(context.Context, client.ObjectList, ...client.ListOption) error) ([]NetOpPod, error)
GetNetOpPods returns the netop pods in the cluster
type SliceGwReconciler ¶
type SliceGwReconciler struct {
client.Client
Scheme *runtime.Scheme
Log logr.Logger
HubClient HubClientProvider
WorkerRouterClient WorkerRouterClientProvider
WorkerNetOpClient WorkerNetOpClientProvider
WorkerGWSidecarClient WorkerGWSidecarClientProvider
WorkerRecyclerClient WorkerRecyclerClientProvider
NetOpPods []NetOpPod
EventRecorder *events.EventRecorder
NodeIPs []string
NumberOfGateways int
}
SliceReconciler reconciles a Slice object
func (*SliceGwReconciler) FindSliceRouterService ¶
func (*SliceGwReconciler) GetGwPodInfo ¶
func (r *SliceGwReconciler) GetGwPodInfo(ctx context.Context, sliceGw *kubeslicev1beta1.SliceGateway) ([]*kubeslicev1beta1.GwPodInfo, error)
func (*SliceGwReconciler) ReconcileGatewayDeployments ¶ added in v1.1.5
func (r *SliceGwReconciler) ReconcileGatewayDeployments(ctx context.Context, sliceGw *kubeslicev1beta1.SliceGateway) (ctrl.Result, error, bool)
func (*SliceGwReconciler) ReconcileGatewayServices ¶ added in v1.1.5
func (r *SliceGwReconciler) ReconcileGatewayServices(ctx context.Context, sliceGw *kubeslicev1beta1.SliceGateway) (ctrl.Result, error, bool)
func (*SliceGwReconciler) ReconcileGwPodPlacement ¶ added in v1.1.5
func (r *SliceGwReconciler) ReconcileGwPodPlacement(ctx context.Context, sliceGw *kubeslicev1beta1.SliceGateway) error
func (*SliceGwReconciler) ReconcileGwPodStatus ¶
func (r *SliceGwReconciler) ReconcileGwPodStatus(ctx context.Context, slicegateway *kubeslicev1beta1.SliceGateway) (ctrl.Result, error, bool)
func (*SliceGwReconciler) ReconcileIntermediateGatewayDeployments ¶ added in v1.1.5
func (r *SliceGwReconciler) ReconcileIntermediateGatewayDeployments(ctx context.Context, sliceGw *kubeslicev1beta1.SliceGateway) (ctrl.Result, error, bool)
func (*SliceGwReconciler) SendConnectionContextAndQosToGwPod ¶
func (r *SliceGwReconciler) SendConnectionContextAndQosToGwPod(ctx context.Context, slice *kubeslicev1beta1.Slice, slicegateway *kubeslicev1beta1.SliceGateway, req reconcile.Request) (ctrl.Result, error, bool)
func (*SliceGwReconciler) SendConnectionContextToSliceRouter ¶
func (r *SliceGwReconciler) SendConnectionContextToSliceRouter(ctx context.Context, slicegateway *kubeslicev1beta1.SliceGateway) (ctrl.Result, error, bool)
In the event of slice router deletion as well this function needs to be called so that the routes can be injected into the router sidecar
func (*SliceGwReconciler) SetupWithManager ¶
func (r *SliceGwReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
func (*SliceGwReconciler) SyncNetOpConnectionContextAndQos ¶
func (r *SliceGwReconciler) SyncNetOpConnectionContextAndQos(ctx context.Context, slice *kubeslicev1beta1.Slice, slicegw *kubeslicev1beta1.SliceGateway, sliceGwNodePorts []int) error
type WorkerGWSidecarClientProvider ¶
type WorkerGWSidecarClientProvider interface {
GetSliceGwRemotePodName(ctx context.Context, gwRemoteVpnIP string, serverAddr string) (string, error)
GetStatus(ctx context.Context, serverAddr string) (*gwsidecar.GwStatus, error)
SendConnectionContext(ctx context.Context, serverAddr string, gwConnCtx *gwsidecar.GwConnectionContext) error
UpdateSliceQosProfile(ctx context.Context, serverAddr string, slice *kubeslicev1beta1.Slice) error
}
type WorkerNetOpClientProvider ¶
type WorkerNetOpClientProvider interface {
UpdateSliceQosProfile(ctx context.Context, addr string, slice *kubeslicev1beta1.Slice) error
SendSliceLifeCycleEventToNetOp(ctx context.Context, addr string, sliceName string, eventType netop.EventType) error
SendConnectionContext(ctx context.Context, serverAddr string, gw *kubeslicev1beta1.SliceGateway, sliceGwNodePorts []int) error
}
type WorkerRecyclerClientProvider ¶
type WorkerRecyclerClientProvider interface {
// triggers FSM to recycle gateway pair by passing server gateway pod
// numberOfGwSvc should be equal to number of new deploy that should come up
TriggerFSM(sliceGw *kubeslicev1beta1.SliceGateway, slice *kubeslicev1beta1.Slice, serverID, clientID, controllerName string) error
}
type WorkerRouterClientProvider ¶
type WorkerRouterClientProvider interface {
GetClientConnectionInfo(ctx context.Context, addr string) ([]kubeslicev1beta1.AppPod, error)
SendConnectionContext(ctx context.Context, serverAddr string, sliceRouterConnCtx *router.SliceRouterConnCtx) error
UpdateEcmpRoutes(ctx context.Context, serverAddr string, ecmpUpdateInfo *router.UpdateEcmpInfo) error
}