reconciler

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MPL-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NamespaceNameLabel represents that label added automatically to namespaces is newer Kubernetes clusters
	NamespaceNameLabel = "kubernetes.io/metadata.name"
)

Variables

This section is empty.

Functions

func HTTPRouteID

func HTTPRouteID(namespacedName types.NamespacedName) string

func NewBinder added in v0.5.0

func NewBinder(client gatewayclient.Client) *binder

func TCPRouteID

func TCPRouteID(namespacedName types.NamespacedName) string

Types

type DeployerConfig added in v0.5.0

type DeployerConfig struct {
	ConsulCA                 string
	PrimaryDatacenter        string
	SDSHost                  string
	SDSPort                  int
	Logger                   hclog.Logger
	Client                   gatewayclient.Client
	Consul                   consul.Client
	ConsulNamespaceMirroring bool
	ConsulPartitionInfo      consul.PartitionInfo
}

type GatewayDeployer added in v0.5.0

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

GatewayDeployer creates gateway deployments and services and ensures that they exist

func NewDeployer added in v0.5.0

func NewDeployer(config DeployerConfig) *GatewayDeployer

func (*GatewayDeployer) Deploy added in v0.5.0

func (d *GatewayDeployer) Deploy(ctx context.Context, gateway *K8sGateway) error

func (*GatewayDeployer) Deployment added in v0.5.0

func (d *GatewayDeployer) Deployment(namespace string, config apigwv1alpha1.GatewayClassConfig, gateway *gwv1beta1.Gateway, currentReplicas *int32) *apps.Deployment

func (*GatewayDeployer) Service added in v0.5.0

type GatewayReconcileManager

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

GatewayReconcileManager manages a GatewayReconciler for each Gateway and is the interface by which Consul operations should be invoked in a kubernetes controller.

func NewReconcileManager

func NewReconcileManager(config ManagerConfig) *GatewayReconcileManager

func (*GatewayReconcileManager) DeleteGateway

func (m *GatewayReconcileManager) DeleteGateway(ctx context.Context, name types.NamespacedName) error

func (*GatewayReconcileManager) DeleteGatewayClass

func (m *GatewayReconcileManager) DeleteGatewayClass(ctx context.Context, name string) error

func (*GatewayReconcileManager) DeleteHTTPRoute

func (m *GatewayReconcileManager) DeleteHTTPRoute(ctx context.Context, name types.NamespacedName) error

func (*GatewayReconcileManager) DeleteTCPRoute

func (m *GatewayReconcileManager) DeleteTCPRoute(ctx context.Context, name types.NamespacedName) error

func (*GatewayReconcileManager) UpsertGateway

func (m *GatewayReconcileManager) UpsertGateway(ctx context.Context, g *gwv1beta1.Gateway) error

func (*GatewayReconcileManager) UpsertGatewayClass

func (m *GatewayReconcileManager) UpsertGatewayClass(ctx context.Context, gc *gwv1beta1.GatewayClass) error

func (*GatewayReconcileManager) UpsertHTTPRoute

func (m *GatewayReconcileManager) UpsertHTTPRoute(ctx context.Context, r *gwv1alpha2.HTTPRoute) error

func (*GatewayReconcileManager) UpsertTCPRoute

func (m *GatewayReconcileManager) UpsertTCPRoute(ctx context.Context, r *gwv1alpha2.TCPRoute) error

type K8sGateway

type K8sGateway struct {
	*gwv1beta1.Gateway
	GatewayState *state.GatewayState

	Config apigwv1alpha1.GatewayClassConfig
}

func (*K8sGateway) CanFetchSecrets added in v0.5.0

func (g *K8sGateway) CanFetchSecrets(secrets []string) (bool, error)

func (*K8sGateway) ID

func (g *K8sGateway) ID() core.GatewayID

func (*K8sGateway) Resolve added in v0.5.0

func (g *K8sGateway) Resolve() core.ResolvedGateway

type K8sGatewayClass

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

func NewK8sGatewayClass

func NewK8sGatewayClass(class *gwv1beta1.GatewayClass, config K8sGatewayClassConfig) *K8sGatewayClass

func (*K8sGatewayClass) IsValid

func (c *K8sGatewayClass) IsValid() bool

func (*K8sGatewayClass) SyncStatus

