service

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessTypeAnnotationLabel  = "access-type"
	AccessTypeClusterReadWrite = "cluster-read-write"
	AccessTypeReadOnly         = "read-only"
	AccessTypeReadWrite        = "read-write"
)

Access Types

View Source
const (
	ProjectFinalizer           = "controller.kubeslice.io/project-finalizer"
	ClusterFinalizer           = "controller.kubeslice.io/cluster-finalizer"
	ClusterDeregisterFinalizer = "worker.kubeslice.io/cluster-deregister-finalizer"
	SliceConfigFinalizer       = "controller.kubeslice.io/slice-configuration-finalizer"

	WorkerSliceConfigFinalizer    = "worker.kubeslice.io/worker-slice-configuration-finalizer"
	WorkerSliceGatewayFinalizer   = "worker.kubeslice.io/worker-slice-gateway-finalizer"
	WorkerServiceImportFinalizer  = "worker.kubeslice.io/worker-service-import-finalizer"
	SliceQoSConfigFinalizer       = "controller.kubeslice.io/slice-qos-config-finalizer"
	VPNKeyRotationConfigFinalizer = "controller.kubeslice.io/vpn-key-rotation-config-finalizer"
)

Finalizers

View Source
const (
	ControllerNamespace = "kubeslice-controller"
)

ControllerNamespace Controller Namespace

View Source
const (
	KubesliceWorkerDeleteRequeueTime = 3
)
View Source
const (
	RequeueTime = time.Duration(30000000000)
)

Request Timeout

View Source
const (
	ResourceStatusSuffix = "/status"
)

Resources

View Source
const (
	StandardQoSProfileLabel = "standard-qos-profile"
)

StandardQoSProfileLabel name

Variables

View Source
var (
	RoleBindingWorkerCluster = "kubeslice-worker-%s"
	RoleBindingReadOnlyUser  = "kubeslice-ro-%s"
	RoleBindingReadWriteUser = "kubeslice-rw-%s"
)

RoleBinding Names

View Source
var (
	ServiceAccountWorkerCluster = "kubeslice-worker-%s"
	ServiceAccountReadOnlyUser  = "kubeslice-ro-%s"
	ServiceAccountReadWriteUser = "kubeslice-rw-%s"
)

ServiceAccount Names

View Source
var (

	// Job Image
	JobImage          = "aveshasystems/gateway-certs-generator:latest"
	JobCredential     = ""
	JobServiceAccount = "kubeslice-controller-ovpn-manager"
)
View Source
var (
	ControllerEndpoint = "https://controller.cisco.com:6443/"
)

ControllerEndpoint

View Source
var (
	MetricPort = "18080"
)
View Source
var (
	ProjectNamespacePrefix = "kubeslice-controller-project-"
)

Project Namespace prefix. Customer can over ride this.

View Source
var RbacResourcePrefix = "kubeslice"

Functions

func RemoveWorkerFinalizers

func RemoveWorkerFinalizers(ctx context.Context, object client.Object, workerFinalizerName string) ctrl.Result

RemoveWorkerFinalizers removes the finalizer specified by workerFinalizerName from the object's finalizers list. If the workerFinalizerName is not found in the initial finalizers list, all finalizers are removed and the function returns the reconciliation result for no-requeue. If the finalizers list is empty after the removal, the function returns the reconciliation result for no-requeue. If the finalizers list is non-empty after the removal, the function returns the reconciliation result for delayed requeue.

func ValidateClusterCreate

func ValidateClusterCreate(ctx context.Context, c *controllerv1alpha1.Cluster) error

ValidateClusterCreate is a function to validate the creation of cluster

func ValidateClusterDelete

func ValidateClusterDelete(ctx context.Context, c *controllerv1alpha1.Cluster) error

ValidateClusterDelete is a function to validate the deletion of cluster

func ValidateClusterUpdate

func ValidateClusterUpdate(ctx context.Context, c *controllerv1alpha1.Cluster, old runtime.Object) error

ValidateClusterUpdate is a function to validate to the update of specification of cluster

func ValidateProjectCreate

func ValidateProjectCreate(ctx context.Context, project *controllerv1alpha1.Project) error

ValidateProjectCreate is a function to validate the creation of project

func ValidateProjectDelete added in v0.2.1

func ValidateProjectDelete(ctx context.Context, project *controllerv1alpha1.Project) error

func ValidateProjectUpdate

