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
 - func ConvertPort(namespace, name string, port *corev1.ServicePort) corev1.ServicePort
 - func Execute()
 - func GetClassName(ing *netv1.Ingress) (string, bool)
 - func PortName(namespace, name string, port *corev1.ServicePort) string
 - type IngressController
 - type IngressControllerRun
 - func (i *IngressControllerRun) CreateOrUpdateHostIngress(guestClass string) error
 - func (i *IngressControllerRun) GenerateHostIngress() error
 - func (i *IngressControllerRun) GenerateHostIngressMetadata()
 - func (i *IngressControllerRun) HandleFinalizer() (deleted bool, err error)
 - func (i *IngressControllerRun) RemovePaths()
 - func (i *IngressControllerRun) UpsertPaths() (oldClass string)
 
- type ServiceController
 - type ServiceControllerRun
 - func (s *ServiceControllerRun) CreateOrUpdateHostLB() error
 - func (s *ServiceControllerRun) GenerateHostLB()
 - func (s *ServiceControllerRun) HandleFinalizer() (deleted bool, err error)
 - func (s *ServiceControllerRun) RemovePorts()
 - func (s *ServiceControllerRun) SetLBIngress() error
 - func (s *ServiceControllerRun) UpsertPorts()
 
Constants ¶
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" )
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 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
}
    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) 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()