k8s

package
v0.0.0-...-7d1f045 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlbTag            = prefix + "/group-name"
	SecurityGroups    = prefix + "/security-groups"
	SecurityProfileID = prefix + "/security-profile-id"
	Subnets           = prefix + "/subnets"

	ExternalIPv4Address = prefix + "/external-ipv4-address"
	ExternalIPv6Address = prefix + "/external-ipv6-address"
	InternalIPv4Address = prefix + "/internal-ipv4-address"
	InternalALBSubnet   = prefix + "/internal-alb-subnet"

	RequestTimeout = prefix + "/request-timeout"
	IdleTimeout    = prefix + "/idle-timeout"
	PrefixRewrite  = prefix + "/prefix-rewrite"
	UpgradeTypes   = prefix + "/upgrade-types"
	AllowedMethods = prefix + "/allowed-methods"

	Protocol          = prefix + "/protocol"
	TransportSecurity = prefix + "/transport-security"
	HealthChecks      = prefix + "/health-checks"

	UseRegex     = prefix + "/use-regex"
	OrderInGroup = prefix + "/group-order"

	BalancingMode = prefix + "/balancing-mode"

	SessionAffinityPrefix     = prefix + "/session-affinity-"
	SessionAffinityHeader     = SessionAffinityPrefix + "header"
	SessionAffinityCookie     = SessionAffinityPrefix + "cookie"
	SessionAffinityConnection = SessionAffinityPrefix + "connection"

	GroupSettings = prefix + "/group-settings-name"

	ModifyResponseHeaderPrefix  = prefix + "/modify-header-response-"
	ModifyResponseHeaderReplace = ModifyResponseHeaderPrefix + "replace"
	ModifyResponseHeaderAppend  = ModifyResponseHeaderPrefix + "append"
	ModifyResponseHeaderRename  = ModifyResponseHeaderPrefix + "rename"
	ModifyResponseHeaderRemove  = ModifyResponseHeaderPrefix + "remove"

	DirectResponsePrefix = prefix + "/direct-response."
	RedirectPrefix       = prefix + "/redirect."

	DefaultIngressClass = "ingressclass.kubernetes.io/is-default-class"

	PreferIPv6Targets = prefix + "/prefer-ipv6-targets"
)
View Source
const CertIDPrefix = "yc-certmgr-cert-id-"
View Source
const (
	ControllerName = "ingress.alb.yc.io/yc-alb-ingress-controller"
)
View Source
const (
	Finalizer = "ingress.ya.ru/final"
)

Variables

This section is empty.

Functions

func GetBalancerTag

func GetBalancerTag(o metav1.Object) string

func GetIngressGroupAnnotation

func GetIngressGroupAnnotation(g *IngressGroup, annotation string) (string, error)

func GetNodeInternalIP

func GetNodeInternalIP(node *corev1.Node, preferIPv6 bool) (string, error)

func HasBalancerTag

func HasBalancerTag(o metav1.Object) bool

func InstanceID

func InstanceID(node v1.Node) (string, error)

func IsIPv6

func IsIPv6(addr string) bool

func IsIngressManagedByThisController

func IsIngressManagedByThisController(ing v1.Ingress, classes v1.IngressClassList) bool

func IsServiceManaged

func IsServiceManaged(ctx context.Context, cli client.Client, svc v1.Service) (bool, error)

func IsServiceReferencedByIngress

func IsServiceReferencedByIngress(svc v1.Service, ing networking.Ingress) bool

func IsTLS

func IsTLS(host string, tls []networking.IngressTLS) bool

func NamespacedNameOf

func NamespacedNameOf(object client.Object) types.NamespacedName

func ParseConfigsFromAnnotationValue

func ParseConfigsFromAnnotationValue(s string) (map[string]string, error)

func ParseModifyHeadersFromAnnotationValue

func ParseModifyHeadersFromAnnotationValue(s string) (map[string]string, error)

func ParseSecrets

func ParseSecrets(ings []networking.Ingress) map[types.NamespacedName]struct{}

Types

type DefaultServiceLoader

type DefaultServiceLoader struct {
	Client client.Client
}

func (*DefaultServiceLoader) Load

type FinalizerManager

type FinalizerManager struct{ Client client.Client }

func (*FinalizerManager) RemoveFinalizer

func (m *FinalizerManager) RemoveFinalizer(ctx context.Context, o client.Object, finalizer string) error

func (*FinalizerManager) UpdateFinalizer

func (m *FinalizerManager) UpdateFinalizer(ctx context.Context, o client.Object, finalizer string) error

type GroupSettingsLoader

type GroupSettingsLoader struct {
	Client client.Client
}

func (*GroupSettingsLoader) Load

type GroupStatusManager

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

func NewGroupStatusManager

func NewGroupStatusManager(cli client.Client) *GroupStatusManager

func (*GroupStatusManager) AddBackendGroupID

func (h *GroupStatusManager) AddBackendGroupID(ctx context.Context, status *v1alpha1.IngressGroupStatus, bgID string) error

func (*GroupStatusManager) AddTargetGroupID

func (h *GroupStatusManager) AddTargetGroupID(ctx context.Context, status *v1alpha1.IngressGroupStatus, tgID string) error

func (*GroupStatusManager) DeleteStatus

func (h *GroupStatusManager) DeleteStatus(ctx context.Context, name string) error

func (*GroupStatusManager) LoadOrCreateStatus

func (h *GroupStatusManager) LoadOrCreateStatus(ctx context.Context, name string) (*v1alpha1.IngressGroupStatus, error)

func (*GroupStatusManager) LoadStatus

func (*GroupStatusManager) RemoveBackendGroupID

func (h *GroupStatusManager) RemoveBackendGroupID(ctx context.Context, status *v1alpha1.IngressGroupStatus, bgID string) error

func (*GroupStatusManager) RemoveTargetGroupID

func (h *GroupStatusManager) RemoveTargetGroupID(ctx context.Context, status *v1alpha1.IngressGroupStatus, tgID string) error

func (*GroupStatusManager) SetBalancerResourcesIDs

func (h *GroupStatusManager) SetBalancerResourcesIDs(ctx context.Context, status *v1alpha1.IngressGroupStatus, resources ResourcesIDs) error

type IngressGroup

type IngressGroup struct {
	Tag     string
	Items   []v1.Ingress
	Deleted []v1.Ingress
}

type IngressLoader

type IngressLoader interface {
	List(ctx context.Context, opts ...client.ListOption) ([]networking.Ingress, error)

	ListBySvc(ctx context.Context, svc core.Service) ([]networking.Ingress, error)
}

func NewIngressLoader

func NewIngressLoader(cli client.Client) IngressLoader

type Loader

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

func NewGroupLoader

func NewGroupLoader(cli client.Client) *Loader

func (*Loader) Load

func (l *Loader) Load(ctx context.Context, nsName types.NamespacedName) (*IngressGroup, error)

type NodeGroup

type NodeGroup struct {
	Items []v1.Node
}

type NodeLoader

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

func NewNodeGroupLoader

func NewNodeGroupLoader(cli client.Client) *NodeLoader

func (*NodeLoader) Load

func (l *NodeLoader) Load() (*NodeGroup, error)

type ResourcesIDs

type ResourcesIDs struct {
	BalancerID  string
	RouterID    string
	TLSRouterID string
}

type SecretManager

type SecretManager interface {
	ManageGroup(ctx context.Context, group *IngressGroup)
}

func NewSecretManager

func NewSecretManager(clientSet kubernetes.Interface, secretEventChan chan<- event.GenericEvent) SecretManager

type SecretsStore

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

func NewSecretsStore

func NewSecretsStore(secretsEventChan chan<- event.GenericEvent, keyFunc cache.KeyFunc) *SecretsStore

func (*SecretsStore) Add

func (s *SecretsStore) Add(i interface{}) error

func (*SecretsStore) Delete

func (s *SecretsStore) Delete(i interface{}) error

func (*SecretsStore) Get

func (s *SecretsStore) Get(obj interface{}) (item interface{}, exists bool, err error)

func (*SecretsStore) GetByKey

func (s *SecretsStore) GetByKey(key string) (item interface{}, exists bool, err error)

func (*SecretsStore) List

func (s *SecretsStore) List() []interface{}

func (*SecretsStore) ListKeys

func (s *SecretsStore) ListKeys() []string

func (*SecretsStore) Replace

func (s *SecretsStore) Replace(list []interface{}, resourceVersion string) error

func (*SecretsStore) Resync

func (s *SecretsStore) Resync() error

func (*SecretsStore) Update

func (s *SecretsStore) Update(i interface{}) error

type ServiceLoader

type ServiceLoader interface {
	Load(context.Context, types.NamespacedName) (ServiceToReconcile, error)
}

type ServiceToReconcile

type ServiceToReconcile struct {
	ToReconcile *v1.Service
	ToDelete    *v1.Service
}

type StatusUpdater

type StatusUpdater struct {
	Client client.Client
}

func (*StatusUpdater) SetIngressStatus

func (e *StatusUpdater) SetIngressStatus(ing *networking.Ingress, status networking.IngressStatus) error

TODO: update only if needed

Jump to

Keyboard shortcuts

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