func ValidateProjectUpdate(ctx context.Context, project *controllerv1alpha1.Project) error

ValidateProjectUpdate is a function to verify the project - service account, role binding, service account names

func ValidateServiceExportConfigCreate

func ValidateServiceExportConfigCreate(ctx context.Context, serviceExportConfig *controllerv1alpha1.ServiceExportConfig) error

ValidateServiceExportConfigCreate is a function to validate the create process of service export config

func ValidateServiceExportConfigDelete added in v0.10.1

func ValidateServiceExportConfigDelete(ctx context.Context, serviceExportConfig *controllerv1alpha1.ServiceExportConfig) error

ValidateServiceExportConfigDelete is a function to validate the delete process of service export config

func ValidateServiceExportConfigUpdate

func ValidateServiceExportConfigUpdate(ctx context.Context, serviceExportConfig *controllerv1alpha1.ServiceExportConfig) error

ValidateServiceExportConfigUpdate is a function to validate the update process of service export config

func ValidateSliceConfigCreate

func ValidateSliceConfigCreate(ctx context.Context, sliceConfig *controllerv1alpha1.SliceConfig) error

ValidateSliceConfigCreate is a function to verify the creation of slice config

func ValidateSliceConfigDelete

func ValidateSliceConfigDelete(ctx context.Context, sliceConfig *controllerv1alpha1.SliceConfig) error

ValidateSliceConfigDelete is function to validate the deletion of sliceConfig

func ValidateSliceConfigUpdate

func ValidateSliceConfigUpdate(ctx context.Context, sliceConfig *controllerv1alpha1.SliceConfig, old runtime.Object) error

ValidateSliceConfigUpdate is function to verify the update of slice config

func ValidateSliceQosConfigCreate added in v0.2.1

func ValidateSliceQosConfigCreate(ctx context.Context, sliceQoSConfig *controllerv1alpha1.SliceQoSConfig) error

ValidateSliceQosConfigCreate is a function to validate the creation of SliceQosConfig

func ValidateSliceQosConfigDelete added in v0.2.1

func ValidateSliceQosConfigDelete(ctx context.Context, sliceQoSConfig *controllerv1alpha1.SliceQoSConfig) error

ValidateSliceQosConfigDelete is a function to validate the deletion of SliceQosConfig

func ValidateSliceQosConfigUpdate added in v0.2.1

func ValidateSliceQosConfigUpdate(ctx context.Context, sliceQoSConfig *controllerv1alpha1.SliceQoSConfig) error

ValidateSliceQosConfigUpdate is a function to validate the update of SliceQosConfig

func ValidateVpnKeyRotationCreate added in v1.0.1

func ValidateVpnKeyRotationCreate(ctx context.Context, r *controllerv1alpha1.VpnKeyRotation) error

func ValidateVpnKeyRotationDelete added in v1.0.1

func ValidateVpnKeyRotationDelete(ctx context.Context, r *controllerv1alpha1.VpnKeyRotation) error

func ValidateWorkerSliceConfigUpdate

func ValidateWorkerSliceConfigUpdate(ctx context.Context, workerSliceConfig *workerv1alpha1.WorkerSliceConfig, old runtime.Object) error

ValidateWorkerSliceConfigUpdate is a function to verify the update of config of workerslice

func ValidateWorkerSliceGatewayUpdate

func ValidateWorkerSliceGatewayUpdate(ctx context.Context, workerSliceGateway *workerv1alpha1.WorkerSliceGateway, old runtime.Object) error

ValidateWorkerSliceGatewayUpdate is function to validate the update of gateways

func WithMetricsRecorder added in v0.9.0

func WithMetricsRecorder() metrics.IMetricRecorder

Types

type AccessControlRuleProvider added in v0.5.2

type AccessControlRuleProvider struct {
}

func (*AccessControlRuleProvider) ReadOnlyRoleRules added in v0.5.2

func (k *AccessControlRuleProvider) ReadOnlyRoleRules() []rbacv1.PolicyRule

func (*AccessControlRuleProvider) ReadWriteRoleRules added in v0.5.2

func (k *AccessControlRuleProvider) ReadWriteRoleRules() []rbacv1.PolicyRule

func (*AccessControlRuleProvider) WorkerClusterRoleRules added in v0.5.2

func (k *AccessControlRuleProvider) WorkerClusterRoleRules() []rbacv1.PolicyRule

type AccessControlService

type AccessControlService struct {
	// contains filtered or unexported fields
}

