Documentation
¶
Index ¶
- Variables
- func CreateFirewallOptsForSvc(label string, tags []string, svc *v1.Service) (*linodego.FirewallCreateOptions, 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) UpdateNodeBalancerFirewall(ctx context.Context, loadBalancerName string, loadBalancerTags []string, ...) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
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) 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.
Click to show internal directories.
Click to hide internal directories.