Documentation
¶
Index ¶
- Variables
- func CreateFirewallOptsForSvc(label string, tags []string, svc *v1.Service) (*linodego.FirewallCreateOptions, error)
- func GetAllVPCIDs() []int
- func GetNodeBalancerBackendIPv4SubnetID(client client.Client) (int, error)
- func GetSubnetID(ctx context.Context, client client.Client, vpcID int, subnetName string) (int, error)
- func GetVPCID(ctx context.Context, client client.Client, vpcName string) (int, error)
- func GetVPCIPAddresses(ctx context.Context, client client.Client, vpcName string) ([]linodego.VPCIP, error)
- func GetVPCIPv6Addresses(ctx context.Context, client client.Client, vpcName string) ([]linodego.VPCIP, error)
- func ValidateAndSetVPCSubnetFlags(client client.Client) error
- type Instances
- func (i *Instances) InstanceExists(ctx context.Context, node *v1.Node) (bool, error)
- func (i *Instances) InstanceMetadata(ctx context.Context, node *v1.Node) (*cloudprovider.InstanceMetadata, error)
- func (i *Instances) InstanceShutdown(ctx context.Context, node *v1.Node) (bool, error)
- func (i *Instances) ListAllInstances(ctx context.Context) ([]linodego.Instance, error)
- func (i *Instances) LookupLinode(ctx context.Context, node *v1.Node) (*linodego.Instance, error)
- type LinodeClient
- func (l *LinodeClient) CreateFirewall(ctx context.Context, opts linodego.FirewallCreateOptions) (fw *linodego.Firewall, err error)
- func (l *LinodeClient) DeleteFirewall(ctx context.Context, firewall *linodego.Firewall) error
- func (l *LinodeClient) DeleteNodeBalancerFirewall(ctx context.Context, service *v1.Service, nb *linodego.NodeBalancer) error
- func (l *LinodeClient) UpdateNodeBalancerFirewall(ctx context.Context, loadBalancerName string, loadBalancerTags []string, ...) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetNodeBalancerBackendIPv4SubnetID ¶
GetNodeBalancerBackendIPv4SubnetID returns the subnet ID for the NodeBalancer backend IPv4 subnet. It uses the first VPC name from Options.VPCNames to find the VPC ID and then retrieves the subnet ID for the NodeBalancer backend IPv4 subnet name specified in Options.NodeBalancerBackendIPv4SubnetName.
func GetSubnetID ¶
func GetSubnetID(ctx context.Context, client client.Client, vpcID int, subnetName string) (int, error)
GetSubnetID returns the subnet ID of given subnet label
func GetVPCIPAddresses ¶
func GetVPCIPAddresses(ctx context.Context, client client.Client, vpcName string) ([]linodego.VPCIP, error)
GetVPCIPAddresses returns vpc ip's for given VPC label
func GetVPCIPv6Addresses ¶
func ValidateAndSetVPCSubnetFlags ¶
ValidateAndSetVPCSubnetFlags validates the VPC and subnet flags and sets the vpcNames and subnetNames options. It retrieves the VPC names and subnet names from the Linode API based on the provided flags. If subnet IDs are provided, it resolves the subnet names based on the first VPC ID.
Types ¶
type Instances ¶
type Instances struct {
// contains filtered or unexported fields
}
func NewInstances ¶
NewInstances creates a new Instances cache with a specified TTL for the nodeCache.
func (*Instances) InstanceExists ¶
func (*Instances) InstanceMetadata ¶
func (i *Instances) InstanceMetadata(ctx context.Context, node *v1.Node) (*cloudprovider.InstanceMetadata, error)
func (*Instances) InstanceShutdown ¶
func (*Instances) ListAllInstances ¶
ListAllInstances returns all instances in nodeCache
type LinodeClient ¶
func (*LinodeClient) CreateFirewall ¶
func (l *LinodeClient) CreateFirewall(ctx context.Context, opts linodego.FirewallCreateOptions) (fw *linodego.Firewall, err error)
func (*LinodeClient) DeleteFirewall ¶
func (*LinodeClient) DeleteNodeBalancerFirewall ¶
func (l *LinodeClient) DeleteNodeBalancerFirewall( ctx context.Context, service *v1.Service, nb *linodego.NodeBalancer, ) error
func (*LinodeClient) UpdateNodeBalancerFirewall ¶
func (l *LinodeClient) UpdateNodeBalancerFirewall( ctx context.Context, loadBalancerName string, loadBalancerTags []string, service *v1.Service, nb *linodego.NodeBalancer, ) error
UpdateNodeBalancerFirewall reconciles the firewall attached to the nodebalancer
This function does the following
- If a firewallID annotation is present, it checks if the nodebalancer has a firewall attached, and if it matches the annotationID a. If the IDs match, nothing to do here. b. If they don't match, the nb is attached to the new firewall and removed from the old one.
- If a firewallACL annotation is present, a. it checks if the nodebalancer has a firewall attached, if a fw exists, it updates rules b. if a fw does not exist, it creates one
- If neither of these annotations are present, a. AND if no firewalls are attached to the nodebalancer, nothing to do. b. if the NB has ONE firewall attached, remove it from nb, and clean up if nothing else is attached to it c. If there are more than one fw attached to it, then its a problem, return an err
- If both these annotations are present, the firewallID takes precedence, and the ACL annotation is ignored.
IF a user creates a fw ID externally, and then switches to using a ACL, the CCM will take over the fw that's attached to the nodebalancer.