func (*AccessControlService) ReconcileReadOnlyRole

func (a *AccessControlService) ReconcileReadOnlyRole(ctx context.Context, namespace string, owner client.Object) (ctrl.Result,
	error)

ReconcileReadOnlyRole reconciles the read only role for the project users

func (*AccessControlService) ReconcileReadOnlyUserServiceAccountAndRoleBindings

func (a *AccessControlService) ReconcileReadOnlyUserServiceAccountAndRoleBindings(ctx context.Context, namespace string,
	names []string, owner client.Object) (ctrl.Result, error)

ReconcileReadOnlyUserServiceAccountAndRoleBindings reconciles the service account and role bindings for read only users

func (*AccessControlService) ReconcileReadWriteRole

func (a *AccessControlService) ReconcileReadWriteRole(ctx context.Context,
	namespace string, owner client.Object) (ctrl.Result, error)

ReconcileReadWriteRole reconciles the read write role binding for project users

func (*AccessControlService) ReconcileReadWriteUserServiceAccountAndRoleBindings

func (a *AccessControlService) ReconcileReadWriteUserServiceAccountAndRoleBindings(ctx context.Context,
	namespace string, names []string, owner client.Object) (ctrl.Result, error)

ReconcileReadWriteUserServiceAccountAndRoleBindings reconciles the service account and role bindings for read write users

func (*AccessControlService) ReconcileWorkerClusterRole

func (a *AccessControlService) ReconcileWorkerClusterRole(ctx context.Context,
	namespace string, owner client.Object) (ctrl.Result, error)

ReconcileWorkerClusterRole reconciles the worker cluster role

func (*AccessControlService) ReconcileWorkerClusterServiceAccountAndRoleBindings

func (a *AccessControlService) ReconcileWorkerClusterServiceAccountAndRoleBindings(ctx context.Context, clusterName,
	namespace string, owner client.Object) (ctrl.Result, error)

ReconcileWorkerClusterServiceAccountAndRoleBindings reconciles the service account and role bindings for worker cluster

func (*AccessControlService) RemoveWorkerClusterServiceAccountAndRoleBindings

func (a *AccessControlService) RemoveWorkerClusterServiceAccountAndRoleBindings(ctx context.Context, clusterName,
	namespace string, owner client.Object) (ctrl.Result, error)

RemoveWorkerClusterServiceAccountAndRoleBindings remove the service account and role bindings for worker cluster

type CertPairRequestMap

type CertPairRequestMap struct {
	SliceName string                      `json:"sliceName,omitempty"`
	Pairs     []IndividualCertPairRequest `json:"pairs,omitempty"`
}

type ClusterService

type ClusterService struct {
	// contains filtered or unexported fields
}

ClusterService struct implements different service interfaces

func (*ClusterService) DeleteClusters

func (c *ClusterService) DeleteClusters(ctx context.Context, namespace string) (ctrl.Result, error)

DeleteClusters is function to delete the clusters

func (*ClusterService) ReconcileCluster