func (c *K8sGatewayClass) SyncStatus(ctx context.Context) error

func (*K8sGatewayClass) Validate

func (c *K8sGatewayClass) Validate(ctx context.Context) error

type K8sGatewayClassConfig

type K8sGatewayClassConfig struct {
	Logger hclog.Logger
	Client gatewayclient.Client
}

type K8sGatewayClasses

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

func NewK8sGatewayClasses

func NewK8sGatewayClasses(logger hclog.Logger, client gatewayclient.Client) *K8sGatewayClasses

func (*K8sGatewayClasses) Delete

func (g *K8sGatewayClasses) Delete(name string)

func (*K8sGatewayClasses) GetConfig

func (*K8sGatewayClasses) Upsert

func (g *K8sGatewayClasses) Upsert(ctx context.Context, class *K8sGatewayClass) error

type K8sRoute

type K8sRoute struct {
	Route
	RouteState *state.RouteState
}

func (*K8sRoute) ID

func (r *K8sRoute) ID() string

func (K8sRoute) MarshalJSON added in v0.5.0

func (r K8sRoute) MarshalJSON() ([]byte, error)

func (*K8sRoute) UnmarshalJSON added in v0.5.0

func (r *K8sRoute) UnmarshalJSON(b []byte) error

type K8sRouteConfig

type K8sRouteConfig struct {
	ControllerName string
	Client         gatewayclient.Client
	State          *state.RouteState
}

type ManagerConfig

type ManagerConfig struct {
	ControllerName           string
	Client                   gatewayclient.Client
	Consul                   consul.Client
	ConsulCA                 string
	PrimaryDatacenter        string
	SDSHost                  string
	SDSPort                  int
	Store                    store.Store
	Logger                   hclog.Logger
	ConsulNamespaceMapper    common.ConsulNamespaceMapper
	ConsulNamespaceMirroring bool
}

type Marshaler added in v0.5.0

type Marshaler struct{}

func NewMarshaler added in v0.5.0

func NewMarshaler() *Marshaler

func (*Marshaler) MarshalGateway added in v0.5.0

func (m *Marshaler) MarshalGateway(gateway store.Gateway) ([]byte, error)

func (*Marshaler) MarshalRoute added in v0.5.0

func (m *Marshaler) MarshalRoute(route store.Route) ([]byte, error)

func (*Marshaler) UnmarshalGateway added in v0.5.0

func (m *Marshaler) UnmarshalGateway(data []byte) (store.Gateway, error)

func (*Marshaler) UnmarshalRoute added in v0.5.0

func (m *Marshaler) UnmarshalRoute(data []byte) (store.Route, error)

type ReconcileManager

type ReconcileManager interface {
	UpsertGatewayClass(ctx context.Context, gc *gwv1beta1.GatewayClass) error
	UpsertGateway(ctx context.Context, g *gwv1beta1.Gateway) error
	UpsertHTTPRoute(ctx context.Context, r *gwv1alpha2.HTTPRoute) error
	UpsertTCPRoute(ctx context.Context, r *gwv1alpha2.TCPRoute) error
	DeleteGatewayClass(ctx context.Context, name string) error
	DeleteGateway(ctx context.Context, name types.NamespacedName) error
	DeleteHTTPRoute(ctx context.Context, name types.NamespacedName) error
	DeleteTCPRoute(ctx context.Context, name types.NamespacedName) error
}

type Route

type Route interface {
	client.Object
	schema.ObjectKind
}

Route represents any Kubernetes route type - currently v1alpha2.HTTPRoute and v1alpha2.TCPRoute - as both implement client.Object and schema.ObjectKind

type StatusUpdater added in v0.5.0

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

func NewStatusUpdater added in v0.5.0

func NewStatusUpdater(logger hclog.Logger, client gatewayclient.Client, deployer *GatewayDeployer, controllerName string) *StatusUpdater

func (*StatusUpdater) UpdateGatewayStatusOnSync added in v0.5.0

func (s *StatusUpdater) UpdateGatewayStatusOnSync(ctx context.Context, gateway store.Gateway, sync func() (bool, error)) error

func (*StatusUpdater) UpdateRouteStatus added in v0.5.0

func (s *StatusUpdater) UpdateRouteStatus(ctx context.Context, route store.Route) error

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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