cmd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: AGPL-3.0 Imports: 44 Imported by: 0

Documentation

Overview

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Index

Constants

View Source
const (
	IngressClassNameAnnotation = "kubernetes.io/ingress.class"
	GuestClassLabel            = "kink.meln5674.github.com/guest-ingress-class"

	ServiceFinalizer = "kink.meln5674.github.com/lb-manager-svc"
	IngressFinalizer = "kink.meln5674.github.com/lb-manager-ingress"
)
View Source
const (
	ClusterConfigEnv = "KINKCONFIG"
	ClusterNameEnv   = "KINK_CLUSTER_NAME"
)

Variables

This section is empty.

Functions

func ConvertPort added in v0.2.0

func ConvertPort(namespace, name string, port *corev1.ServicePort) corev1.ServicePort

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GetClassName added in v0.2.0

func GetClassName(ing *netv1.Ingress) (string, bool)

func PortName added in v0.2.0

func PortName(namespace, name string, port *corev1.ServicePort) string

PortName produces a predictable port name from a guest service. This is done in a way that can be matched in the helm chart, allowing us to create static ingresses for guest NodePort services without knowing their assigned nodeports ahead of time, and without imposing further name length restrictions. This works by taking a 32-bit checksum of the "namespace/name/portname" of the port, then formatting as hex, padding to a max of 8 characters with a prefix

Types

type IngressController added in v0.2.0

type IngressController struct {
	Host    client.Client
	Guest   client.Client
	Log     logr.Logger
	Targets map[string]*netv1.Ingress
	// namespace - name -> class
	IngressClasses map[string]map[string]string
	// class -> namespace -> name -> unit
	ClassIngresses map[string]map[string]map[string]struct{}
	// namespace -> name -> host -> paths
	IngressPaths map[string]map[string]map[string][]netv1.HTTPIngressPath
}

func (*IngressController) Reconcile added in v0.2.0

func (i *IngressController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

type IngressControllerRun added in v0.2.0

type IngressControllerRun struct {
	*IngressController
	Ingress     *netv1.Ingress
	GuestClass  string
	MappedClass *cfg.LoadBalancerIngressClassMapping
	Log         logr.Logger
	Ctx         context.Context
}

func (*IngressControllerRun) CreateOrUpdateHostIngress added in v0.2.0

func (i *IngressControllerRun) CreateOrUpdateHostIngress(guestClass string) error

func (*IngressControllerRun) GenerateHostIngress added in v0.2.0

func (i *IngressControllerRun) GenerateHostIngress() error

func (*IngressControllerRun) GenerateHostIngressMetadata added in v0.2.0

func (i *IngressControllerRun) GenerateHostIngressMetadata()

func (*IngressControllerRun) HandleFinalizer added in v0.2.0

func (i *IngressControllerRun) HandleFinalizer() (deleted bool, err error)

func (*IngressControllerRun) RemovePaths added in v0.2.0

func (i *IngressControllerRun) RemovePaths()

func (*IngressControllerRun) UpsertPaths added in v0.2.0

func (i *IngressControllerRun) UpsertPaths() (oldClass string)

type ServiceController added in v0.2.0

type ServiceController struct {
	Host             client.Client
	Guest            client.Client
	Log              logr.Logger
	NodePorts        map[int32]corev1.ServicePort
	ServiceNodePorts map[string]map[string][]int32
	LBSvc            *corev1.Service
}

func (*ServiceController) Reconcile added in v0.2.0

func (s *ServiceController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*ServiceController) SetHostLBMetadata added in v0.2.0

func (s *ServiceController) SetHostLBMetadata()

type ServiceControllerRun added in v0.2.0

type ServiceControllerRun struct {
	*ServiceController
	Log logr.Logger
	Svc *corev1.Service
	Ctx context.Context
}

func (*ServiceControllerRun) CreateOrUpdateHostLB added in v0.2.0

func (s *ServiceControllerRun) CreateOrUpdateHostLB() error

func (*ServiceControllerRun) GenerateHostLB added in v0.2.0

func (s *ServiceControllerRun) GenerateHostLB()

func (*ServiceControllerRun) HandleFinalizer added in v0.2.0

func (s *ServiceControllerRun) HandleFinalizer() (deleted bool, err error)

func (*ServiceControllerRun) RemovePorts added in v0.2.0

func (s *ServiceControllerRun) RemovePorts()

func (*ServiceControllerRun) SetLBIngress added in v0.2.0

func (s *ServiceControllerRun) SetLBIngress() error

func (*ServiceControllerRun) UpsertPorts added in v0.2.0

func (s *ServiceControllerRun) UpsertPorts()

Jump to

Keyboard shortcuts

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