func (c *ClusterService) ReconcileCluster(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

ReconcileCluster is function to reconcile cluster

type IAccessControlRuleProvider added in v0.5.2

type IAccessControlRuleProvider interface {
	WorkerClusterRoleRules() []rbacv1.PolicyRule
	ReadOnlyRoleRules() []rbacv1.PolicyRule
	ReadWriteRoleRules() []rbacv1.PolicyRule
}

func WithAccessControlRuleProvider added in v0.5.2

func WithAccessControlRuleProvider() IAccessControlRuleProvider

type IAccessControlService

type IAccessControlService interface {
	ReconcileWorkerClusterRole(ctx context.Context, namespace string, owner client.Object) (ctrl.Result, error)
	ReconcileReadOnlyRole(ctx context.Context, namespace string, owner client.Object) (ctrl.Result, error)
	ReconcileReadWriteRole(ctx context.Context, namespace string, owner client.Object) (ctrl.Result, error)
	ReconcileReadOnlyUserServiceAccountAndRoleBindings(ctx context.Context, namespace string,
		names []string, owner client.Object) (ctrl.Result, error)
	ReconcileReadWriteUserServiceAccountAndRoleBindings(ctx context.Context, namespace string,
		names []string, owner client.Object) (ctrl.Result, error)
	ReconcileWorkerClusterServiceAccountAndRoleBindings(ctx context.Context, clusterName,
		namespace string, owner client.Object) (ctrl.Result, error)
	RemoveWorkerClusterServiceAccountAndRoleBindings(ctx context.Context, clusterName,
		namespace string, owner client.Object) (ctrl.Result, error)
}

func WithAccessControlService

func WithAccessControlService(ruleProvider IAccessControlRuleProvider, mf metrics.IMetricRecorder) IAccessControlService

bootstrapping accesscontrol service

type IClusterService

type IClusterService interface {
	ReconcileCluster(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
	DeleteClusters(ctx context.Context, namespace string) (ctrl.Result, error)
}

func WithClusterService

bootstrapping cluster service

type IJobService

type IJobService interface {
	CreateJob(ctx context.Context, namespace string, jobImage string, environment map[string]string) (ctrl.Result, error)
}

func WithJobService

func WithJobService() IJobService

bootstrapping job service

type INamespaceService

type INamespaceService interface {
	ReconcileProjectNamespace(ctx context.Context, namespace string, owner client.Object) (ctrl.Result, error)
	DeleteNamespace(ctx context.Context, namespace string) (ctrl.Result, error)
}

func WithNameSpaceService

func WithNameSpaceService(mf metrics.IMetricRecorder) INamespaceService

bootstrapping namespace service

type IProjectService

type IProjectService interface {
	ReconcileProject(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
}

type ISecretService

type ISecretService interface {
	DeleteSecret(ctx context.Context, namespace string, secretName string) (ctrl.Result, error)
}

func WithSecretService

func WithSecretService(mf metrics.IMetricRecorder) ISecretService

bootstrapping secret service

type IServiceExportConfigService

type IServiceExportConfigService interface {
	ReconcileServiceExportConfig(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
	DeleteServiceExportConfigs(ctx context.Context, namespace string) (ctrl.Result, error)
	DeleteServiceExportConfigByParticipatingSliceConfig(ctx context.Context, sliceName string, namespace string) error
}

func WithServiceExportConfigService

bootstrapping service export config service

type ISliceConfigService

type ISliceConfigService interface {
	ReconcileSliceConfig(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
	DeleteSliceConfigs(ctx context.Context, namespace string) (ctrl.Result, error)
}

type ISliceQoSConfigService added in v0.2.1

type ISliceQoSConfigService interface {
	ReconcileSliceQoSConfig(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
	DeleteSliceQoSConfig(ctx context.Context, namespace string) (ctrl.Result, error)
}

func WithSliceQoSConfigService added in v0.2.1

bootstrapping slice qos config service

type IVpnKeyRotationService added in v1.0.1

type IVpnKeyRotationService interface {
	CreateMinimalVpnKeyRotationConfig(ctx context.Context, sliceName, namespace string, r int) error
	ReconcileClusters(ctx context.Context, sliceName, namespace string, clusters []string) (*controllerv1alpha1.VpnKeyRotation, error)
	ReconcileVpnKeyRotation(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
}

func WithVpnKeyRotationService added in v1.0.1

bootstrapping Vpn Key Rotation service

type IWorkerServiceImportService

type IWorkerServiceImportService interface {
	ReconcileWorkerServiceImport(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
	CreateMinimalWorkerServiceImport(ctx context.Context, clusters []string, namespace string, label map[string]string,
		serviceName string, serviceNamespace string, sliceName string, aliases []string) error
	DeleteWorkerServiceImportByLabel(ctx context.Context, label map[string]string, namespace string) error
	ListWorkerServiceImport(ctx context.Context, ownerLabel map[string]string, namespace string) ([]workerv1alpha1.WorkerServiceImport, error)
	ForceReconciliation(ctx context.Context, list []workerv1alpha1.WorkerServiceImport) error
	LookupServiceExportForService(ctx context.Context,
		serviceExportList *controllerv1alpha1.ServiceExportConfigList,
		namespace, serviceName, serviceNamespace, sliceName string) error
}

func WithWorkerServiceImportService

func WithWorkerServiceImportService(mf metrics.IMetricRecorder) IWorkerServiceImportService

bootstrapping worker service import service

type IWorkerSliceConfigService

type IWorkerSliceConfigService interface {
	ReconcileWorkerSliceConfig(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
	DeleteWorkerSliceConfigByLabel(ctx context.Context, label map[string]string, namespace string) error
	ListWorkerSliceConfigs(ctx context.Context, ownerLabel map[string]string, namespace string) ([]workerv1alpha1.WorkerSliceConfig, error)
	ComputeClusterMap(clusterNames []string, workerSliceConfigs []workerv1alpha1.WorkerSliceConfig) map[string]int
	CreateMinimalWorkerSliceConfig(ctx context.Context, clusters []string, namespace string, label map[string]string, name, sliceSubnet string, clusterCidr string, sliceGwSvcTypeMap map[string]*controllerv1alpha1.SliceGatewayServiceType) (map[string]int, error)
}

func WithWorkerSliceConfigService

func WithWorkerSliceConfigService(mf metrics.IMetricRecorder) IWorkerSliceConfigService

bootstrapping worker slice config service

type IWorkerSliceGatewayRecyclerService added in v0.6.8

type IWorkerSliceGatewayRecyclerService interface {
	ListWorkerSliceGatewayRecyclers(ctx context.Context, ownerLabel map[string]string, namespace string) ([]v1alpha1.WorkerSliceGwRecycler, error)
	DeleteWorkerSliceGatewayRecyclersByLabel(ctx context.Context, label map[string]string, namespace string) error
}

func WithWorkerSliceGatewayRecyclerService added in v0.6.8

func WithWorkerSliceGatewayRecyclerService() IWorkerSliceGatewayRecyclerService

WithWorkerSliceGatewayRecyclerService bootstraps slice gateway_recycler service

type IWorkerSliceGatewayService

type IWorkerSliceGatewayService interface {
	ReconcileWorkerSliceGateways(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
	CreateMinimumWorkerSliceGateways(ctx context.Context, sliceName string, clusterNames []string, namespace string,
		label map[string]string, clusterMap map[string]int, sliceSubnet string, clusterCidr string, sliceGwSvcTypeMap map[string]*controllerv1alpha1.SliceGatewayServiceType) (ctrl.Result, error)
	ListWorkerSliceGateways(ctx context.Context, ownerLabel map[string]string, namespace string) ([]v1alpha1.WorkerSliceGateway, error)
	DeleteWorkerSliceGatewaysByLabel(ctx context.Context, label map[string]string, namespace string) error
	NodeIpReconciliationOfWorkerSliceGateways(ctx context.Context, cluster *controllerv1alpha1.Cluster, namespace string) error
	GenerateCerts(ctx context.Context, sliceName, namespace, gatewayProtocol string,
		serverGateway *v1alpha1.WorkerSliceGateway, clientGateway *v1alpha1.WorkerSliceGateway,
		gatewayAddresses util.WorkerSliceGatewayNetworkAddresses) error
	BuildNetworkAddresses(sliceSubnet, sourceClusterName, destinationClusterName string,
		clusterMap map[string]int, clusterCidr string) util.WorkerSliceGatewayNetworkAddresses
}

func WithWorkerSliceGatewayService

bootstrapping slice gateway service

type IndividualCertPairRequest

type IndividualCertPairRequest struct {
	VpnFqdn string `json:"vpnFqdn,omitempty"`
	// The NSM server network.
	NsmServerNetwork string `json:"nsmServerNetwork,omitempty"`
	// The NSM client network.
	NsmClientNetwork string `json:"nsmClientNetwork,omitempty"`
	// The NSM mask.
	NsmMask string `json:"nsmMask,omitempty"`
	// VPN's IP address to client.
	VpnIpToClient string `json:"vpnIpToClient,omitempty"`
	// VPN's network IP.
	VpnNetwork string `json:"vpnNetwork,omitempty"`
	// VPN's IP mask.
	VpnMask string `json:"vpnMask,omitempty"`
	// The client gateway ID.
	ClientId string `json:"clientId,omitempty"`
	// The server gateway ID.
	ServerId string `json:"serverId,omitempty"`
}

IndividualCertPairRequest Parameters for individual certificate pair generations.

type JobService

type JobService struct{}

func (*JobService) CreateJob

func (j *JobService) CreateJob(ctx context.Context, namespace string, jobImage string, environment map[string]string) (ctrl.Result, error)

CreateJob is function to create the job in k8s

type JobStatus added in v1.0.1

type JobStatus int

JobStatus represents the status of a job.

const (
	JobStatusComplete JobStatus = iota
	JobStatusError
	JobStatusSuspended
	JobStatusListError
	JobStatusRunning
	JobNotCreated
)

func (JobStatus) String added in v1.0.1

func (status JobStatus) String() string

String returns the string representation of JobStatus.

type NamespaceService

type NamespaceService struct {
	// contains filtered or unexported fields
}

func (*NamespaceService) DeleteNamespace

func (n *NamespaceService) DeleteNamespace(ctx context.Context, namespace string) (ctrl.Result, error)

DeleteNamespace is a function deletes the namespace

func (*NamespaceService) ReconcileProjectNamespace

func (n *NamespaceService) ReconcileProjectNamespace(ctx context.Context, namespace string, owner client.Object) (ctrl.Result, error)

ReconcileProjectNamespace is a function to reconcile project namespace

type ProjectService

type ProjectService struct {
	// contains filtered or unexported fields
}

ProjectService implements different service interfaces

func (*ProjectService) CleanUpProjectResources

func (t *ProjectService) CleanUpProjectResources(ctx context.Context, namespace string) (ctrl.Result, error)

func (*ProjectService) ReconcileProject

func (t *ProjectService) ReconcileProject(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

ReconcileProject is a function to reconcile the projects includes reconciliation of roles, clusters, project namespaces etc.

type SecretService

type SecretService struct {
	// contains filtered or unexported fields
}

func (*SecretService) DeleteSecret

func (s *SecretService) DeleteSecret(ctx context.Context, namespace string, secretName string) (ctrl.Result, error)

DeleteSecret is a function to delete the secret

type ServiceExportConfigService

type ServiceExportConfigService struct {
	// contains filtered or unexported fields
}

func (*ServiceExportConfigService) DeleteServiceExportConfigByParticipatingSliceConfig

func (s *ServiceExportConfigService) DeleteServiceExportConfigByParticipatingSliceConfig(ctx context.Context, sliceName string, namespace string) error

DeleteServiceExportConfigByParticipatingSliceConfig is a function to delete the export config which are in slice

func (*ServiceExportConfigService) DeleteServiceExportConfigs

func (s *ServiceExportConfigService) DeleteServiceExportConfigs(ctx context.Context, namespace string) (ctrl.Result, error)

DeleteServiceExportConfigs is a function to delete the export configs

func (*ServiceExportConfigService) ListServiceExportConfigs

func (s *ServiceExportConfigService) ListServiceExportConfigs(ctx context.Context, namespace string) ([]controllerv1alpha1.ServiceExportConfig, error)

func (*ServiceExportConfigService) ReconcileServiceExportConfig

func (s *ServiceExportConfigService) ReconcileServiceExportConfig(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

ReconcileServiceExportConfig is a function to reconcile the service export config

type Services

type Services struct {
	ProjectService                    IProjectService
	ClusterService                    IClusterService
	SliceConfigService                ISliceConfigService
	ServiceExportConfigService        IServiceExportConfigService
	WorkerSliceConfigService          IWorkerSliceConfigService
	WorkerSliceGatewayService         IWorkerSliceGatewayService
	WorkerServiceImportService        IWorkerServiceImportService
	SliceQoSConfigService             ISliceQoSConfigService
	WorkerSliceGatewayRecyclerService IWorkerSliceGatewayRecyclerService
	VpnKeyRotationService             IVpnKeyRotationService
}

type SliceConfigService

type SliceConfigService struct {
	// contains filtered or unexported fields
}

SliceConfigService implements different interfaces -

func (*SliceConfigService) DeleteSliceConfigs

func (s *SliceConfigService) DeleteSliceConfigs(ctx context.Context, namespace string) (ctrl.Result, error)

DeleteSliceConfigs is a function to delete the sliceconfigs

func (*SliceConfigService) ReconcileSliceConfig

func (s *SliceConfigService) ReconcileSliceConfig(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

ReconcileSliceConfig is a function to reconcile the sliceconfig

type SliceQoSConfigService added in v0.2.1

type SliceQoSConfigService struct {
	// contains filtered or unexported fields
}

SliceQoSConfigService implements different service interfaces

func (*SliceQoSConfigService) DeleteSliceQoSConfig added in v0.11.0

func (q *SliceQoSConfigService) DeleteSliceQoSConfig(ctx context.Context, namespace string) (ctrl.Result, error)

DeleteSliceQoSConfig is a function to delete the slice qos config

func (*SliceQoSConfigService) ReconcileSliceQoSConfig added in v0.2.1

func (q *SliceQoSConfigService) ReconcileSliceQoSConfig(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

ReconcileSliceQoSConfig is a function to reconcile the qos_profile

type VpnKeyRotationService added in v1.0.1

type VpnKeyRotationService struct {
	// contains filtered or unexported fields
}

func (*VpnKeyRotationService) CreateMinimalVpnKeyRotationConfig added in v1.0.1

func (v *VpnKeyRotationService) CreateMinimalVpnKeyRotationConfig(ctx context.Context, sliceName, namespace string, r int) error

CreateMinimalVpnKeyRotationConfig creates minimal VPNKeyRotationCR if not found

func (*VpnKeyRotationService) ReconcileClusters added in v1.0.1

func (v *VpnKeyRotationService) ReconcileClusters(ctx context.Context, sliceName, namespace string, clusters []string) (*controllerv1alpha1.VpnKeyRotation, error)

ReconcileClusters checks whether any cluster is added/removed and updates it in vpnkeyrotation config the first arg is returned for testing purposes

func (*VpnKeyRotationService) ReconcileVpnKeyRotation added in v1.0.1

func (v *VpnKeyRotationService) ReconcileVpnKeyRotation(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

type WorkerServiceImportService

type WorkerServiceImportService struct {
	// contains filtered or unexported fields
}

func (*WorkerServiceImportService) CreateMinimalWorkerServiceImport

func (s *WorkerServiceImportService) CreateMinimalWorkerServiceImport(ctx context.Context, clusters []string,
	namespace string, label map[string]string, serviceName string, serviceNamespace string, sliceName string, aliases []string) error

CreateMinimalWorkerServiceImport is a function to create the service import on worker object/cluster

func (*WorkerServiceImportService) DeleteWorkerServiceImportByLabel

func (s *WorkerServiceImportService) DeleteWorkerServiceImportByLabel(ctx context.Context, label map[string]string, namespace string) error

DeleteWorkerServiceImportByLabel is function to delete the service import from worker cluster/object

func (*WorkerServiceImportService) ForceReconciliation

ForceReconciliation is a function to update the worker service import

func (*WorkerServiceImportService) ListWorkerServiceImport

func (s *WorkerServiceImportService) ListWorkerServiceImport(ctx context.Context, ownerLabel map[string]string,
	namespace string) ([]workerv1alpha1.WorkerServiceImport, error)

ListWorkerServiceImport is a function to list down the serviceImport

func (*WorkerServiceImportService) LookupServiceExportForService

func (s *WorkerServiceImportService) LookupServiceExportForService(ctx context.Context,
	serviceExportList *controllerv1alpha1.ServiceExportConfigList,
	namespace, serviceName, serviceNamespace, sliceName string) error

LookupServiceExportForService Returns a list of non-deleted ServiceExport for the service configuration

func (*WorkerServiceImportService) ReconcileWorkerServiceImport

func (s *WorkerServiceImportService) ReconcileWorkerServiceImport(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

ReconcileWorkerServiceImport is a function to reconcile the service import for worker object

type WorkerSliceConfigService

type WorkerSliceConfigService struct {
	// contains filtered or unexported fields
}

WorkerSliceConfigService implements the IWorkerSliceConfigService interface

func (*WorkerSliceConfigService) ComputeClusterMap

func (s *WorkerSliceConfigService) ComputeClusterMap(clusterNames []string, workerSliceConfigs []workerv1alpha1.WorkerSliceConfig) map[string]int

ComputeClusterMap - function assigns a numerical value to the cluster. The value will be from 1 to n, where n is the number of clusters in the slice.

func (*WorkerSliceConfigService) CreateMinimalWorkerSliceConfig

func (s *WorkerSliceConfigService) CreateMinimalWorkerSliceConfig(ctx context.Context, clusters []string, namespace string, label map[string]string, name, sliceSubnet string, clusterCidr string, sliceGwSvcTypeMap map[string]*controllerv1alpha1.SliceGatewayServiceType) (map[string]int, error)

CreateMinimalWorkerSliceConfig CreateWorkerSliceConfig is a function to create the worker slice configs with minimum number of fields. More fields are added in reconciliation loop.

func (*WorkerSliceConfigService) DeleteWorkerSliceConfigByLabel

func (s *WorkerSliceConfigService) DeleteWorkerSliceConfigByLabel(ctx context.Context, label map[string]string, namespace string) error

DeleteWorkerSliceConfigByLabel is a function to delete configs of workerslice by label

func (*WorkerSliceConfigService) ListWorkerSliceConfigs

func (s *WorkerSliceConfigService) ListWorkerSliceConfigs(ctx context.Context, ownerLabel map[string]string,
	namespace string) ([]workerv1alpha1.WorkerSliceConfig, error)

ListWorkerSliceConfigs

func (*WorkerSliceConfigService) ReconcileWorkerSliceConfig

func (s *WorkerSliceConfigService) ReconcileWorkerSliceConfig(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

ReconcileWorkerSliceConfig is a function to reconcile the config of worker slice

type WorkerSliceGatewayRecyclerService added in v0.6.8

type WorkerSliceGatewayRecyclerService struct{}

WorkerSliceGatewayRecyclerService is a schema for interfaces JobService, WorkerSliceConfigService, SecretService

func (*WorkerSliceGatewayRecyclerService) DeleteWorkerSliceGatewayRecyclersByLabel added in v0.6.8

func (s *WorkerSliceGatewayRecyclerService) DeleteWorkerSliceGatewayRecyclersByLabel(ctx context.Context, label map[string]string, namespace string) error

DeleteWorkerSliceGatewayRecyclersByLabel is a function to delete worker slice gateway by label

func (*WorkerSliceGatewayRecyclerService) ListWorkerSliceGatewayRecyclers added in v0.6.8

func (s *WorkerSliceGatewayRecyclerService) ListWorkerSliceGatewayRecyclers(ctx context.Context, ownerLabel map[string]string,
	namespace string) ([]v1alpha1.WorkerSliceGwRecycler, error)

ListWorkerSliceGatewayRecyclers is a function to list down the established gateways

type WorkerSliceGatewayService

type WorkerSliceGatewayService struct {
	// contains filtered or unexported fields
}

WorkerSliceGatewayService is a schema for interfaces JobService, WorkerSliceConfigService, SecretService

func (*WorkerSliceGatewayService) BuildNetworkAddresses added in v1.0.1

func (s *WorkerSliceGatewayService) BuildNetworkAddresses(sliceSubnet, sourceClusterName, destinationClusterName string,
	clusterMap map[string]int, clusterCidr string) util.WorkerSliceGatewayNetworkAddresses

buildNetworkAddresses - function generates the object of WorkerSliceGatewayNetworkAddresses

func (*WorkerSliceGatewayService) CreateMinimumWorkerSliceGateways

func (s *WorkerSliceGatewayService) CreateMinimumWorkerSliceGateways(ctx context.Context, sliceName string,
	clusterNames []string, namespace string, label map[string]string, clusterMap map[string]int,
	sliceSubnet string, clusterCidr string, sliceGwSvcTypeMap map[string]*controllerv1alpha1.SliceGatewayServiceType) (ctrl.Result, error)

CreateMinimumWorkerSliceGateways is a function to create gateways with minimum specification

func (*WorkerSliceGatewayService) DeleteWorkerSliceGatewaysByLabel

func (s *WorkerSliceGatewayService) DeleteWorkerSliceGatewaysByLabel(ctx context.Context, label map[string]string, namespace string) error

DeleteWorkerSliceGatewaysByLabel is a function to delete worker slice gateway by label

func (*WorkerSliceGatewayService) GenerateCerts added in v1.0.1

func (s *WorkerSliceGatewayService) GenerateCerts(ctx context.Context, sliceName, namespace, gatewayProtocol string,
	serverGateway *v1alpha1.WorkerSliceGateway, clientGateway *v1alpha1.WorkerSliceGateway,
	gatewayAddresses util.WorkerSliceGatewayNetworkAddresses) error

generateCerts is a function to generate the certificates between serverGateway and clientGateway

func (*WorkerSliceGatewayService) ListWorkerSliceGateways

func (s *WorkerSliceGatewayService) ListWorkerSliceGateways(ctx context.Context, ownerLabel map[string]string,
	namespace string) ([]v1alpha1.WorkerSliceGateway, error)

ListWorkerSliceGateways is a function to list down the established gateways

func (*WorkerSliceGatewayService) NodeIpReconciliationOfWorkerSliceGateways

func (s *WorkerSliceGatewayService) NodeIpReconciliationOfWorkerSliceGateways(ctx context.Context, cluster *controllerv1alpha1.Cluster, namespace string) error

NodeIpReconciliationOfWorkerSliceGateways is a function to update the NodeIP of local gateway

func (*WorkerSliceGatewayService) ReconcileWorkerSliceGateways

func (s *WorkerSliceGatewayService) ReconcileWorkerSliceGateways(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

ReconcileWorkerSliceGateways is a function to reconcile/restore the worker slice gateways

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL